CometChat Visual Builder Directory Structure
This document provides an overview of the CometChat Visual Builder directory structure, helping you understand the organization of the project and where to find specific files when you need to customize or extend functionality.
Overview
The CometChat Visual Builder follows a modular structure organized by feature and functionality. All Visual Builder files are contained within the src/CometChat/
directory.
src/
├── CometChat/
│ ├── assets/
│ ├── components/
│ ├── context/
│ ├── locales/
│ ├── styles/
│ ├── utils/
│ ├── CometChatApp.tsx
│ ├── CometChatSettings.ts
│ ├── customHooks.ts
│ ├── decl.d.ts
│ └── styleConfig.ts
├── App.css
├── App.tsx
└── index.tsx
Directory Details
Root Files
File | Description |
---|---|
CometChatApp.tsx | The main entry point for the Visual Builder application. This is the component you import in your project to render the chat experience. |
CometChatSettings.ts | Contains configuration settings for the Visual Builder, including UI elements, features, and theming options. |
customHooks.ts | Custom React hooks used throughout the application. |
decl.d.ts | TypeScript declaration file for type definitions. |
styleConfig.ts | Configuration file for styling across the application. |
Key Directories
assets/
Contains UI resources like icons, images, and audio files used throughout the application.
assets/
│ ├── chats.svg
│ ├── calls.svg
│ ├── users.svg
│ ├── groups.svg
│ └── (Other UI icons and images)
components/
Contains all React components that make up the UI of the Visual Builder.
components/
├── CometChatAddMembers/
│ ├── CometChatAddMembers.tsx
│ └── useCometChatAddMembers.ts
├── CometChatAlertPopup/
│ └── CometChatAlertPopup.tsx
├── CometChatBannedMembers/
│ └── CometChatBannedMembers.tsx
├── CometChatCallLog/
│ ├── CometChatCallLogDetails.tsx
│ ├── CometChatCallLogHistory.tsx
│ ├── CometChatCallLogInfo.tsx
│ ├── CometChatCallLogParticipants.tsx
│ └── CometChatCallLogRecordings.tsx
├── CometChatCreateGroup/
│ └── CometChatCreateGroup.tsx
├── CometChatDetails/
│ ├── CometChatThreadedMessages.tsx
│ └── CometChatUserDetails.tsx
├── CometChatHome/
│ └── CometChatHome.tsx
├── CometChatJoinGroup/
│ └── CometChatJoinGroup.tsx
├── CometChatLogin/
│ ├── CometChatAppCredentials.tsx
│ ├── CometChatLogin.tsx
│ └── sampledata.ts
├── CometChatMessages/
│ ├── CometChatEmptyStateView.tsx
│ └── CometChatMessages.tsx
├── CometChatSelector/
│ ├── CometChatSelector.tsx
│ └── CometChatTabs.tsx
└── CometChatTransferOwnership/
├── CometChatTransferOwnership.tsx
└── useCometChatTransferOwnership.ts
Each component folder typically contains:
- The main component file (
.tsx
) - Associated hook files (
use*.ts
) for component logic - Subcomponents specific to that feature area
context/
Contains React Context providers used for state management across the application.
context/
├── AppContext.tsx # Main application context
├── CometChatContext.tsx # Context for builder settings
└── appReducer.ts # Reducer functions for AppContext
locales/
Contains translations for different languages, enabling localization of the UI.
locales/ (Contains translations for different languages)
├── en/en.json
├── fr/fr.json
├── de/de.json
└── (Other language JSON files)
styles/
Contains CSS files for styling components, organized to mirror the components directory structure.
styles/
├── CometChatAddMembers/
│ └── CometChatAddMembers.css
├── CometChatAlertPopup/
│ └── CometChatAlertPopup.css
├── CometChatBannedMembers/
│ └── CometChatBannedMembers.css
├── CometChatCallLog/
│ ├── CometChatCallLogDetails.css
│ ├── CometChatCallLogHistory.css
│ ├── CometChatCallLogInfo.css
│ ├── CometChatCallLogParticipants.css
│ └── CometChatCallLogRecordings.css
├── CometChatCreateGroup/
│ └── CometChatCreateGroup.css