# mukund-xo/watchparty architecture

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

- Interactive diagram: https://gitdiagram.com/mukund-xo/watchparty
- Repository: https://github.com/mukund-xo/watchparty

## Overview

SynCinema is a browser-based campus watch-party application: users browse a film catalog, create or join a passkey room, then watch together with synchronized playback and room chat. The main app coordinates the lobby and room view; room controls use a cross-tab sync channel, while account and theme settings are client-side contexts. The graph reflects the sampled source and SOURCE INDEX references; unsampled implementations are represented only where their relationships are evidenced.

Main entry points: [`src/App.tsx`](https://github.com/mukund-xo/watchparty/blob/main/src/App.tsx) (App Coordinator), [`src/utils/security.ts`](https://github.com/mukund-xo/watchparty/blob/main/src/utils/security.ts) (Input and Sync Validation), [`src/components/CreateRoomModal.tsx`](https://github.com/mukund-xo/watchparty/blob/main/src/components/CreateRoomModal.tsx) (Room Setup), [`src/components/WatchRoomView.tsx`](https://github.com/mukund-xo/watchparty/blob/main/src/components/WatchRoomView.tsx) (Room Playback and Chat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Lobby Experience"]
  node_app["App Coordinator<br/>[App.tsx]"]
  node_topbar["Top Bar<br/>[TopBar.tsx]"]
  node_hero["Hero Section<br/>[HeroSection.tsx]"]
  node_listings["Film Listings<br/>[ListingsGrid.tsx]"]
  node_how_sync["Sync Guide<br/>[HowSyncWorks.tsx]"]
  node_footer["Lobby Footer<br/>[Footer.tsx]"]
  node_clapper["Clapper Logo<br/>[ClapperLogo.tsx]"]
end

subgraph group_screening["Watch Rooms"]
  node_create_room["Room Setup"]
  node_watch_room["Room Playback and Chat<br/>[WatchRoomView.tsx]"]
  node_sync_channel["Sync Channel<br/>[SyncEngine.ts]"]
end

subgraph group_identity["Identity and Theme"]
  node_account_modal["Account Settings<br/>[AccountModal.tsx]"]
  node_auth["User Identity<br/>[AuthContext.tsx]"]
  node_theme["Theme Settings<br/>[ThemeContext.tsx]"]
end

subgraph group_foundation["App Foundations"]
  node_catalog["Film Catalog<br/>[movies.ts]"]
  node_security["Input and Sync Validation<br/>[security.ts]"]
end

node_viewer(("Viewer"))

node_viewer -->|"uses"| node_app
node_app -->|"renders"| node_topbar
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_listings
node_app -->|"renders"| node_how_sync
node_app -->|"renders"| node_footer
node_app -->|"opens"| node_create_room
node_app -->|"renders"| node_watch_room
node_app -->|"selects film from"| node_catalog
node_app -->|"validates room code with"| node_security
node_topbar -->|"opens"| node_account_modal
node_topbar -->|"renders"| node_clapper
node_listings -->|"reads"| node_catalog
node_create_room -->|"selects from"| node_catalog
node_create_room -->|"generates room code with"| node_sync_channel
node_create_room -->|"reads host identity"| node_auth
node_create_room -->|"validates inputs with"| node_security
node_watch_room -->|"creates and receives from"| node_sync_channel
node_watch_room -->|"reads current user"| node_auth
node_watch_room -->|"rate limits chat with"| node_security
node_sync_channel -->|"validates actions with"| node_security
node_account_modal -->|"updates identity through"| node_auth
node_account_modal -->|"updates appearance through"| node_theme
node_account_modal -->|"sanitizes text with"| node_security
node_auth -->|"sanitizes nickname with"| node_security

click node_app "https://github.com/mukund-xo/watchparty/blob/main/src/App.tsx"
click node_topbar "https://github.com/mukund-xo/watchparty/blob/main/src/components/TopBar.tsx"
click node_hero "https://github.com/mukund-xo/watchparty/blob/main/src/components/HeroSection.tsx"
click node_listings "https://github.com/mukund-xo/watchparty/blob/main/src/components/ListingsGrid.tsx"
click node_how_sync "https://github.com/mukund-xo/watchparty/blob/main/src/components/HowSyncWorks.tsx"
click node_footer "https://github.com/mukund-xo/watchparty/blob/main/src/components/Footer.tsx"
click node_clapper "https://github.com/mukund-xo/watchparty/blob/main/src/components/ClapperLogo.tsx"
click node_create_room "https://github.com/mukund-xo/watchparty/blob/main/src/components/CreateRoomModal.tsx"
click node_watch_room "https://github.com/mukund-xo/watchparty/blob/main/src/components/WatchRoomView.tsx"
click node_sync_channel "https://github.com/mukund-xo/watchparty/blob/main/src/components/SyncEngine.ts"
click node_account_modal "https://github.com/mukund-xo/watchparty/blob/main/src/components/AccountModal.tsx"
click node_auth "https://github.com/mukund-xo/watchparty/blob/main/src/context/AuthContext.tsx"
click node_theme "https://github.com/mukund-xo/watchparty/blob/main/src/context/ThemeContext.tsx"
click node_catalog "https://github.com/mukund-xo/watchparty/blob/main/src/data/movies.ts"
click node_security "https://github.com/mukund-xo/watchparty/blob/main/src/utils/security.ts"

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_topbar,node_hero,node_listings,node_how_sync,node_footer,node_clapper,node_viewer toneBlue
class node_create_room,node_watch_room,node_sync_channel toneAmber
class node_account_modal,node_auth,node_theme toneMint
class node_catalog,node_security toneRose
```

## Components

### Lobby Experience

- [App Coordinator](https://github.com/mukund-xo/watchparty/blob/main/src/App.tsx): `src/App.tsx`
- [Top Bar](https://github.com/mukund-xo/watchparty/blob/main/src/components/TopBar.tsx): `src/components/TopBar.tsx`
- [Hero Section](https://github.com/mukund-xo/watchparty/blob/main/src/components/HeroSection.tsx): `src/components/HeroSection.tsx`
- [Film Listings](https://github.com/mukund-xo/watchparty/blob/main/src/components/ListingsGrid.tsx): `src/components/ListingsGrid.tsx`
- [Sync Guide](https://github.com/mukund-xo/watchparty/blob/main/src/components/HowSyncWorks.tsx): `src/components/HowSyncWorks.tsx`
- [Lobby Footer](https://github.com/mukund-xo/watchparty/blob/main/src/components/Footer.tsx): `src/components/Footer.tsx`
- [Clapper Logo](https://github.com/mukund-xo/watchparty/blob/main/src/components/ClapperLogo.tsx): `src/components/ClapperLogo.tsx`

### Watch Rooms

- [Room Setup](https://github.com/mukund-xo/watchparty/blob/main/src/components/CreateRoomModal.tsx): `src/components/CreateRoomModal.tsx`
- [Room Playback and Chat](https://github.com/mukund-xo/watchparty/blob/main/src/components/WatchRoomView.tsx): `src/components/WatchRoomView.tsx`
- [Sync Channel](https://github.com/mukund-xo/watchparty/blob/main/src/components/SyncEngine.ts): `src/components/SyncEngine.ts`

### Identity and Theme

- [Account Settings](https://github.com/mukund-xo/watchparty/blob/main/src/components/AccountModal.tsx): `src/components/AccountModal.tsx`
- [User Identity](https://github.com/mukund-xo/watchparty/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Theme Settings](https://github.com/mukund-xo/watchparty/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`

### App Foundations

- [Film Catalog](https://github.com/mukund-xo/watchparty/blob/main/src/data/movies.ts): `src/data/movies.ts`
- [Input and Sync Validation](https://github.com/mukund-xo/watchparty/blob/main/src/utils/security.ts): `src/utils/security.ts`

### Other components

- **Viewer**

## Connections

- Viewer → App Coordinator: uses
- App Coordinator → Top Bar: renders (evidence: `src/App.tsx`)
- App Coordinator → Hero Section: renders (evidence: `src/App.tsx`)
- App Coordinator → Film Listings: renders (evidence: `src/App.tsx`)
- App Coordinator → Sync Guide: renders (evidence: `src/App.tsx`)
- App Coordinator → Lobby Footer: renders (evidence: `src/App.tsx`)
- App Coordinator → Room Setup: opens (evidence: `src/App.tsx`)
- App Coordinator → Room Playback and Chat: renders (evidence: `src/App.tsx`)
- App Coordinator → Film Catalog: selects film from (evidence: `src/App.tsx`)
- App Coordinator → Input and Sync Validation: validates room code with (evidence: `src/App.tsx`)
- Top Bar → Account Settings: opens (evidence: `src/components/TopBar.tsx`)
- Top Bar → Clapper Logo: renders (evidence: `src/components/TopBar.tsx`)
- Film Listings → Film Catalog: reads (evidence: `src/components/ListingsGrid.tsx`)
- Room Setup → Film Catalog: selects from (evidence: `src/components/CreateRoomModal.tsx`)
- Room Setup → Sync Channel: generates room code with (evidence: `src/components/CreateRoomModal.tsx`)
- Room Setup → User Identity: reads host identity (evidence: `src/components/CreateRoomModal.tsx`)
- Room Setup → Input and Sync Validation: validates inputs with (evidence: `src/components/CreateRoomModal.tsx`)
- Room Playback and Chat → Sync Channel: creates and receives from (evidence: `src/components/WatchRoomView.tsx`)
- Room Playback and Chat → User Identity: reads current user (evidence: `src/components/WatchRoomView.tsx`)
- Room Playback and Chat → Input and Sync Validation: rate limits chat with (evidence: `src/components/WatchRoomView.tsx`)
- Sync Channel → Input and Sync Validation: validates actions with (evidence: `src/components/SyncEngine.ts`)
- Account Settings → User Identity: updates identity through (evidence: `src/components/AccountModal.tsx`)
- Account Settings → Theme Settings: updates appearance through (evidence: `src/components/AccountModal.tsx`)
- Account Settings → Input and Sync Validation: sanitizes text with (evidence: `src/components/AccountModal.tsx`)
- User Identity → Input and Sync Validation: sanitizes nickname with (evidence: `src/context/AuthContext.tsx`)
