# gitobic/krakenscores architecture

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

- Interactive diagram: https://gitdiagram.com/gitobic/krakenscores
- Repository: https://github.com/gitobic/krakenscores

## Overview

KrakenScores supports tournament staff in configuring competitions, scheduling and scoring water-polo matches, and sharing live schedules, results, standings, and brackets with spectators. The graph follows the documented admin-to-public workflow and includes standings and bracket logic, authentication, and Firebase storage. The README documents real-time Firestore updates; source excerpts were sampled rather than the full page and service implementations, so uncertain call wiring is not expanded.

Main entry points: [`krakenscores-web/src/App.tsx`](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/App.tsx) (Route application), [`krakenscores-web/src/services/matches.ts`](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/matches.ts) (Match data service), [`krakenscores-web/src/pages/admin/Matches.tsx`](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Matches.tsx) (Match scheduling), [`krakenscores-web/src/services/standings.ts`](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/standings.ts) (Standings service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Tournament Admin"]
  node_setup["Tournament setup"]
  node_catalog["Tournament catalog<br/>[Tournaments.tsx]"]
  node_teams["Club and team admin<br/>[Teams.tsx]"]
  node_pools["Pool admin<br/>[Pools.tsx]"]
  node_matches["Match scheduling<br/>[Matches.tsx]"]
  node_scorekeeper["Score entry<br/>[Scorekeeper.tsx]"]
  node_adminstandings["Admin standings<br/>[Standings.tsx]"]
  node_adminannouncements["Announcement admin<br/>[Announcements.tsx]"]
end

subgraph group_public["Public Experience"]
  node_schedule["Master schedule<br/>[MasterSchedule.tsx]"]
  node_teamsschedule["Team schedule<br/>[TeamSchedule.tsx]"]
  node_publicstandings["Public standings"]
  node_brackets["Bracket views<br/>[Brackets.tsx]"]
  node_publicannouncements["Public announcements<br/>[Announcements.tsx]"]
end

subgraph group_domain["Tournament Logic"]
  node_standingscalc["Standings calculation"]
  node_tournamentengine["Participant resolution"]
  node_schedulelogic["Schedule generation"]
end

subgraph group_firebase["Firebase Services"]
  node_matchservice["Match data service<br/>[matches.ts]"]
  node_standingservice["Standings service<br/>[standings.ts]"]
  node_announcementservice["Announcement service<br/>[announcements.ts]"]
  node_firestore[("Firestore")]
  node_firebaseauth["Firebase Auth"]
end

node_staff(("Tournament staff"))
node_spectators(("Spectators"))
node_app["Route application<br/>[App.tsx]"]

node_staff -->|"opens admin"| node_app
node_spectators -->|"opens public"| node_app
node_app -->|"routes"| node_setup
node_app -->|"routes"| node_catalog
node_app -->|"routes"| node_teams
node_app -->|"routes"| node_pools
node_app -->|"routes"| node_matches
node_app -->|"routes"| node_scorekeeper
node_app -->|"routes"| node_adminstandings
node_app -->|"routes"| node_adminannouncements
node_app -->|"routes"| node_schedule
node_app -->|"routes"| node_teamsschedule
node_app -->|"routes"| node_publicstandings
node_app -->|"routes"| node_brackets
node_app -->|"routes"| node_publicannouncements
node_matches -->|"match data"| node_matchservice
node_scorekeeper -->|"score updates"| node_matchservice
node_matchservice -->|"reads and writes"| node_firestore
node_schedule -->|"live updates"| node_firestore
node_publicstandings -->|"live updates"| node_firestore
node_teamsschedule -->|"live updates"| node_firestore
node_matchservice -->|"resolves participants"| node_tournamentengine
node_tournamentengine -->|"calculates group seeds"| node_standingscalc
node_adminstandings -->|"standings data"| node_standingservice
node_standingservice -->|"reads and writes"| node_firestore
node_standingservice -->|"calculates standings"| node_standingscalc
node_matches -->|"generates schedule"| node_schedulelogic
node_adminannouncements -->|"announcement data"| node_announcementservice
node_publicannouncements -->|"live updates"| node_firestore
node_announcementservice -->|"reads and writes"| node_firestore
node_app -->|"auth provider"| node_firebaseauth

click node_app "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/App.tsx"
click node_setup "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/TournamentSetup.tsx"
click node_catalog "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Tournaments.tsx"
click node_teams "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Teams.tsx"
click node_pools "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Pools.tsx"
click node_matches "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Matches.tsx"
click node_scorekeeper "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Scorekeeper.tsx"
click node_adminstandings "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Standings.tsx"
click node_adminannouncements "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Announcements.tsx"
click node_schedule "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/MasterSchedule.tsx"
click node_teamsschedule "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/TeamSchedule.tsx"
click node_publicstandings "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/PublicStandings.tsx"
click node_brackets "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/Brackets.tsx"
click node_publicannouncements "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/Announcements.tsx"
click node_matchservice "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/matches.ts"
click node_standingservice "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/standings.ts"
click node_announcementservice "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/announcements.ts"
click node_standingscalc "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/standingsCalculator.ts"
click node_tournamentengine "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/tournamentEngine.ts"
click node_schedulelogic "https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/scheduleGenerator.ts"

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_setup,node_catalog,node_teams,node_pools,node_matches,node_scorekeeper,node_adminstandings,node_adminannouncements toneBlue
class node_schedule,node_teamsschedule,node_publicstandings,node_brackets,node_publicannouncements toneAmber
class node_standingscalc,node_tournamentengine,node_schedulelogic,node_app toneMint
class node_matchservice,node_standingservice,node_announcementservice,node_firestore,node_firebaseauth toneRose
class node_staff,node_spectators toneIndigo
```

## Components

### Tournament Admin

- [Tournament setup](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/TournamentSetup.tsx): `krakenscores-web/src/pages/admin/TournamentSetup.tsx`
- [Tournament catalog](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Tournaments.tsx): `krakenscores-web/src/pages/admin/Tournaments.tsx`
- [Club and team admin](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Teams.tsx): `krakenscores-web/src/pages/admin/Teams.tsx`
- [Pool admin](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Pools.tsx): `krakenscores-web/src/pages/admin/Pools.tsx`
- [Match scheduling](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Matches.tsx): `krakenscores-web/src/pages/admin/Matches.tsx`
- [Score entry](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Scorekeeper.tsx): `krakenscores-web/src/pages/admin/Scorekeeper.tsx`
- [Admin standings](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Standings.tsx): `krakenscores-web/src/pages/admin/Standings.tsx`
- [Announcement admin](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/admin/Announcements.tsx): `krakenscores-web/src/pages/admin/Announcements.tsx`

### Public Experience

- [Master schedule](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/MasterSchedule.tsx): `krakenscores-web/src/pages/public/MasterSchedule.tsx`
- [Team schedule](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/TeamSchedule.tsx): `krakenscores-web/src/pages/public/TeamSchedule.tsx`
- [Public standings](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/PublicStandings.tsx): `krakenscores-web/src/pages/public/PublicStandings.tsx`
- [Bracket views](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/Brackets.tsx): `krakenscores-web/src/pages/public/Brackets.tsx`
- [Public announcements](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/pages/public/Announcements.tsx): `krakenscores-web/src/pages/public/Announcements.tsx`

### Tournament Logic

- [Standings calculation](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/standingsCalculator.ts): `krakenscores-web/src/utils/standingsCalculator.ts`
- [Participant resolution](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/tournamentEngine.ts): `krakenscores-web/src/utils/tournamentEngine.ts`
- [Schedule generation](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/utils/scheduleGenerator.ts): `krakenscores-web/src/utils/scheduleGenerator.ts`

### Firebase Services

- [Match data service](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/matches.ts): `krakenscores-web/src/services/matches.ts`
- [Standings service](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/standings.ts): `krakenscores-web/src/services/standings.ts`
- [Announcement service](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/services/announcements.ts): `krakenscores-web/src/services/announcements.ts`
- **Firestore**
- **Firebase Auth**

### Other components

- **Tournament staff**
- **Spectators**
- [Route application](https://github.com/gitobic/krakenscores/blob/main/krakenscores-web/src/App.tsx): `krakenscores-web/src/App.tsx`

## Connections

- Tournament staff → Route application: opens admin
- Spectators → Route application: opens public
- Route application → Tournament setup: routes
- Route application → Tournament catalog: routes
- Route application → Club and team admin: routes
- Route application → Pool admin: routes
- Route application → Match scheduling: routes
- Route application → Score entry: routes
- Route application → Admin standings: routes
- Route application → Announcement admin: routes
- Route application → Master schedule: routes
- Route application → Team schedule: routes
- Route application → Public standings: routes
- Route application → Bracket views: routes
- Route application → Public announcements: routes
- Match scheduling → Match data service: match data
- Score entry → Match data service: score updates
- Match data service → Firestore: reads and writes
- Master schedule → Firestore: live updates
- Public standings → Firestore: live updates
- Team schedule → Firestore: live updates
- Match data service → Participant resolution: resolves participants
- Participant resolution → Standings calculation: calculates group seeds
- Admin standings → Standings service: standings data
- Standings service → Firestore: reads and writes
- Standings service → Standings calculation: calculates standings
- Match scheduling → Schedule generation: generates schedule
- Announcement admin → Announcement service: announcement data
- Public announcements → Firestore: live updates
- Announcement service → Firestore: reads and writes
- Route application → Firebase Auth: auth provider
