# veerachandra2008/pheonix-main architecture

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

- Interactive diagram: https://gitdiagram.com/veerachandra2008/pheonix-main
- Repository: https://github.com/veerachandra2008/pheonix-main

## Overview

Phoenix is an esports tournament platform for players, organizers, and administrators. Players browse tournaments, register, pay or verify passes, and follow results; organizers manage tournaments, rosters, attendance, and leaderboards, while admins oversee platform operations. The Next.js application uses both a Flask API and Supabase-backed routes/data access. README-documented player, team, live-broadcast, and admin capabilities are represented, though sampled source does not establish all their runtime connections.

Main entry points: [`backend/app.py`](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/app.py) (Flask API), [`src/app/organizer`](https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/organizer) (Organizer Portal), [`src/lib/tournaments-db.ts`](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/tournaments-db.ts) (Tournament Data Access), [`backend/routes/tournaments.py`](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/tournaments.py) (Tournament API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Player Experience"]
  node_tournament_ui["Tournament Hub<br/>[page.tsx]"]
  node_tournament_detail["Tournament Detail<br/>[page.tsx]"]
  node_registration_ui["Registration Flow<br/>[page.tsx]"]
  node_verification_ui["Pass Verification<br/>[page.tsx]"]
  node_player_team_hubs["Player and Team Hubs"]
  node_live_broadcast["Live Broadcast<br/>[LiveTelecaster.tsx]"]
  node_leaderboards_ui["Leaderboards<br/>[page.tsx]"]
  node_games_teams["Teams and Games"]
end

subgraph group_events["Tournament Operations"]
  node_organizer_portal["Organizer Portal"]
  node_admin_portal["Admin Portal"]
end

subgraph group_api["Application APIs"]
  node_flask_app["Flask API<br/>[app.py]"]
  node_tournaments_api["Tournament API<br/>[tournaments.py]"]
  node_payments_api["Payments API<br/>[payments.py]"]
  node_registrations_api["Registration API<br/>[registrations.py]"]
  node_auth_api["Authentication API<br/>[auth.py]"]
  node_applications_api["Organizer Applications<br/>[applications.py]"]
  node_attendance_rosters["Attendance and Rosters<br/>[attendance.py]"]
  node_leaderboard_api["Leaderboard API<br/>[leaderboard.py]"]
  node_api_proxy["Next API Routes<br/>[route.ts]"]
end

subgraph group_data["Identity and Data"]
  node_tournament_data["Tournament Data Access<br/>[tournaments-db.ts]"]
  node_flask_client["Flask API Client<br/>[flask-api.ts]"]
  node_session["Session Manager<br/>[auth-session.ts]"]
  node_supabase["Supabase Client<br/>[supabase.ts]"]
  node_supabase_store[("Supabase Data Store")]
  node_config["Backend Configuration<br/>[config.py]"]
  node_cache["API Cache<br/>[cache.py]"]
  node_qr_engine["QR Scanner Engine"]
  node_qr_fallback["QR Decoder Fallback"]
end

node_player(("Players"))

node_player -->|"browses"| node_tournament_ui
node_player -->|"views"| node_tournament_detail
node_player -->|"registers through"| node_registration_ui
node_player -->|"verifies pass"| node_verification_ui
node_tournament_ui -->|"loads tournaments"| node_tournament_data
node_tournament_detail -->|"loads tournament data"| node_tournament_data
node_tournament_detail -->|"requests API data"| node_flask_client
node_registration_ui -.->|"submits payment"| node_payments_api
node_verification_ui -->|"checks passes"| node_flask_client
node_verification_ui -->|"scans codes"| node_qr_engine
node_qr_engine -->|"decodes with"| node_qr_fallback
node_player -->|"explores profiles"| node_player_team_hubs
node_player -->|"watches matches"| node_live_broadcast
node_player -->|"checks rankings"| node_leaderboards_ui
node_player -->|"explores teams"| node_games_teams
node_player -->|"applies to host"| node_organizer_portal
node_organizer_portal -.->|"submits application"| node_applications_api
node_organizer_portal -.->|"manages tournaments"| node_tournaments_api
node_organizer_portal -.->|"manages attendance"| node_attendance_rosters
node_organizer_portal -.->|"manages results"| node_leaderboard_api
node_admin_portal -.->|"reviews applications"| node_applications_api
node_flask_app -->|"registers blueprint"| node_tournaments_api
node_flask_app -->|"registers blueprint"| node_payments_api
node_flask_app -->|"registers blueprint"| node_registrations_api
node_flask_app -->|"registers blueprint"| node_auth_api
node_flask_app -->|"registers blueprint"| node_applications_api
node_flask_app -->|"registers blueprints"| node_attendance_rosters
node_flask_app -->|"registers blueprint"| node_leaderboard_api
node_tournament_data -->|"queries"| node_supabase
node_tournament_data -->|"reads session"| node_session
node_tournament_data -->|"requests API"| node_flask_client
node_supabase -.->|"connects to"| node_supabase_store
node_api_proxy -->|"queries"| node_supabase
node_api_proxy -->|"reads and writes"| node_supabase_store
node_flask_app -->|"loads configuration"| node_config
node_tournaments_api -->|"uses cache"| node_cache
node_auth_api -->|"uses cache"| node_cache
node_tournaments_api -->|"uses Supabase client"| node_config
node_applications_api -->|"reads user state"| node_auth_api
node_applications_api -->|"reads tournament state"| node_tournaments_api
node_payments_api -.->|"uses configuration"| node_config

click node_tournament_ui "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/tournaments/page.tsx"
click node_tournament_detail "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/tournaments/%5Bslug%5D/page.tsx"
click node_registration_ui "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/registration/%5Bslug%5D/page.tsx"
click node_verification_ui "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/verify/page.tsx"
click node_player_team_hubs "https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/players"
click node_live_broadcast "https://github.com/veerachandra2008/pheonix-main/blob/main/src/components/xenova/LiveTelecaster.tsx"
click node_leaderboards_ui "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/leaderboards/page.tsx"
click node_organizer_portal "https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/organizer"
click node_admin_portal "https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/admin"
click node_flask_app "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/app.py"
click node_tournaments_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/tournaments.py"
click node_payments_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/payments.py"
click node_registrations_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/registrations.py"
click node_auth_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/auth.py"
click node_applications_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/applications.py"
click node_attendance_rosters "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/attendance.py"
click node_leaderboard_api "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/leaderboard.py"
click node_api_proxy "https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/api/%5B...path%5D/route.ts"
click node_tournament_data "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/tournaments-db.ts"
click node_flask_client "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/flask-api.ts"
click node_session "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/auth-session.ts"
click node_supabase "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/supabase.ts"
click node_config "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/config.py"
click node_cache "https://github.com/veerachandra2008/pheonix-main/blob/main/backend/cache.py"
click node_qr_engine "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/qr-scanner-engine.ts"
click node_qr_fallback "https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/qr-decoder-fallback.ts"
click node_games_teams "https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/teams"

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_tournament_ui,node_tournament_detail,node_registration_ui,node_verification_ui,node_player_team_hubs,node_live_broadcast,node_leaderboards_ui,node_games_teams toneBlue
class node_organizer_portal,node_admin_portal toneAmber
class node_flask_app,node_tournaments_api,node_payments_api,node_registrations_api,node_auth_api,node_applications_api,node_attendance_rosters,node_leaderboard_api,node_api_proxy toneMint
class node_tournament_data,node_flask_client,node_session,node_supabase,node_supabase_store,node_config,node_cache,node_qr_engine,node_qr_fallback toneRose
class node_player toneIndigo
```

## Components

### Player Experience

- [Tournament Hub](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/tournaments/page.tsx): `src/app/tournaments/page.tsx`
- [Tournament Detail](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/tournaments/%5Bslug%5D/page.tsx): `src/app/tournaments/[slug]/page.tsx`
- [Registration Flow](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/registration/%5Bslug%5D/page.tsx): `src/app/registration/[slug]/page.tsx`
- [Pass Verification](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/verify/page.tsx): `src/app/verify/page.tsx`
- [Player and Team Hubs](https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/players): `src/app/players`
- [Live Broadcast](https://github.com/veerachandra2008/pheonix-main/blob/main/src/components/xenova/LiveTelecaster.tsx): `src/components/xenova/LiveTelecaster.tsx`
- [Leaderboards](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/leaderboards/page.tsx): `src/app/leaderboards/page.tsx`
- [Teams and Games](https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/teams): `src/app/teams`

### Tournament Operations

- [Organizer Portal](https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/organizer): `src/app/organizer`
- [Admin Portal](https://github.com/veerachandra2008/pheonix-main/tree/main/src/app/admin): `src/app/admin`

### Application APIs

- [Flask API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/app.py): `backend/app.py`
- [Tournament API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/tournaments.py): `backend/routes/tournaments.py`
- [Payments API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/payments.py): `backend/routes/payments.py`
- [Registration API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/registrations.py): `backend/routes/registrations.py`
- [Authentication API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Organizer Applications](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/applications.py): `backend/routes/applications.py`
- [Attendance and Rosters](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/attendance.py): `backend/routes/attendance.py`
- [Leaderboard API](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/routes/leaderboard.py): `backend/routes/leaderboard.py`
- [Next API Routes](https://github.com/veerachandra2008/pheonix-main/blob/main/src/app/api/%5B...path%5D/route.ts): `src/app/api/[...path]/route.ts`

### Identity and Data

- [Tournament Data Access](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/tournaments-db.ts): `src/lib/tournaments-db.ts`
- [Flask API Client](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/flask-api.ts): `src/lib/flask-api.ts`
- [Session Manager](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/auth-session.ts): `src/lib/auth-session.ts`
- [Supabase Client](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Supabase Data Store**
- [Backend Configuration](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/config.py): `backend/config.py`
- [API Cache](https://github.com/veerachandra2008/pheonix-main/blob/main/backend/cache.py): `backend/cache.py`
- [QR Scanner Engine](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/qr-scanner-engine.ts): `src/lib/qr-scanner-engine.ts`
- [QR Decoder Fallback](https://github.com/veerachandra2008/pheonix-main/blob/main/src/lib/qr-decoder-fallback.ts): `src/lib/qr-decoder-fallback.ts`

### Other components

- **Players**

## Connections

- Players → Tournament Hub: browses (evidence: `README.md`)
- Players → Tournament Detail: views (evidence: `README.md`)
- Players → Registration Flow: registers through (evidence: `README.md`)
- Players → Pass Verification: verifies pass (evidence: `README.md`)
- Tournament Hub → Tournament Data Access: loads tournaments (evidence: `src/app/tournaments/page.tsx`)
- Tournament Detail → Tournament Data Access: loads tournament data (evidence: `src/app/tournaments/[slug]/page.tsx`)
- Tournament Detail → Flask API Client: requests API data (evidence: `src/app/tournaments/[slug]/page.tsx`)
- Registration Flow → Payments API: submits payment
- Pass Verification → Flask API Client: checks passes (evidence: `src/app/verify/page.tsx`)
- Pass Verification → QR Scanner Engine: scans codes (evidence: `src/app/verify/page.tsx`)
- QR Scanner Engine → QR Decoder Fallback: decodes with (evidence: `src/lib/qr-scanner-engine.ts`)
- Players → Player and Team Hubs: explores profiles (evidence: `README.md`)
- Players → Live Broadcast: watches matches (evidence: `README.md`)
- Players → Leaderboards: checks rankings (evidence: `README.md`)
- Players → Teams and Games: explores teams (evidence: `README.md`)
- Players → Organizer Portal: applies to host (evidence: `README.md`)
- Organizer Portal → Organizer Applications: submits application
- Organizer Portal → Tournament API: manages tournaments
- Organizer Portal → Attendance and Rosters: manages attendance
- Organizer Portal → Leaderboard API: manages results
- Admin Portal → Organizer Applications: reviews applications
- Flask API → Tournament API: registers blueprint (evidence: `backend/app.py`)
- Flask API → Payments API: registers blueprint (evidence: `backend/app.py`)
- Flask API → Registration API: registers blueprint (evidence: `backend/app.py`)
- Flask API → Authentication API: registers blueprint (evidence: `backend/app.py`)
- Flask API → Organizer Applications: registers blueprint (evidence: `backend/app.py`)
- Flask API → Attendance and Rosters: registers blueprints (evidence: `backend/app.py`)
- Flask API → Leaderboard API: registers blueprint (evidence: `backend/app.py`)
- Tournament Data Access → Supabase Client: queries (evidence: `src/lib/tournaments-db.ts`)
- Tournament Data Access → Session Manager: reads session (evidence: `src/lib/tournaments-db.ts`)
- Tournament Data Access → Flask API Client: requests API (evidence: `src/lib/tournaments-db.ts`)
- Supabase Client → Supabase Data Store: connects to
- Next API Routes → Supabase Client: queries (evidence: `src/app/api/[...path]/route.ts`)
- Next API Routes → Supabase Data Store: reads and writes (evidence: `src/app/api/[...path]/route.ts`)
- Flask API → Backend Configuration: loads configuration (evidence: `backend/app.py`)
- Tournament API → API Cache: uses cache (evidence: `backend/routes/tournaments.py`)
- Authentication API → API Cache: uses cache (evidence: `backend/routes/auth.py`)
- Tournament API → Backend Configuration: uses Supabase client (evidence: `backend/routes/tournaments.py`)
- Organizer Applications → Authentication API: reads user state (evidence: `backend/routes/applications.py`)
- Organizer Applications → Tournament API: reads tournament state (evidence: `backend/routes/applications.py`)
- Payments API → Backend Configuration: uses configuration (evidence: `backend/routes/payments.py`)
