# dhruv-dhemare/digicafe architecture

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

- Interactive diagram: https://gitdiagram.com/dhruv-dhemare/digicafe
- Repository: https://github.com/dhruv-dhemare/digicafe

## Overview

DigiCafe is a browser-based group calling and sharing app. Users create or join a room, enter a name, then use a room workspace for group video, chat, and peer-to-peer file sharing; the README documents rooms of up to six participants. The client coordinates WebRTC peers and exchanges signaling through a WebSocket server, while the server manages room membership and records activity in PostgreSQL. The source excerpts show key client/server links, but not every signaling handler or UI action, so uncertain connections are omitted.

Main entry points: [`client/src/pages/RoomLayout.jsx`](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx) (Room workspace), [`server/src/index.js`](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/index.js) (Signaling runtime), [`client/src/App.jsx`](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/App.jsx) (App flow), [`client/src/services/multiPeerManager.js`](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/multiPeerManager.js) (Peer manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client experience"]
  node_app["App flow<br/>[App.jsx]"]
  node_landing["Landing page<br/>[LandingPage.jsx]"]
  node_name["Name prompt<br/>[NameModal.jsx]"]
  node_room["Room workspace<br/>[RoomLayout.jsx]"]
end

subgraph group_realtime["Realtime collaboration"]
  node_video["Video calls<br/>[RoomLayout.jsx]"]
  node_chat["Group chat<br/>[RoomLayout.jsx]"]
  node_files["File sharing<br/>[RoomLayout.jsx]"]
  node_watchparty["Watch party view<br/>[WatchPartyView.jsx]"]
  node_peers["Peer manager"]
  node_rtc["RTC peer logic<br/>[rtcPeer.js]"]
  node_wsclient["WebSocket client<br/>[websocket.js]"]
end

subgraph group_server["Signaling server"]
  node_signaling["Signaling runtime<br/>[index.js]"]
  node_roomstate["Room manager<br/>[roomManager.js]"]
  node_routes["HTTP routes<br/>[index.js]"]
  node_tokens["JWT service<br/>[jwtService.js]"]
end

subgraph group_persistence["Persistence"]
  node_dbservice["Database service<br/>[databaseService.js]"]
  node_dbconfig["Database connection<br/>[database.js]"]
  node_postgres[("PostgreSQL")]
end

node_participant(("Participant"))

node_participant -->|"opens"| node_app
node_app -->|"renders"| node_landing
node_app -->|"prompts"| node_name
node_app -->|"enters"| node_room
node_participant -->|"joins room"| node_room
node_room -->|"signals through"| node_wsclient
node_room -->|"manages peers"| node_peers
node_peers -->|"exchanges signaling"| node_wsclient
node_room -->|"hosts"| node_video
node_room -->|"hosts"| node_chat
node_room -->|"hosts"| node_files
node_room -->|"renders"| node_watchparty
node_signaling -->|"manages rooms"| node_roomstate
node_signaling -->|"uses routes"| node_routes
node_signaling -->|"records activity"| node_dbservice
node_signaling -->|"uses tokens"| node_tokens
node_dbservice -->|"queries through"| node_dbconfig
node_dbconfig -->|"connects to"| node_postgres

click node_app "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/App.jsx"
click node_landing "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/LandingPage.jsx"
click node_name "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/components/NameModal.jsx"
click node_room "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx"
click node_video "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx"
click node_chat "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx"
click node_files "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx"
click node_watchparty "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/components/WatchPartyView.jsx"
click node_peers "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/multiPeerManager.js"
click node_rtc "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/rtcPeer.js"
click node_wsclient "https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/websocket.js"
click node_signaling "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/index.js"
click node_roomstate "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/roomManager.js"
click node_routes "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/routes/index.js"
click node_tokens "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/jwtService.js"
click node_dbservice "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/databaseService.js"
click node_dbconfig "https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/config/database.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_landing,node_name,node_room toneBlue
class node_video,node_chat,node_files,node_watchparty,node_peers,node_rtc,node_wsclient toneAmber
class node_signaling,node_roomstate,node_routes,node_tokens toneMint
class node_dbservice,node_dbconfig,node_postgres toneRose
class node_participant toneIndigo
```

## Components

### Client experience

- [App flow](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Landing page](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/LandingPage.jsx): `client/src/pages/LandingPage.jsx`
- [Name prompt](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/components/NameModal.jsx): `client/src/components/NameModal.jsx`
- [Room workspace](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx): `client/src/pages/RoomLayout.jsx`

### Realtime collaboration

- [Video calls](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx): `client/src/pages/RoomLayout.jsx`
- [Group chat](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx): `client/src/pages/RoomLayout.jsx`
- [File sharing](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/pages/RoomLayout.jsx): `client/src/pages/RoomLayout.jsx`
- [Watch party view](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/components/WatchPartyView.jsx): `client/src/components/WatchPartyView.jsx`
- [Peer manager](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/multiPeerManager.js): `client/src/services/multiPeerManager.js`
- [RTC peer logic](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/rtcPeer.js): `client/src/services/rtcPeer.js`
- [WebSocket client](https://github.com/dhruv-dhemare/digicafe/blob/main/client/src/services/websocket.js): `client/src/services/websocket.js`

### Signaling server

- [Signaling runtime](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/index.js): `server/src/index.js`
- [Room manager](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/roomManager.js): `server/src/services/roomManager.js`
- [HTTP routes](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/routes/index.js): `server/src/routes/index.js`
- [JWT service](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/jwtService.js): `server/src/services/jwtService.js`

### Persistence

- [Database service](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/services/databaseService.js): `server/src/services/databaseService.js`
- [Database connection](https://github.com/dhruv-dhemare/digicafe/blob/main/server/src/config/database.js): `server/src/config/database.js`
- **PostgreSQL**

### Other components

- **Participant**

## Connections

- Participant → App flow: opens (evidence: `README.md`)
- App flow → Landing page: renders (evidence: `client/src/App.jsx`)
- App flow → Name prompt: prompts (evidence: `client/src/App.jsx`)
- App flow → Room workspace: enters (evidence: `client/src/App.jsx`)
- Participant → Room workspace: joins room (evidence: `README.md`)
- Room workspace → WebSocket client: signals through (evidence: `client/src/pages/RoomLayout.jsx`)
- Room workspace → Peer manager: manages peers (evidence: `client/src/pages/RoomLayout.jsx`)
- Peer manager → WebSocket client: exchanges signaling (evidence: `client/src/services/multiPeerManager.js`)
- Room workspace → Video calls: hosts (evidence: `README.md`)
- Room workspace → Group chat: hosts (evidence: `README.md`)
- Room workspace → File sharing: hosts (evidence: `README.md`)
- Room workspace → Watch party view: renders (evidence: `client/src/pages/RoomLayout.jsx`)
- Signaling runtime → Room manager: manages rooms (evidence: `server/src/index.js`)
- Signaling runtime → HTTP routes: uses routes (evidence: `server/src/index.js`)
- Signaling runtime → Database service: records activity (evidence: `server/src/index.js`)
- Signaling runtime → JWT service: uses tokens (evidence: `server/src/index.js`)
- Database service → Database connection: queries through (evidence: `server/src/services/databaseService.js`)
- Database connection → PostgreSQL: connects to (evidence: `server/src/config/database.js`)
