# allexandere/jeopardy architecture

> Architecture diagram of the GitHub repository allexandere/jeopardy, 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/allexandere/jeopardy
- Repository: https://github.com/allexandere/jeopardy

## Overview

Jeopardy is a local, in-memory multiplayer trivia game: an organizer selects a board and runs clues, players join and buzz from phones, and a spectator screen displays the synchronized board and video. The server applies game actions and broadcasts state over SSE; clients render that state and send actions back. The graph includes documented themes, customization, and effects. Some server and client wiring is inferred only where the README explicitly documents it; unsampled details are omitted.

Main entry points: [`server.js`](https://github.com/allexandere/jeopardy/blob/main/server.js) (HTTP server), [`public/js/sync.js`](https://github.com/allexandere/jeopardy/blob/main/public/js/sync.js) (Client sync), [`public/js/client/render.js`](https://github.com/allexandere/jeopardy/blob/main/public/js/client/render.js) (Board rendering), [`public/js/menu.js`](https://github.com/allexandere/jeopardy/blob/main/public/js/menu.js) (Theme menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game workflow"]
  node_menu["Theme menu<br/>[menu.js]"]
  node_join["Player join<br/>[controls.js]"]
  node_rules["Game rules<br/>[game.js]"]
  node_state["In-memory state<br/>[game.js]"]
end

subgraph group_server["Game server"]
  node_server["HTTP server<br/>[server.js]"]
  node_static["Static file serving<br/>[staticServer.js]"]
  node_network["LAN discovery<br/>[network.js]"]
end

subgraph group_clients["Browser clients"]
  node_sync["Client sync<br/>[sync.js]"]
  node_bootstrap["Client bootstrap<br/>[main.js]"]
  node_controls["Game controls<br/>[controls.js]"]
  node_render["Board rendering<br/>[render.js]"]
  node_video["Video playback<br/>[video.js]"]
end

subgraph group_content["Game content and presentation"]
  node_themes["Theme and clue bank<br/>[clues.js]"]
  node_avatars["Avatar picker<br/>[avatar-picker.js]"]
  node_effects["Sounds and effects<br/>[sounds.js]"]
end

node_organizer(("Organizer"))
node_players(("Players"))
node_spectator(("Big screen"))
node_youtube["YouTube"]

node_organizer -->|"selects theme"| node_menu
node_menu -->|"posts actions"| node_server
node_menu -->|"sends settings"| node_sync
node_players -->|"joins game"| node_join
node_join -->|"sends join"| node_sync
node_organizer -->|"controls game"| node_controls
node_players -->|"buzzes in"| node_controls
node_controls -->|"sends actions"| node_sync
node_sync -->|"posts actions"| node_server
node_server -->|"applies actions"| node_rules
node_rules -->|"updates state"| node_state
node_server -->|"reads and broadcasts"| node_state
node_server -->|"serves files"| node_static
node_server -->|"gets LAN details"| node_network
node_server -->|"streams state"| node_sync
node_sync -->|"delivers state"| node_bootstrap
node_bootstrap -->|"renders state"| node_render
node_bootstrap -->|"wires controls"| node_controls
node_render -->|"reads themes"| node_themes
node_menu -->|"lists themes"| node_themes
node_render -->|"renders playback"| node_video
node_video -->|"sends media actions"| node_sync
node_video -.->|"loads video API"| node_youtube
node_join -->|"selects avatar"| node_avatars
node_render -->|"plays effects"| node_effects
node_spectator -->|"views board"| node_render

click node_menu "https://github.com/allexandere/jeopardy/blob/main/public/js/menu.js"
click node_join "https://github.com/allexandere/jeopardy/blob/main/public/js/client/controls.js"
click node_rules "https://github.com/allexandere/jeopardy/blob/main/lib/game.js"
click node_state "https://github.com/allexandere/jeopardy/blob/main/lib/game.js"
click node_server "https://github.com/allexandere/jeopardy/blob/main/server.js"
click node_static "https://github.com/allexandere/jeopardy/blob/main/lib/staticServer.js"
click node_network "https://github.com/allexandere/jeopardy/blob/main/lib/network.js"
click node_sync "https://github.com/allexandere/jeopardy/blob/main/public/js/sync.js"
click node_bootstrap "https://github.com/allexandere/jeopardy/blob/main/public/js/client/main.js"
click node_controls "https://github.com/allexandere/jeopardy/blob/main/public/js/client/controls.js"
click node_render "https://github.com/allexandere/jeopardy/blob/main/public/js/client/render.js"
click node_video "https://github.com/allexandere/jeopardy/blob/main/public/js/client/video.js"
click node_themes "https://github.com/allexandere/jeopardy/blob/main/public/clues.js"
click node_avatars "https://github.com/allexandere/jeopardy/blob/main/public/js/avatar-picker.js"
click node_effects "https://github.com/allexandere/jeopardy/blob/main/public/js/sounds.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_menu,node_join,node_rules,node_state,node_spectator toneBlue
class node_server,node_static,node_network toneAmber
class node_sync,node_bootstrap,node_controls,node_render,node_video toneMint
class node_themes,node_avatars,node_effects toneRose
class node_organizer,node_players,node_youtube toneIndigo
```

## Components

### Game workflow

- [Theme menu](https://github.com/allexandere/jeopardy/blob/main/public/js/menu.js): `public/js/menu.js`
- [Player join](https://github.com/allexandere/jeopardy/blob/main/public/js/client/controls.js): `public/js/client/controls.js`
- [Game rules](https://github.com/allexandere/jeopardy/blob/main/lib/game.js): `lib/game.js`
- [In-memory state](https://github.com/allexandere/jeopardy/blob/main/lib/game.js): `lib/game.js`

### Game server

- [HTTP server](https://github.com/allexandere/jeopardy/blob/main/server.js): `server.js`
- [Static file serving](https://github.com/allexandere/jeopardy/blob/main/lib/staticServer.js): `lib/staticServer.js`
- [LAN discovery](https://github.com/allexandere/jeopardy/blob/main/lib/network.js): `lib/network.js`

### Browser clients

- [Client sync](https://github.com/allexandere/jeopardy/blob/main/public/js/sync.js): `public/js/sync.js`
- [Client bootstrap](https://github.com/allexandere/jeopardy/blob/main/public/js/client/main.js): `public/js/client/main.js`
- [Game controls](https://github.com/allexandere/jeopardy/blob/main/public/js/client/controls.js): `public/js/client/controls.js`
- [Board rendering](https://github.com/allexandere/jeopardy/blob/main/public/js/client/render.js): `public/js/client/render.js`
- [Video playback](https://github.com/allexandere/jeopardy/blob/main/public/js/client/video.js): `public/js/client/video.js`

### Game content and presentation

- [Theme and clue bank](https://github.com/allexandere/jeopardy/blob/main/public/clues.js): `public/clues.js`
- [Avatar picker](https://github.com/allexandere/jeopardy/blob/main/public/js/avatar-picker.js): `public/js/avatar-picker.js`
- [Sounds and effects](https://github.com/allexandere/jeopardy/blob/main/public/js/sounds.js): `public/js/sounds.js`

### Other components

- **Organizer**
- **Players**
- **Big screen**
- **YouTube**

## Connections

- Organizer → Theme menu: selects theme
- Theme menu → HTTP server: posts actions
- Theme menu → Client sync: sends settings
- Players → Player join: joins game
- Player join → Client sync: sends join
- Organizer → Game controls: controls game
- Players → Game controls: buzzes in
- Game controls → Client sync: sends actions
- Client sync → HTTP server: posts actions
- HTTP server → Game rules: applies actions
- Game rules → In-memory state: updates state
- HTTP server → In-memory state: reads and broadcasts
- HTTP server → Static file serving: serves files
- HTTP server → LAN discovery: gets LAN details
- HTTP server → Client sync: streams state
- Client sync → Client bootstrap: delivers state
- Client bootstrap → Board rendering: renders state
- Client bootstrap → Game controls: wires controls
- Board rendering → Theme and clue bank: reads themes
- Theme menu → Theme and clue bank: lists themes
- Board rendering → Video playback: renders playback
- Video playback → Client sync: sends media actions
- Video playback → YouTube: loads video API
- Player join → Avatar picker: selects avatar
- Board rendering → Sounds and effects: plays effects
- Big screen → Board rendering: views board
