Core concepts
You can show live scores knowing just one thing: a match. But when you’re ready to go further, here’s the whole mental model on one page.
How the pieces fit
Section titled “How the pieces fit”flowchart TD
Club -->|has| Court
Tournament -->|uses| Club
Tournament -->|contains| Draw[Draw / bracket]
Draw -->|each slot is a| Match
Match -.played on.-> Court
Match -->|two sides| Player
A quick tour:
- Club — a venue. It owns the courts.
- Court — a physical court, where matches are played.
- Tournament — an event. It contains one or more draws.
- Draw — a bracket (size 8 / 16 / 32 / 64). Each slot becomes a match.
- Match — a game between two sides, scored in sets like
[{ home: 6, guest: 4 }]. This is the thing you read.
A match’s life
Section titled “A match’s life”Every match moves through the same states. Your status field will always be one of these:
stateDiagram-v2
[*] --> scheduled
scheduled --> in_progress: start
in_progress --> completed: confirm
in_progress --> suspended: pause
suspended --> in_progress: resume
scheduled --> cancelled
in_progress --> cancelled
completed --> [*]
Player vs. User — an easy mix-up
Section titled “Player vs. User — an easy mix-up”These are deliberately separate:
- A Player is a participant in a match. They can exist before they ever sign up — an organiser can add “Roger Federer” to a draw, and the real Roger claims that profile later.
- A User is an account (a login). When a person claims their player profile, the two link up.
So: every match has players; not every player has a user. For reading live scores, you only ever deal with players.