# tarun-maddimsetty/realtime-collaborative-coding-platform architecture

> Architecture diagram of the GitHub repository tarun-maddimsetty/realtime-collaborative-coding-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tarun-maddimsetty/realtime-collaborative-coding-platform
- Repository: https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform

## Overview

This is a browser-based collaborative coding application: users authenticate, create or join rooms, edit and share code/files, and run code or preview web projects. Room and file operations are exposed through the Express API and persisted in MongoDB; code execution is handled by a separate backend controller that invokes local language runtimes. The server also initializes Socket.IO room handling for realtime collaboration. The README is empty, and several relevant source files were not sampled, so uncertain UI-to-service and socket-event wiring is not shown.

Main entry points: [`backend/server.js`](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/server.js) (HTTP and socket server), [`backend/controllers/roomController.js`](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/roomController.js) (Room and file operations), [`backend/controllers/authController.js`](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/authController.js) (Authentication), [`frontend/src/services/api.js`](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App routes<br/>[App.jsx]"]
  node_auth_hook["Auth state<br/>[useAuth.js]"]
  node_api_client["API client<br/>[api.js]"]
  node_room_service["Room service<br/>[roomService.js]"]
  node_execute_service["Execution service<br/>[executeService.js]"]
  node_room_page["Coding room<br/>[Room.jsx]"]
  node_file_pages["Saved files<br/>[SavedFilesPage.jsx]"]
end

subgraph group_api["HTTP API"]
  node_server["HTTP and socket server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_room_routes["Room routes<br/>[roomRoutes.js]"]
  node_file_routes["File routes<br/>[fileRoutes.js]"]
  node_execute_routes["Execution routes<br/>[executeRoutes.js]"]
end

subgraph group_domain["Rooms and persistence"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_room_controller["Room and file operations<br/>[roomController.js]"]
  node_user_model[("Users<br/>[User.js]")]
  node_room_model[("Rooms<br/>[Room.js]")]
  node_file_model[("Code files<br/>[File.js]")]
  node_saved_file_model[("Saved files<br/>[SavedFile.js]")]
  node_message_model[("Messages<br/>[Message.js]")]
  node_db["Database connection<br/>[db.js]"]
end

subgraph group_runtime["Realtime and execution"]
  node_room_socket["Room sockets<br/>[roomSocket.js]"]
  node_execute_controller["Code execution and preview"]
end

node_developer(("Developer"))
node_google(("Google Identity"))
node_mongo[("MongoDB")]
node_language_tools(("Language tools"))

node_developer -->|"uses"| node_app
node_auth_hook -->|"requests"| node_api_client
node_auth_hook -->|"authenticates via"| node_auth_routes
node_google -.->|"verifies identity"| node_auth_controller
node_app -->|"routes to"| node_room_page
node_room_page -->|"room operations"| node_room_service
node_file_pages -->|"file operations"| node_room_service
node_room_service -->|"sends requests"| node_api_client
node_execute_service -->|"sends requests"| node_api_client
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_room_routes
node_server -->|"mounts"| node_file_routes
node_server -->|"mounts"| node_execute_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_room_routes -->|"dispatches"| node_room_controller
node_file_routes -->|"dispatches"| node_room_controller
node_execute_routes -->|"dispatches"| node_execute_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_controller -->|"reads"| node_room_model
node_auth_controller -->|"reads"| node_saved_file_model
node_room_controller -->|"reads and writes"| node_room_model
node_room_controller -->|"writes"| node_file_model
node_room_controller -->|"reads and writes"| node_saved_file_model
node_room_controller -->|"uses"| node_message_model
node_server -->|"connects"| node_db
node_db -->|"connects to"| node_mongo
node_server -->|"initializes"| node_room_socket
node_execute_controller -->|"compiles and runs"| node_language_tools

click node_app "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/App.jsx"
click node_auth_hook "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/hooks/useAuth.js"
click node_api_client "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/api.js"
click node_room_service "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/roomService.js"
click node_execute_service "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/executeService.js"
click node_room_page "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/pages/Room.jsx"
click node_file_pages "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/pages/SavedFilesPage.jsx"
click node_server "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/server.js"
click node_auth_routes "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/authRoutes.js"
click node_room_routes "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/roomRoutes.js"
click node_file_routes "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/fileRoutes.js"
click node_execute_routes "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/executeRoutes.js"
click node_auth_controller "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/authController.js"
click node_room_controller "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/roomController.js"
click node_user_model "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/User.js"
click node_room_model "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/Room.js"
click node_file_model "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/File.js"
click node_saved_file_model "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/SavedFile.js"
click node_message_model "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/Message.js"
click node_db "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/config/db.js"
click node_room_socket "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/socket/roomSocket.js"
click node_execute_controller "https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/executeController.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_hook,node_api_client,node_room_service,node_execute_service,node_room_page,node_file_pages toneBlue
class node_server,node_auth_routes,node_room_routes,node_file_routes,node_execute_routes,node_mongo toneAmber
class node_auth_controller,node_room_controller,node_user_model,node_room_model,node_file_model,node_saved_file_model,node_message_model,node_db toneMint
class node_room_socket,node_execute_controller toneRose
class node_developer,node_google,node_language_tools toneIndigo
```

## Components

### Web client

- [App routes](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/hooks/useAuth.js): `frontend/src/hooks/useAuth.js`
- [API client](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Room service](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/roomService.js): `frontend/src/services/roomService.js`
- [Execution service](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/services/executeService.js): `frontend/src/services/executeService.js`
- [Coding room](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/pages/Room.jsx): `frontend/src/pages/Room.jsx`
- [Saved files](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/frontend/src/pages/SavedFilesPage.jsx): `frontend/src/pages/SavedFilesPage.jsx`

### HTTP API

- [HTTP and socket server](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Room routes](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/roomRoutes.js): `backend/routes/roomRoutes.js`
- [File routes](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/fileRoutes.js): `backend/routes/fileRoutes.js`
- [Execution routes](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/routes/executeRoutes.js): `backend/routes/executeRoutes.js`

### Rooms and persistence

- [Authentication](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [Room and file operations](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/roomController.js): `backend/controllers/roomController.js`
- [Users](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/User.js): `backend/models/User.js`
- [Rooms](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/Room.js): `backend/models/Room.js`
- [Code files](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/File.js): `backend/models/File.js`
- [Saved files](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/SavedFile.js): `backend/models/SavedFile.js`
- [Messages](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/models/Message.js): `backend/models/Message.js`
- [Database connection](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/config/db.js): `backend/config/db.js`

### Realtime and execution

- [Room sockets](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/socket/roomSocket.js): `backend/socket/roomSocket.js`
- [Code execution and preview](https://github.com/tarun-maddimsetty/realtime-collaborative-coding-platform/blob/main/backend/controllers/executeController.js): `backend/controllers/executeController.js`

### Other components

- **Developer**
- **Google Identity**
- **MongoDB**
- **Language tools**

## Connections

- Developer → App routes: uses
- Auth state → API client: requests
- Auth state → Auth routes: authenticates via
- Google Identity → Authentication: verifies identity
- App routes → Coding room: routes to
- Coding room → Room service: room operations
- Saved files → Room service: file operations
- Room service → API client: sends requests
- Execution service → API client: sends requests
- API client → HTTP and socket server: HTTP requests
- HTTP and socket server → Auth routes: mounts
- HTTP and socket server → Room routes: mounts
- HTTP and socket server → File routes: mounts
- HTTP and socket server → Execution routes: mounts
- Auth routes → Authentication: dispatches
- Room routes → Room and file operations: dispatches
- File routes → Room and file operations: dispatches
- Execution routes → Code execution and preview: dispatches
- Authentication → Users: reads and writes
- Authentication → Rooms: reads
- Authentication → Saved files: reads
- Room and file operations → Rooms: reads and writes
- Room and file operations → Code files: writes
- Room and file operations → Saved files: reads and writes
- Room and file operations → Messages: uses
- HTTP and socket server → Database connection: connects
- Database connection → MongoDB: connects to
- HTTP and socket server → Room sockets: initializes
- Code execution and preview → Language tools: compiles and runs
