# riteshmaurya07/code_x_live architecture

> Architecture diagram of the GitHub repository riteshmaurya07/code_x_live, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/riteshmaurya07/code_x_live
- Repository: https://github.com/riteshmaurya07/code_x_live

## Overview

CodeXLive is a collaborative coding workspace with a developer social hub. Users authenticate, open or create projects, then edit files collaboratively; project capabilities include room governance, messaging, meetings, compilation, AI assistance, version history, and social networking. The graph combines README-documented capabilities with relationships visible in sampled frontend and backend sources. Some feature internals were not sampled, so those documented links cite the README rather than implying source inspection.

Main entry points: [`client/src/components/EditorPage.jsx`](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/components/EditorPage.jsx) (Collaborative editor), [`client/src/App.jsx`](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/App.jsx) (App routing), [`server/sockets/handlers/yjsHandlers.js`](https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/handlers/yjsHandlers.js) (Yjs collaboration), [`server/controllers/fileController.js`](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/fileController.js) (File and version API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth["Authentication<br/>[useAuth.jsx]"]
  node_dashboard["Project dashboard<br/>[Dashboard.jsx]"]
  node_editor["Collaborative editor<br/>[EditorPage.jsx]"]
  node_filetree["File tree<br/>[useFileTree.js]"]
  node_editor_socket["Editor socket sync<br/>[useRoomSocket.js]"]
  node_calling["Video and audio calls<br/>[useWebRTC.js]"]
end

subgraph group_workspace["Collaborative workspace"]
  node_yjs["Yjs collaboration<br/>[yjsHandlers.js]"]
  node_room_state["Room permissions<br/>[roomState.js]"]
  node_compiler["Code compilation"]
  node_ai["AI assistance<br/>[aiController.js]"]
end

subgraph group_backend["Backend services"]
  node_projects["Project and sharing"]
  node_file_api["File and version API<br/>[fileController.js]"]
  node_file_routes["File routes and RBAC<br/>[fileRoutes.js]"]
  node_socket_entry["Socket dispatch<br/>[socketHandler.js]"]
  node_mongo[("MongoDB<br/>[db.js]")]
end

subgraph group_social["Social and communication"]
  node_meetings["Meeting scheduler"]
  node_messaging["Chat and messaging<br/>[chatHandlers.js]"]
  node_social_api["Developer social<br/>[userController.js]"]
  node_activity["Activity history"]
end

subgraph group_integrations["External integrations"]
  node_jdoodle["JDoodle compiler"]
  node_gemini["Google Gemini"]
end

node_developer(("Developer"))
node_peer(("Other call participants"))

node_developer -->|"opens"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_editor
node_dashboard -.->|"manages projects"| node_projects
node_editor -.->|"manages files"| node_filetree
node_editor -->|"syncs room"| node_editor_socket
node_editor_socket -->|"connects events"| node_socket_entry
node_socket_entry -->|"registers handler"| node_yjs
node_yjs -->|"checks permissions"| node_room_state
node_yjs -->|"persists updates"| node_mongo
node_file_routes -->|"routes requests"| node_file_api
node_file_api -->|"stores files and versions"| node_mongo
node_editor -.->|"reads and saves"| node_file_api
node_editor -.->|"submits code"| node_compiler
node_compiler -.->|"compiles with"| node_jdoodle
node_editor -.->|"requests assistance"| node_ai
node_ai -.->|"prompts"| node_gemini
node_editor -.->|"schedules meetings"| node_meetings
node_editor -.->|"exchanges messages"| node_messaging
node_developer -.->|"builds network"| node_social_api
node_social_api -.->|"views activity"| node_activity
node_calling -.->|"streams peer-to-peer"| node_peer

click node_app "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/App.jsx"
click node_auth "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/useAuth.jsx"
click node_dashboard "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/pages/Dashboard.jsx"
click node_editor "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/components/EditorPage.jsx"
click node_filetree "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/editor/useFileTree.js"
click node_editor_socket "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/editor/useRoomSocket.js"
click node_calling "https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/useWebRTC.js"
click node_projects "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/projectController.js"
click node_file_api "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/fileController.js"
click node_file_routes "https://github.com/riteshmaurya07/code_x_live/blob/main/server/routes/fileRoutes.js"
click node_socket_entry "https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/socketHandler.js"
click node_yjs "https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/handlers/yjsHandlers.js"
click node_room_state "https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/roomState.js"
click node_compiler "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/compileController.js"
click node_ai "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/aiController.js"
click node_meetings "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/meetingController.js"
click node_messaging "https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/handlers/chatHandlers.js"
click node_social_api "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/userController.js"
click node_activity "https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/activityController.js"
click node_mongo "https://github.com/riteshmaurya07/code_x_live/blob/main/server/config/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth,node_dashboard,node_editor,node_filetree,node_editor_socket,node_calling toneBlue
class node_yjs,node_room_state,node_compiler,node_ai toneAmber
class node_projects,node_file_api,node_file_routes,node_socket_entry,node_mongo toneMint
class node_meetings,node_messaging,node_social_api,node_activity toneRose
class node_jdoodle,node_gemini,node_developer,node_peer toneIndigo
```

## Components

### Client experience

- [App routing](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Authentication](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/useAuth.jsx): `client/src/hooks/useAuth.jsx`
- [Project dashboard](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Collaborative editor](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/components/EditorPage.jsx): `client/src/components/EditorPage.jsx`
- [File tree](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/editor/useFileTree.js): `client/src/hooks/editor/useFileTree.js`
- [Editor socket sync](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/editor/useRoomSocket.js): `client/src/hooks/editor/useRoomSocket.js`
- [Video and audio calls](https://github.com/riteshmaurya07/code_x_live/blob/main/client/src/hooks/useWebRTC.js): `client/src/hooks/useWebRTC.js`

### Collaborative workspace

- [Yjs collaboration](https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/handlers/yjsHandlers.js): `server/sockets/handlers/yjsHandlers.js`
- [Room permissions](https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/roomState.js): `server/sockets/roomState.js`
- [Code compilation](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/compileController.js): `server/controllers/compileController.js`
- [AI assistance](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/aiController.js): `server/controllers/aiController.js`

### Backend services

- [Project and sharing](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/projectController.js): `server/controllers/projectController.js`
- [File and version API](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/fileController.js): `server/controllers/fileController.js`
- [File routes and RBAC](https://github.com/riteshmaurya07/code_x_live/blob/main/server/routes/fileRoutes.js): `server/routes/fileRoutes.js`
- [Socket dispatch](https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/socketHandler.js): `server/sockets/socketHandler.js`
- [MongoDB](https://github.com/riteshmaurya07/code_x_live/blob/main/server/config/db.js): `server/config/db.js`

### Social and communication

- [Meeting scheduler](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/meetingController.js): `server/controllers/meetingController.js`
- [Chat and messaging](https://github.com/riteshmaurya07/code_x_live/blob/main/server/sockets/handlers/chatHandlers.js): `server/sockets/handlers/chatHandlers.js`
- [Developer social](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/userController.js): `server/controllers/userController.js`
- [Activity history](https://github.com/riteshmaurya07/code_x_live/blob/main/server/controllers/activityController.js): `server/controllers/activityController.js`

### External integrations

- **JDoodle compiler**
- **Google Gemini**

### Other components

- **Developer**
- **Other call participants**

## Connections

- Developer → App routing: opens (evidence: `client/src/App.jsx`)
- App routing → Authentication: provides auth (evidence: `client/src/App.jsx`)
- App routing → Project dashboard: routes to (evidence: `client/src/App.jsx`)
- App routing → Collaborative editor: routes to (evidence: `client/src/App.jsx`)
- Project dashboard → Project and sharing: manages projects (evidence: `README.md`)
- Collaborative editor → File tree: manages files (evidence: `README.md`)
- Collaborative editor → Editor socket sync: syncs room (evidence: `client/src/hooks/editor/useRoomSocket.js`)
- Editor socket sync → Socket dispatch: connects events (evidence: `client/src/hooks/editor/useRoomSocket.js`)
- Socket dispatch → Yjs collaboration: registers handler (evidence: `server/sockets/socketHandler.js`)
- Yjs collaboration → Room permissions: checks permissions (evidence: `server/sockets/handlers/yjsHandlers.js`)
- Yjs collaboration → MongoDB: persists updates (evidence: `server/sockets/handlers/yjsHandlers.js`)
- File routes and RBAC → File and version API: routes requests (evidence: `server/routes/fileRoutes.js`)
- File and version API → MongoDB: stores files and versions (evidence: `server/controllers/fileController.js`)
- Collaborative editor → File and version API: reads and saves (evidence: `README.md`)
- Collaborative editor → Code compilation: submits code (evidence: `README.md`)
- Code compilation → JDoodle compiler: compiles with (evidence: `README.md`)
- Collaborative editor → AI assistance: requests assistance (evidence: `README.md`)
- AI assistance → Google Gemini: prompts (evidence: `README.md`)
- Collaborative editor → Meeting scheduler: schedules meetings (evidence: `README.md`)
- Collaborative editor → Chat and messaging: exchanges messages (evidence: `README.md`)
- Developer → Developer social: builds network (evidence: `README.md`)
- Developer social → Activity history: views activity (evidence: `README.md`)
- Video and audio calls → Other call participants: streams peer-to-peer (evidence: `README.md`)
