How alifaguslerian/bdcahoot-live works
BDCAHOOT Live is a self-hosted, LAN multiplayer quiz app. Operators create quizzes, open a room, and control its rounds; players join by room code, answer on their phones, and see reveals and rankings. The flow centers on the shared Socket.io context and server-authoritative game engine, with quiz storage and completed-match history as distinct supporting capabilities. The README documents SQLite-backed persistence and gameplay stages; unsampled server wiring is represented only where documented or indicated by the source index.
Main entry points: socketServer.ts Socket Server · quizStore.ts Quiz Store Client · GameContext.tsx Session Context · arena Host Arena
Components 20
Host Console
- Quiz Library
app/host/library/page.tsx - Quiz Editor
components/host/QuizEditorView.tsx - Game Settings
components/host/GameSettingsView.tsx - Host Arena
components/host/arena - Match History
app/host/history - CSV Export
components/host/DownloadMatchButton.tsx
Player Experience
- Join Flow
components/player/PlayerJoinForm.tsx - Player Identity
app/player/name/page.tsx - Player Arena
components/player/controller
Live Game Runtime
- Session Context
context/GameContext.tsx - Socket Server
server/socketServer.ts - Game Engine
server/gameEngine.ts - Scoring and Rankings
lib/scoring.ts
Quiz and Results Data
- Quiz Store Client
lib/quizStore.ts - Quiz Library Service
server/quizLibrary.ts - Match Archive
server/matchHistory.ts - Persistence Service
server/persistence.ts - SQLite Database
server/persistenceWorker.mjs
Other components
- Operator
- Participants
Connections 25
- Operator → Quiz Library: manages quizzes
README.md - Quiz Library → Quiz Store Client: loads library
app/host/library/page.tsx - Quiz Editor → Quiz Store Client: saves quizzes
components/host/QuizEditorView.tsx - Game Settings → Quiz Store Client: updates quiz
components/host/GameSettingsView.tsx - Operator → Host Arena: controls rounds
README.md - Participants → Join Flow: joins room
README.md - Join Flow → Session Context: requests session
components/player/PlayerJoinForm.tsx - Player Identity → Session Context: joins with identity
app/player/name/page.tsx - Session Context → Socket Server: emits socket events
context/GameContext.tsx - Socket Server → Game Engine: dispatches game actions
server/socketServer.ts - Game Engine → Scoring and Rankings: calculates rankings
server/gameEngine.ts - Game Engine → Match Archive: creates match result
server/gameEngine.ts - Socket Server → Quiz Library Service: handles library requests
server/socketServer.ts - Socket Server → Match Archive: serves history requests
server/socketServer.ts - Quiz Store Client → Socket Server: requests library data
lib/quizStore.ts - Quiz Store Client → Socket Server: requests match history
lib/quizStore.ts - Quiz Library Service → Persistence Service: persists quizzes
- Match Archive → Persistence Service: stores match archive
- Persistence Service → SQLite Database: reads and writes
README.md - Host Arena → Session Context: uses live state
components/host/arena/PodiumView.tsx - Player Arena → Session Context: uses live state
components/player/controller/PlayerControllerContainer.tsx - Operator → Match History: reviews completed matches
README.md - Match History → Quiz Store Client: loads match records
app/host/history/page.tsx - Match History → CSV Export: downloads results
app/host/history/[matchId]/page.tsx - Host Arena → CSV Export: exports podium results
components/host/arena/PodiumView.tsx