# seyitanshalom/bankers-cup architecture

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

- Interactive diagram: https://gitdiagram.com/seyitanshalom/bankers-cup
- Repository: https://github.com/seyitanshalom/bankers-cup

## Overview

Bankers Cup is a tournament website and admin dashboard. Visitors load competition data to browse teams, fixtures, live match details, standings and knockout qualification, player statistics, and news. Admins manage tournament records and match events through the competition API; local development persists edits to JSON, while configured deployments use Supabase. Match event and timer rules maintain match outcomes and statistics. The README documents Supabase Auth and logo storage, but their wiring is not shown in the sampled source, so those integration links are marked optional.

Main entry points: [`src/lib/data.ts`](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/data.ts) (Data access), [`src/lib/local-data.ts`](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/local-data.ts) (Local mutations), [`src/lib/tournament.ts`](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/tournament.ts) (Tournament calculations), [`src/app/standings/page.tsx`](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/standings/page.tsx) (Standings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public tournament site"]
  node_home["Home dashboard<br/>[page.tsx]"]
  node_fixtures["Fixtures<br/>[page.tsx]"]
  node_match_detail["Match detail<br/>[page.tsx]"]
  node_team_pages["Team profiles<br/>[page.tsx]"]
  node_team_detail["Team detail<br/>[page.tsx]"]
  node_standings["Standings<br/>[page.tsx]"]
  node_bracket["Qualification bracket"]
  node_stats["Player statistics<br/>[page.tsx]"]
  node_news["Tournament news<br/>[page.tsx]"]
  node_live_components["Live match views"]
end

subgraph group_admin["Competition management"]
  node_admin_console["Admin console<br/>[admin-console.tsx]"]
end

subgraph group_domain["Tournament rules"]
  node_tournament_rules["Tournament calculations<br/>[tournament.ts]"]
  node_match_outcome["Match outcomes<br/>[match-outcome.ts]"]
  node_match_timer["Match timer<br/>[match-timer.ts]"]
end

subgraph group_data["Data and services"]
  node_competition_api["Competition API<br/>[route.ts]"]
  node_data_access["Data access<br/>[data.ts]"]
  node_local_data["Local mutations<br/>[local-data.ts]"]
  node_json_store[("Local competition data<br/>[competition.json]")]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_supabase_db[("Supabase database<br/>[schema.sql]")]
  node_supabase_auth["Supabase Auth"]
  node_supabase_storage[("Supabase Storage")]
end

node_visitor(("Visitor"))
node_admin_actor(("Administrator"))

node_visitor -->|"opens"| node_home
node_visitor -->|"browses"| node_fixtures
node_visitor -->|"opens"| node_match_detail
node_visitor -->|"browses"| node_team_pages
node_visitor -->|"opens"| node_team_detail
node_visitor -->|"browses"| node_standings
node_visitor -->|"browses"| node_stats
node_visitor -->|"reads"| node_news
node_home -.->|"fetches"| node_competition_api
node_fixtures -->|"loads"| node_data_access
node_match_detail -->|"loads"| node_data_access
node_match_detail -->|"renders"| node_live_components
node_team_pages -->|"loads"| node_data_access
node_team_detail -->|"loads"| node_data_access
node_standings -->|"loads"| node_data_access
node_standings -->|"calculates"| node_tournament_rules
node_standings -->|"renders"| node_bracket
node_bracket -->|"seeds"| node_tournament_rules
node_team_detail -->|"calculates"| node_tournament_rules
node_stats -->|"loads"| node_data_access
node_stats -->|"calculates"| node_tournament_rules
node_news -->|"loads"| node_data_access
node_admin_actor -->|"manages"| node_admin_console
node_admin_console -->|"submits changes"| node_competition_api
node_admin_console -.->|"authenticates"| node_supabase_auth
node_admin_console -.->|"uploads logos"| node_supabase_storage
node_competition_api -->|"loads"| node_data_access
node_competition_api -->|"applies mutations"| node_local_data
node_data_access -.->|"reads local data"| node_local_data
node_data_access -.->|"uses configured backend"| node_supabase_client
node_supabase_client -.->|"reads and writes"| node_supabase_db
node_local_data -->|"reads and writes"| node_json_store
node_local_data -->|"validates events"| node_tournament_rules
node_local_data -->|"recomputes results"| node_match_outcome
node_local_data -->|"gets timer patch"| node_match_timer

click node_home "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/page.tsx"
click node_fixtures "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/fixtures/page.tsx"
click node_match_detail "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/matches/%5BmatchId%5D/page.tsx"
click node_team_pages "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/teams/page.tsx"
click node_team_detail "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/teams/%5BteamId%5D/page.tsx"
click node_standings "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/standings/page.tsx"
click node_bracket "https://github.com/seyitanshalom/bankers-cup/blob/main/src/components/qualification-bracket.tsx"
click node_stats "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/stats/page.tsx"
click node_news "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/news/page.tsx"
click node_live_components "https://github.com/seyitanshalom/bankers-cup/tree/main/src/components"
click node_admin_console "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/admin/admin-console.tsx"
click node_competition_api "https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/api/competition/route.ts"
click node_data_access "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/data.ts"
click node_local_data "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/local-data.ts"
click node_json_store "https://github.com/seyitanshalom/bankers-cup/blob/main/data/competition.json"
click node_supabase_client "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/supabase.ts"
click node_supabase_db "https://github.com/seyitanshalom/bankers-cup/blob/main/supabase/schema.sql"
click node_tournament_rules "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/tournament.ts"
click node_match_outcome "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/match-outcome.ts"
click node_match_timer "https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/match-timer.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_home,node_fixtures,node_match_detail,node_team_pages,node_team_detail,node_standings,node_bracket,node_stats,node_news,node_live_components toneBlue
class node_admin_console toneAmber
class node_tournament_rules,node_match_outcome,node_match_timer toneMint
class node_competition_api,node_data_access,node_local_data,node_json_store,node_supabase_client,node_supabase_db,node_supabase_auth,node_supabase_storage toneRose
class node_visitor,node_admin_actor toneIndigo
```

## Components

### Public tournament site

- [Home dashboard](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Fixtures](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/fixtures/page.tsx): `src/app/fixtures/page.tsx`
- [Match detail](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/matches/%5BmatchId%5D/page.tsx): `src/app/matches/[matchId]/page.tsx`
- [Team profiles](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/teams/page.tsx): `src/app/teams/page.tsx`
- [Team detail](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/teams/%5BteamId%5D/page.tsx): `src/app/teams/[teamId]/page.tsx`
- [Standings](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/standings/page.tsx): `src/app/standings/page.tsx`
- [Qualification bracket](https://github.com/seyitanshalom/bankers-cup/blob/main/src/components/qualification-bracket.tsx): `src/components/qualification-bracket.tsx`
- [Player statistics](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/stats/page.tsx): `src/app/stats/page.tsx`
- [Tournament news](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/news/page.tsx): `src/app/news/page.tsx`
- [Live match views](https://github.com/seyitanshalom/bankers-cup/tree/main/src/components): `src/components`

### Competition management

- [Admin console](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/admin/admin-console.tsx): `src/app/admin/admin-console.tsx`

### Tournament rules

- [Tournament calculations](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/tournament.ts): `src/lib/tournament.ts`
- [Match outcomes](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/match-outcome.ts): `src/lib/match-outcome.ts`
- [Match timer](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/match-timer.ts): `src/lib/match-timer.ts`

### Data and services

- [Competition API](https://github.com/seyitanshalom/bankers-cup/blob/main/src/app/api/competition/route.ts): `src/app/api/competition/route.ts`
- [Data access](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/data.ts): `src/lib/data.ts`
- [Local mutations](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/local-data.ts): `src/lib/local-data.ts`
- [Local competition data](https://github.com/seyitanshalom/bankers-cup/blob/main/data/competition.json): `data/competition.json`
- [Supabase client](https://github.com/seyitanshalom/bankers-cup/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Supabase database](https://github.com/seyitanshalom/bankers-cup/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Supabase Auth**
- **Supabase Storage**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Home dashboard: opens
- Visitor → Fixtures: browses
- Visitor → Match detail: opens
- Visitor → Team profiles: browses
- Visitor → Team detail: opens
- Visitor → Standings: browses
- Visitor → Player statistics: browses
- Visitor → Tournament news: reads
- Home dashboard → Competition API: fetches
- Fixtures → Data access: loads
- Match detail → Data access: loads
- Match detail → Live match views: renders
- Team profiles → Data access: loads
- Team detail → Data access: loads
- Standings → Data access: loads
- Standings → Tournament calculations: calculates
- Standings → Qualification bracket: renders
- Qualification bracket → Tournament calculations: seeds
- Team detail → Tournament calculations: calculates
- Player statistics → Data access: loads
- Player statistics → Tournament calculations: calculates
- Tournament news → Data access: loads
- Administrator → Admin console: manages
- Admin console → Competition API: submits changes
- Admin console → Supabase Auth: authenticates
- Admin console → Supabase Storage: uploads logos
- Competition API → Data access: loads
- Competition API → Local mutations: applies mutations
- Data access → Local mutations: reads local data
- Data access → Supabase client: uses configured backend
- Supabase client → Supabase database: reads and writes
- Local mutations → Local competition data: reads and writes
- Local mutations → Tournament calculations: validates events
- Local mutations → Match outcomes: recomputes results
- Local mutations → Match timer: gets timer patch
