How ananyo-sen-b2530066/football-tournament works
Tournament Hub is a LAN-hosted tournament manager: an owner configures the roster and stages live draws, volunteers submit confirmed scores from phones, and the server maintains the shared tournament state used to calculate standings and knockout progression. The owner can resolve ties, manage projector pages, and export results; a PIN-protected screen presents ceremonies, fixtures, tables, brackets, and results. Edges reflect the README and shown source-index references or excerpts; unsampled implementation details are not inferred.
Main entry points: page.tsx Owner console · store.ts Tournament store · ScreenPlaylist.tsx Screen playlist · useTournament.ts Tournament client state
Components 32
User-facing sites
- Front door
app/page.tsx - Score editor
app/editor/page.tsx - Owner console
app/owner/page.tsx - Projector site
app/screen/page.tsx - Tournament client state
lib/useTournament.ts - Config health
lib/useConfigHealth.ts - Phone score card
components/PhoneScoreCard.tsx
Server and state
- Control API
app/api/control/route.ts - Roster API
app/api/roster/route.ts - Score API
app/api/score/route.ts - State API
app/api/state/route.ts - Tournament store
lib/server/store.ts - Host state file
config/tournament.config.ts - Avatar storage
lib/server/avatarStore.ts - Avatar endpoint
app/api/avatar/[id]/route.ts
Tournament operations
- Score drafts
lib/drafts.ts - Roster parsing
lib/roster.ts - Spreadsheet reader
lib/server/xlsx.ts - Draw and bracket engine
lib/draw.ts - Standings and tie-breaks
lib/table.ts - Tournament statistics
lib/stats.ts - Spreadsheet exports
lib/sheets.ts
Projection and reporting
- Screen playlist
components/ScreenPlaylist.tsx - Playlist rules
lib/screenPlaylist.ts - Draw ceremony
components/DrawShow.tsx - Knockout bracket
components/KnockoutBracket.tsx - Points table
components/PointsTable.tsx - Results show
components/ResultsShow.tsx
Other components
- Visitor
- Volunteer
- Tournament owner
- Projector audience
Connections 38
- Visitor → Front door: opens
- Volunteer → Score editor: records scores
- Tournament owner → Owner console: manages tournament
- Projector audience → Projector site: views projection
- Front door → Tournament client state: reads state
app/page.tsx - Score editor → Tournament client state: syncs state
app/editor/page.tsx - Owner console → Tournament client state: syncs state
app/owner/page.tsx - Projector site → Tournament client state: reads state
- Score editor → Phone score card: renders
app/editor/page.tsx - Phone score card → Score drafts: saves drafts
components/PhoneScoreCard.tsx - Tournament client state → State API: polls state
lib/useTournament.ts - Tournament client state → Score API: submits scores
- Owner console → Control API: sends actions
app/owner/page.tsx - Owner console → Roster API: imports roster
- Owner console → Spreadsheet exports: exports results
app/owner/page.tsx - Owner console → Config health: checks config
lib/useConfigHealth.ts - Config health → Control API: checks config
- Control API → Tournament store: mutates state
app/api/control/route.ts - Roster API → Tournament store: sets roster
app/api/roster/route.ts - Roster API → Roster parsing: builds roster
app/api/roster/route.ts - Roster API → Spreadsheet reader: reads workbook
app/api/roster/route.ts - Roster API → Avatar storage: stores photos
app/api/roster/route.ts - Score API → Tournament store: updates scores
app/api/score/route.ts - State API → Tournament store: reads state
app/api/state/route.ts - Tournament store → Host state file: persists state
lib/server/store.ts - Tournament store → Draw and bracket engine: resolves winners
lib/server/store.ts - Tournament store → Standings and tie-breaks: computes standings
lib/server/store.ts - Tournament store → Tournament statistics: derives statistics
lib/server/store.ts - Owner console → Draw and bracket engine: stages draws
app/owner/page.tsx - Projector site → Screen playlist: renders screen
app/screen/page.tsx - Screen playlist → Playlist rules: plans pages
components/ScreenPlaylist.tsx - Screen playlist → Draw ceremony: shows ceremony
components/ScreenPlaylist.tsx - Screen playlist → Knockout bracket: shows bracket
components/ScreenPlaylist.tsx - Screen playlist → Points table: shows table
components/ScreenPlaylist.tsx - Screen playlist → Results show: shows results
components/ScreenPlaylist.tsx - Owner console → Points table: previews standings
app/owner/page.tsx - Owner console → Knockout bracket: previews bracket
app/owner/page.tsx - Avatar endpoint → Avatar storage: serves images
app/api/avatar/[id]/route.ts