# dheerajrai-dev/syncroom architecture

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

- Interactive diagram: https://gitdiagram.com/dheerajrai-dev/syncroom
- Repository: https://github.com/dheerajrai-dev/syncroom

## Overview

SyncRoom is a collaborative room and ephemeral-chat application. Users authenticate, create or join rooms, pass through locked-room approval when required, and then collaborate through live messaging and participant updates; account holders can also review dashboards and room history. The backend separates HTTP endpoints, business services, persistence, and WebSocket runtime state. README capabilities such as TTL cleanup and host migration are represented, though their internal call paths were not sampled; uncertain links are dashed or omitted.

Main entry points: [`app/db/room_repository.py`](https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/room_repository.py) (Room repository), [`frontend/src/app/router.tsx`](https://github.com/dheerajrai-dev/syncroom/blob/main/frontend/src/app/router.tsx) (Page routing), [`app/websockets/router.py`](https://github.com/dheerajrai-dev/syncroom/blob/main/app/websockets/router.py) (Room WebSocket handler), [`app/api/v1/auth.py`](https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/auth.py) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web Client"]
  node_web_router["Page routing<br/>[router.tsx]"]
  node_room_pages["Room lifecycle screens"]
  node_account_pages["Account screens"]
  node_history_pages["Dashboard and history"]
end

subgraph group_http["HTTP and Services"]
  node_auth_api["Auth endpoints<br/>[auth.py]"]
  node_auth_service["Account authentication<br/>[auth_service.py]"]
  node_jwt["Token and password security<br/>[auth.py]"]
  node_room_api["Room endpoints<br/>[rooms.py]"]
  node_user_api["Profile endpoints<br/>[users.py]"]
  node_dashboard_api["Dashboard endpoints<br/>[dashboard.py]"]
  node_dashboard_service["Dashboard and transcripts"]
  node_room_service["Room lifecycle logic<br/>[room_service.py]"]
  node_ttl_service["TTL cleanup"]
  node_migration_service["Host migration"]
end

subgraph group_realtime["Realtime Rooms"]
  node_ws_router["Room WebSocket handler<br/>[router.py]"]
  node_runtime_state["Connections and chat state<br/>[storage.py]"]
end

subgraph group_persistence["Persistence"]
  node_room_repo["Room repository<br/>[room_repository.py]"]
  node_participant_repo["Participant repository"]
  node_message_repo["Message repository"]
  node_user_model["User model<br/>[user.py]"]
  node_room_model["Room model<br/>[room.py]"]
end

node_user(("Room user"))
node_database[("PostgreSQL")]

node_user -->|"uses"| node_web_router
node_web_router -->|"routes to"| node_room_pages
node_web_router -->|"routes to"| node_account_pages
node_web_router -->|"routes to"| node_history_pages
node_room_pages -.->|"requests room actions"| node_room_api
node_account_pages -.->|"authenticates"| node_auth_api
node_history_pages -.->|"requests history"| node_dashboard_api
node_auth_api -->|"calls"| node_auth_service
node_auth_api -->|"issues tokens"| node_jwt
node_auth_service -->|"hashes passwords"| node_jwt
node_auth_service -->|"creates and checks"| node_user_model
node_room_api -.->|"delegates room logic"| node_room_service
node_dashboard_api -.->|"delegates"| node_dashboard_service
node_dashboard_service -.->|"reads room history"| node_database
node_room_service -.->|"persists room state"| node_room_repo
node_ttl_service -.->|"expires rooms"| node_room_repo
node_migration_service -.->|"updates host state"| node_room_repo
node_ws_router -->|"loads room"| node_room_repo
node_ws_router -->|"loads participants"| node_participant_repo
node_ws_router -->|"manages live sessions"| node_runtime_state
node_runtime_state -->|"deletes room row"| node_room_repo
node_room_repo -->|"queries and updates"| node_room_model
node_participant_repo -.->|"reads and writes participants"| node_database
node_message_repo -.->|"stores transcripts"| node_database
node_room_repo -.->|"persists rooms"| node_database

click node_web_router "https://github.com/dheerajrai-dev/syncroom/blob/main/frontend/src/app/router.tsx"
click node_room_pages "https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages"
click node_account_pages "https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages"
click node_history_pages "https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages"
click node_auth_api "https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/auth.py"
click node_auth_service "https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/auth_service.py"
click node_jwt "https://github.com/dheerajrai-dev/syncroom/blob/main/app/core/auth.py"
click node_room_api "https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/rooms.py"
click node_user_api "https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/users.py"
click node_dashboard_api "https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/dashboard.py"
click node_dashboard_service "https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/dashboard_service.py"
click node_room_service "https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/room_service.py"
click node_ttl_service "https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/ttl_sweep_service.py"
click node_migration_service "https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/migration_service.py"
click node_ws_router "https://github.com/dheerajrai-dev/syncroom/blob/main/app/websockets/router.py"
click node_runtime_state "https://github.com/dheerajrai-dev/syncroom/blob/main/app/core/storage.py"
click node_room_repo "https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/room_repository.py"
click node_participant_repo "https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/participant_repository.py"
click node_message_repo "https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/message_repository.py"
click node_user_model "https://github.com/dheerajrai-dev/syncroom/blob/main/app/models/user.py"
click node_room_model "https://github.com/dheerajrai-dev/syncroom/blob/main/app/models/room.py"

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_web_router,node_room_pages,node_account_pages,node_history_pages,node_user toneBlue
class node_auth_api,node_auth_service,node_jwt,node_room_api,node_user_api,node_dashboard_api,node_dashboard_service,node_room_service,node_ttl_service,node_migration_service,node_database toneAmber
class node_ws_router,node_runtime_state toneMint
class node_room_repo,node_participant_repo,node_message_repo,node_user_model,node_room_model toneRose
```

## Components

### Web Client

- [Page routing](https://github.com/dheerajrai-dev/syncroom/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Room lifecycle screens](https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages): `frontend/src/pages`
- [Account screens](https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages): `frontend/src/pages`
- [Dashboard and history](https://github.com/dheerajrai-dev/syncroom/tree/main/frontend/src/pages): `frontend/src/pages`

### HTTP and Services

- [Auth endpoints](https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/auth.py): `app/api/v1/auth.py`
- [Account authentication](https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/auth_service.py): `app/services/auth_service.py`
- [Token and password security](https://github.com/dheerajrai-dev/syncroom/blob/main/app/core/auth.py): `app/core/auth.py`
- [Room endpoints](https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/rooms.py): `app/api/v1/rooms.py`
- [Profile endpoints](https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/users.py): `app/api/v1/users.py`
- [Dashboard endpoints](https://github.com/dheerajrai-dev/syncroom/blob/main/app/api/v1/dashboard.py): `app/api/v1/dashboard.py`
- [Dashboard and transcripts](https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/dashboard_service.py): `app/services/dashboard_service.py`
- [Room lifecycle logic](https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/room_service.py): `app/services/room_service.py`
- [TTL cleanup](https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/ttl_sweep_service.py): `app/services/ttl_sweep_service.py`
- [Host migration](https://github.com/dheerajrai-dev/syncroom/blob/main/app/services/migration_service.py): `app/services/migration_service.py`

### Realtime Rooms

- [Room WebSocket handler](https://github.com/dheerajrai-dev/syncroom/blob/main/app/websockets/router.py): `app/websockets/router.py`
- [Connections and chat state](https://github.com/dheerajrai-dev/syncroom/blob/main/app/core/storage.py): `app/core/storage.py`

### Persistence

- [Room repository](https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/room_repository.py): `app/db/room_repository.py`
- [Participant repository](https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/participant_repository.py): `app/db/participant_repository.py`
- [Message repository](https://github.com/dheerajrai-dev/syncroom/blob/main/app/db/message_repository.py): `app/db/message_repository.py`
- [User model](https://github.com/dheerajrai-dev/syncroom/blob/main/app/models/user.py): `app/models/user.py`
- [Room model](https://github.com/dheerajrai-dev/syncroom/blob/main/app/models/room.py): `app/models/room.py`

### Other components

- **Room user**
- **PostgreSQL**

## Connections

- Room user → Page routing: uses (evidence: `frontend/src/app/router.tsx`)
- Page routing → Room lifecycle screens: routes to (evidence: `frontend/src/app/router.tsx`)
- Page routing → Account screens: routes to (evidence: `frontend/src/app/router.tsx`)
- Page routing → Dashboard and history: routes to (evidence: `frontend/src/app/router.tsx`)
- Room lifecycle screens → Room endpoints: requests room actions
- Account screens → Auth endpoints: authenticates
- Dashboard and history → Dashboard endpoints: requests history
- Auth endpoints → Account authentication: calls (evidence: `app/api/v1/auth.py`)
- Auth endpoints → Token and password security: issues tokens (evidence: `app/api/v1/auth.py`)
- Account authentication → Token and password security: hashes passwords (evidence: `app/services/auth_service.py`)
- Account authentication → User model: creates and checks (evidence: `app/services/auth_service.py`)
- Room endpoints → Room lifecycle logic: delegates room logic
- Dashboard endpoints → Dashboard and transcripts: delegates
- Dashboard and transcripts → PostgreSQL: reads room history (evidence: `README.md`)
- Room lifecycle logic → Room repository: persists room state
- TTL cleanup → Room repository: expires rooms (evidence: `README.md`)
- Host migration → Room repository: updates host state (evidence: `README.md`)
- Room WebSocket handler → Room repository: loads room (evidence: `app/websockets/router.py`)
- Room WebSocket handler → Participant repository: loads participants (evidence: `app/websockets/router.py`)
- Room WebSocket handler → Connections and chat state: manages live sessions (evidence: `app/websockets/router.py`)
- Connections and chat state → Room repository: deletes room row (evidence: `app/core/storage.py`)
- Room repository → Room model: queries and updates (evidence: `app/db/room_repository.py`)
- Participant repository → PostgreSQL: reads and writes participants (evidence: `README.md`)
- Message repository → PostgreSQL: stores transcripts (evidence: `README.md`)
- Room repository → PostgreSQL: persists rooms (evidence: `README.md`)
