# sriharshanadahalli/badminton-platform architecture

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

- Interactive diagram: https://gitdiagram.com/sriharshanadahalli/badminton-platform
- Repository: https://github.com/sriharshanadahalli/badminton-platform

## Overview

Badminton Tournament Management System supports tournament setup and scheduling, court assignment, live scoring, and public score displays. The main workflow runs from tournament administration and match assignment through a court’s match setup and scoring, with results and updates handled by the backend. Round-robin and knockout-bracket features are represented as distinct tournament stages. The excerpts show the court-scoring API/socket path and backend model imports; scheduler-to-backend interactions are not shown, so those links are omitted. README-described capabilities are retained without claiming their unsampled implementation details were inspected.

Main entry points: [`frontend/src/context/MatchContext.jsx`](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/context/MatchContext.jsx) (Match state and sync), [`backend/server.js`](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/server.js) (API and socket server), [`frontend/src/pages/CourtView.jsx`](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/CourtView.jsx) (Court view), [`frontend/src/App.jsx`](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/App.jsx) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Frontend views"]
  node_app["App routing<br/>[App.jsx]"]
  node_landing["Tournament landing<br/>[LandingView.jsx]"]
  node_courtview["Court view<br/>[CourtView.jsx]"]
  node_signage["Signage display<br/>[SignageView.jsx]"]
  node_mobile["Mobile scores"]
end

subgraph group_live["Live scoring"]
  node_matchctx["Match state and sync<br/>[MatchContext.jsx]"]
  node_timer["Match timers<br/>[useTimer.js]"]
  node_courtarea["Court controls<br/>[CourtArea.jsx]"]
  node_scoreboard["Scoreboard<br/>[Scoreboard.jsx]"]
  node_setup["Match setup"]
  node_gameover["Game completion<br/>[GameOverModal.jsx]"]
  node_winconfirm["Win confirmation"]
  node_livecomponents["Live score displays"]
  node_mobilecourt["Mobile court card"]
  node_nextmatch["Next match display"]
end

subgraph group_tournament["Tournament operations"]
  node_scheduler["Scheduler dashboard<br/>[SchedulerView.jsx]"]
  node_roundsetup["Round-robin setup"]
  node_roundtable["Round-robin standings"]
  node_bracket["Knockout brackets<br/>[BracketCard.jsx]"]
  node_tournmodals["Tournament dialogs"]
end

subgraph group_backend["Backend and persistence"]
  node_server["API and socket server<br/>[server.js]"]
  node_matchmodel[("Live match records<br/>[Match.js]")]
  node_tournamentmatch[("Tournament matches<br/>[TournamentMatch.js]")]
  node_courtmodel[("Court records<br/>[Court.js]")]
  node_category[("Categories<br/>[Category.js]")]
  node_player[("Players<br/>[Player.js]")]
  node_participation[("Participation records<br/>[Participation.js]")]
  node_standing[("Round-robin standings")]
  node_result[("Tournament results")]
end

node_operator(("Tournament staff"))
node_spectator(("Score viewers"))

node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_courtview
node_app -->|"routes to"| node_signage
node_app -->|"routes to"| node_mobile
node_app -->|"routes to"| node_scheduler
node_app -->|"provides state"| node_matchctx
node_courtview -->|"fetches match"| node_matchctx
node_courtview -->|"renders"| node_setup
node_courtview -->|"renders"| node_courtarea
node_courtview -->|"renders"| node_scoreboard
node_courtview -->|"renders"| node_gameover
node_courtview -->|"renders"| node_winconfirm
node_matchctx -->|"uses"| node_timer
node_matchctx -->|"fetches court status"| node_server
node_matchctx -->|"emits match events"| node_server
node_matchctx -->|"supplies match state"| node_courtarea
node_matchctx -->|"supplies match state"| node_scoreboard
node_matchctx -->|"supplies match state"| node_setup
node_matchctx -->|"supplies match state"| node_gameover
node_matchctx -->|"supplies match state"| node_winconfirm
node_scheduler -->|"renders"| node_roundsetup
node_scheduler -->|"renders"| node_roundtable
node_scheduler -->|"renders"| node_bracket
node_scheduler -->|"uses"| node_tournmodals
node_roundsetup -->|"uses alert modal"| node_tournmodals
node_mobile -->|"renders"| node_mobilecourt
node_mobilecourt -->|"renders mobile score"| node_livecomponents
node_mobilecourt -->|"renders next match"| node_nextmatch
node_signage -->|"renders score"| node_livecomponents
node_signage -->|"renders next match"| node_nextmatch
node_server -->|"reads and writes"| node_matchmodel
node_server -->|"reads and writes"| node_tournamentmatch
node_server -->|"reads and writes"| node_courtmodel
node_server -->|"uses"| node_category
node_server -->|"uses"| node_player
node_server -->|"uses"| node_participation
node_server -->|"uses"| node_standing
node_server -->|"uses"| node_result

click node_app "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/App.jsx"
click node_landing "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/LandingView.jsx"
click node_courtview "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/CourtView.jsx"
click node_signage "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/SignageView.jsx"
click node_mobile "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/MobileLiveScore.jsx"
click node_scheduler "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/SchedulerView.jsx"
click node_matchctx "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/context/MatchContext.jsx"
click node_timer "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/hooks/useTimer.js"
click node_courtarea "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/CourtArea.jsx"
click node_scoreboard "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/Scoreboard.jsx"
click node_setup "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/MatchSetupModal.jsx"
click node_gameover "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/GameOverModal.jsx"
click node_winconfirm "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/WinConfirmationModal.jsx"
click node_livecomponents "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/LiveScoreDisplay.jsx"
click node_mobilecourt "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/MobileCourtCard.jsx"
click node_nextmatch "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/NextMatchDisplay.jsx"
click node_roundsetup "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/RoundRobinSetupModal.jsx"
click node_roundtable "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/RoundRobinTableView.jsx"
click node_bracket "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/BracketCard.jsx"
click node_tournmodals "https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/TournamentModals.jsx"
click node_server "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/server.js"
click node_matchmodel "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Match.js"
click node_tournamentmatch "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/TournamentMatch.js"
click node_courtmodel "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Court.js"
click node_category "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Category.js"
click node_player "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Player.js"
click node_participation "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Participation.js"
click node_standing "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/RoundRobinStanding.js"
click node_result "https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/TournamentResult.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_app,node_landing,node_courtview,node_signage,node_mobile,node_spectator toneBlue
class node_matchctx,node_timer,node_courtarea,node_scoreboard,node_setup,node_gameover,node_winconfirm,node_livecomponents,node_mobilecourt,node_nextmatch toneAmber
class node_scheduler,node_roundsetup,node_roundtable,node_bracket,node_tournmodals toneMint
class node_server,node_matchmodel,node_tournamentmatch,node_courtmodel,node_category,node_player,node_participation,node_standing,node_result toneRose
class node_operator toneIndigo
```

## Components

### Frontend views

- [App routing](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tournament landing](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/LandingView.jsx): `frontend/src/pages/LandingView.jsx`
- [Court view](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/CourtView.jsx): `frontend/src/pages/CourtView.jsx`
- [Signage display](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/SignageView.jsx): `frontend/src/pages/SignageView.jsx`
- [Mobile scores](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/MobileLiveScore.jsx): `frontend/src/pages/MobileLiveScore.jsx`

### Live scoring

- [Match state and sync](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/context/MatchContext.jsx): `frontend/src/context/MatchContext.jsx`
- [Match timers](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/hooks/useTimer.js): `frontend/src/hooks/useTimer.js`
- [Court controls](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/CourtArea.jsx): `frontend/src/components/CourtArea.jsx`
- [Scoreboard](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/Scoreboard.jsx): `frontend/src/components/Scoreboard.jsx`
- [Match setup](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/MatchSetupModal.jsx): `frontend/src/components/MatchSetupModal.jsx`
- [Game completion](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/GameOverModal.jsx): `frontend/src/components/GameOverModal.jsx`
- [Win confirmation](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/WinConfirmationModal.jsx): `frontend/src/components/WinConfirmationModal.jsx`
- [Live score displays](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/LiveScoreDisplay.jsx): `frontend/src/components/LiveScoreDisplay.jsx`
- [Mobile court card](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/MobileCourtCard.jsx): `frontend/src/components/MobileCourtCard.jsx`
- [Next match display](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/NextMatchDisplay.jsx): `frontend/src/components/NextMatchDisplay.jsx`

### Tournament operations

- [Scheduler dashboard](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/pages/SchedulerView.jsx): `frontend/src/pages/SchedulerView.jsx`
- [Round-robin setup](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/RoundRobinSetupModal.jsx): `frontend/src/components/RoundRobinSetupModal.jsx`
- [Round-robin standings](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/RoundRobinTableView.jsx): `frontend/src/components/RoundRobinTableView.jsx`
- [Knockout brackets](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/BracketCard.jsx): `frontend/src/components/BracketCard.jsx`
- [Tournament dialogs](https://github.com/sriharshanadahalli/badminton-platform/blob/main/frontend/src/components/TournamentModals.jsx): `frontend/src/components/TournamentModals.jsx`

### Backend and persistence

- [API and socket server](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/server.js): `backend/server.js`
- [Live match records](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Match.js): `backend/models/Match.js`
- [Tournament matches](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/TournamentMatch.js): `backend/models/TournamentMatch.js`
- [Court records](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Court.js): `backend/models/Court.js`
- [Categories](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Category.js): `backend/models/Category.js`
- [Players](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Player.js): `backend/models/Player.js`
- [Participation records](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/Participation.js): `backend/models/Participation.js`
- [Round-robin standings](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/RoundRobinStanding.js): `backend/models/RoundRobinStanding.js`
- [Tournament results](https://github.com/sriharshanadahalli/badminton-platform/blob/main/backend/models/TournamentResult.js): `backend/models/TournamentResult.js`

### Other components

- **Tournament staff**
- **Score viewers**

## Connections

- App routing → Tournament landing: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Court view: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Signage display: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Mobile scores: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Scheduler dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Match state and sync: provides state (evidence: `frontend/src/App.jsx`)
- Court view → Match state and sync: fetches match (evidence: `frontend/src/pages/CourtView.jsx`)
- Court view → Match setup: renders (evidence: `frontend/src/pages/CourtView.jsx`)
- Court view → Court controls: renders (evidence: `frontend/src/pages/CourtView.jsx`)
- Court view → Scoreboard: renders (evidence: `frontend/src/pages/CourtView.jsx`)
- Court view → Game completion: renders (evidence: `frontend/src/pages/CourtView.jsx`)
- Court view → Win confirmation: renders (evidence: `frontend/src/pages/CourtView.jsx`)
- Match state and sync → Match timers: uses (evidence: `frontend/src/context/MatchContext.jsx`)
- Match state and sync → API and socket server: fetches court status (evidence: `frontend/src/context/MatchContext.jsx`)
- Match state and sync → API and socket server: emits match events (evidence: `frontend/src/context/MatchContext.jsx`)
- Match state and sync → Court controls: supplies match state (evidence: `frontend/src/components/CourtArea.jsx`)
- Match state and sync → Scoreboard: supplies match state (evidence: `frontend/src/components/Scoreboard.jsx`)
- Match state and sync → Match setup: supplies match state (evidence: `frontend/src/components/MatchSetupModal.jsx`)
- Match state and sync → Game completion: supplies match state (evidence: `frontend/src/components/GameOverModal.jsx`)
- Match state and sync → Win confirmation: supplies match state (evidence: `frontend/src/components/WinConfirmationModal.jsx`)
- Scheduler dashboard → Round-robin setup: renders (evidence: `frontend/src/pages/SchedulerView.jsx`)
- Scheduler dashboard → Round-robin standings: renders (evidence: `frontend/src/pages/SchedulerView.jsx`)
- Scheduler dashboard → Knockout brackets: renders (evidence: `frontend/src/pages/SchedulerView.jsx`)
- Scheduler dashboard → Tournament dialogs: uses (evidence: `frontend/src/pages/SchedulerView.jsx`)
- Round-robin setup → Tournament dialogs: uses alert modal (evidence: `frontend/src/components/RoundRobinSetupModal.jsx`)
- Mobile scores → Mobile court card: renders (evidence: `frontend/src/pages/MobileLiveScore.jsx`)
- Mobile court card → Live score displays: renders mobile score (evidence: `frontend/src/components/MobileCourtCard.jsx`)
- Mobile court card → Next match display: renders next match (evidence: `frontend/src/components/MobileCourtCard.jsx`)
- Signage display → Live score displays: renders score (evidence: `frontend/src/pages/SignageView.jsx`)
- Signage display → Next match display: renders next match (evidence: `frontend/src/pages/SignageView.jsx`)
- API and socket server → Live match records: reads and writes (evidence: `backend/server.js`)
- API and socket server → Tournament matches: reads and writes (evidence: `backend/server.js`)
- API and socket server → Court records: reads and writes (evidence: `backend/server.js`)
- API and socket server → Categories: uses (evidence: `backend/server.js`)
- API and socket server → Players: uses (evidence: `backend/server.js`)
- API and socket server → Participation records: uses (evidence: `backend/server.js`)
- API and socket server → Round-robin standings: uses (evidence: `backend/server.js`)
- API and socket server → Tournament results: uses (evidence: `backend/server.js`)
