# muhammed-ali-dev/parlorbit architecture

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

- Interactive diagram: https://gitdiagram.com/muhammed-ali-dev/parlorbit
- Repository: https://github.com/muhammed-ali-dev/parlorbit

## Overview

Parlorbit supports private Codenames nights: guests create Houses, invite friends for host approval, organize rooms, and play together with live presence; optional calls add voice and video. The React app uses HTTP for House and invite actions and WebSockets for room presence and switching. The Go server handles routes and domain operations, with SQLite-backed state. Mutation Lab is a secondary multiplayer experiment, and the Codenames arena is another documented game capability. The graph reflects README claims and sampled references; unsampled implementations and connections are shown only where documented.

Main entry points: [`internal/app/server.go`](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/server.go) (HTTP server), [`web/src/App.tsx`](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/App.tsx) (Parlorbit UI), [`web/src/voice.ts`](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/voice.ts) (Voice client), [`internal/app/store.go`](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/store.go) (SQLite store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Parlorbit UI<br/>[App.tsx]"]
  node_housecard["House cards<br/>[HouseCard.tsx]"]
  node_api["HTTP client<br/>[api.ts]"]
  node_realtimeclient["Realtime client<br/>[realtime.ts]"]
  node_voiceclient["Voice client<br/>[voice.ts]"]
  node_videotile["Video tiles<br/>[VideoTile.tsx]"]
end

subgraph group_server["Application server"]
  node_httpserver["HTTP server<br/>[server.go]"]
  node_membership["House membership"]
  node_roommanagement["Room management"]
  node_gameassignment["Game assignment"]
  node_voiceauth["Voice tokens<br/>[voice.go]"]
end

subgraph group_games["Games and calls"]
  node_codenames["Codenames arena"]
  node_mutationlab["Mutation Lab<br/>[battle.go]"]
  node_livekit["LiveKit calls"]
end

subgraph group_state["Persistence and realtime"]
  node_store[("SQLite store<br/>[store.go]")]
  node_repository["House repository<br/>[repository.go]"]
  node_hub["Realtime hub<br/>[hub.go]"]
  node_outbox["Realtime outbox<br/>[realtime_outbox.go]"]
end

node_guest(("Guest"))

node_guest -->|"uses"| node_app
node_app -->|"renders"| node_housecard
node_app -->|"requests"| node_api
node_app -.->|"subscribes"| node_realtimeclient
node_app -->|"joins calls"| node_voiceclient
node_videotile -->|"attaches tracks"| node_voiceclient
node_api -->|"HTTP requests"| node_httpserver
node_realtimeclient -->|"WebSocket messages"| node_httpserver
node_httpserver -->|"reads and writes"| node_store
node_httpserver -.->|"handles membership"| node_membership
node_httpserver -.->|"handles rooms"| node_roommanagement
node_httpserver -.->|"sets room game"| node_gameassignment
node_httpserver -->|"broadcasts updates"| node_hub
node_httpserver -->|"issues tokens"| node_voiceauth
node_voiceclient -->|"requests token"| node_api
node_voiceclient -->|"connects"| node_livekit
node_app -.->|"opens game"| node_codenames
node_app -.->|"supports experiment"| node_mutationlab
node_codenames -.->|"sends game actions"| node_httpserver
node_mutationlab -.->|"uses persisted state"| node_store
node_store -.->|"stores domain data"| node_repository
node_hub -.->|"reads presence state"| node_store
node_hub -.->|"queues updates"| node_outbox

click node_app "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/App.tsx"
click node_housecard "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/components/HouseCard.tsx"
click node_api "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/api.ts"
click node_realtimeclient "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/realtime.ts"
click node_voiceclient "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/voice.ts"
click node_videotile "https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/components/VideoTile.tsx"
click node_httpserver "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/server.go"
click node_membership "https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app"
click node_roommanagement "https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app"
click node_gameassignment "https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app"
click node_voiceauth "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/voice.go"
click node_codenames "https://github.com/muhammed-ali-dev/parlorbit/tree/main/web/public/battle"
click node_mutationlab "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/battle.go"
click node_store "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/store.go"
click node_repository "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/repository.go"
click node_hub "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/hub.go"
click node_outbox "https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/realtime_outbox.go"

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_housecard,node_api,node_realtimeclient,node_voiceclient,node_videotile toneBlue
class node_httpserver,node_membership,node_roommanagement,node_gameassignment,node_voiceauth toneAmber
class node_codenames,node_mutationlab,node_livekit toneMint
class node_store,node_repository,node_hub,node_outbox toneRose
class node_guest toneIndigo
```

## Components

### Web client

- [Parlorbit UI](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [House cards](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/components/HouseCard.tsx): `web/src/components/HouseCard.tsx`
- [HTTP client](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/api.ts): `web/src/api.ts`
- [Realtime client](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/realtime.ts): `web/src/realtime.ts`
- [Voice client](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/voice.ts): `web/src/voice.ts`
- [Video tiles](https://github.com/muhammed-ali-dev/parlorbit/blob/main/web/src/components/VideoTile.tsx): `web/src/components/VideoTile.tsx`

### Application server

- [HTTP server](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/server.go): `internal/app/server.go`
- [House membership](https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app): `internal/app`
- [Room management](https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app): `internal/app`
- [Game assignment](https://github.com/muhammed-ali-dev/parlorbit/tree/main/internal/app): `internal/app`
- [Voice tokens](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/voice.go): `internal/app/voice.go`

### Games and calls

- [Codenames arena](https://github.com/muhammed-ali-dev/parlorbit/tree/main/web/public/battle): `web/public/battle`
- [Mutation Lab](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/battle.go): `internal/app/battle.go`
- **LiveKit calls**

### Persistence and realtime

- [SQLite store](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/store.go): `internal/app/store.go`
- [House repository](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/repository.go): `internal/app/repository.go`
- [Realtime hub](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/hub.go): `internal/app/hub.go`
- [Realtime outbox](https://github.com/muhammed-ali-dev/parlorbit/blob/main/internal/app/realtime_outbox.go): `internal/app/realtime_outbox.go`

### Other components

- **Guest**

## Connections

- Guest → Parlorbit UI: uses (evidence: `README.md`)
- Parlorbit UI → House cards: renders (evidence: `web/src/App.tsx`)
- Parlorbit UI → HTTP client: requests (evidence: `web/src/App.tsx`)
- Parlorbit UI → Realtime client: subscribes (evidence: `web/src/App.tsx`)
- Parlorbit UI → Voice client: joins calls (evidence: `web/src/App.tsx`)
- Video tiles → Voice client: attaches tracks (evidence: `web/src/components/VideoTile.tsx`)
- HTTP client → HTTP server: HTTP requests (evidence: `web/src/api.ts`)
- Realtime client → HTTP server: WebSocket messages (evidence: `web/src/realtime.ts`)
- HTTP server → SQLite store: reads and writes (evidence: `internal/app/server.go`)
- HTTP server → House membership: handles membership
- HTTP server → Room management: handles rooms
- HTTP server → Game assignment: sets room game
- HTTP server → Realtime hub: broadcasts updates (evidence: `internal/app/server.go`)
- HTTP server → Voice tokens: issues tokens (evidence: `internal/app/server.go`)
- Voice client → HTTP client: requests token (evidence: `web/src/voice.ts`)
- Voice client → LiveKit calls: connects (evidence: `web/src/voice.ts`)
- Parlorbit UI → Codenames arena: opens game (evidence: `README.md`)
- Parlorbit UI → Mutation Lab: supports experiment (evidence: `README.md`)
- Codenames arena → HTTP server: sends game actions
- Mutation Lab → SQLite store: uses persisted state
- SQLite store → House repository: stores domain data
- Realtime hub → SQLite store: reads presence state
- Realtime hub → Realtime outbox: queues updates
