# masher001/floorball-kenya architecture

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

- Interactive diagram: https://gitdiagram.com/masher001/floorball-kenya
- Repository: https://github.com/masher001/floorball-kenya

## Overview

FloorballKenya is a planned web platform for Kenyan floorball administration and commerce. The main user workflow runs from browser pages through the JavaScript API client to FastAPI, where domain endpoints handle competition, marketplace, and account workflows and use Supabase for persistence. The README also describes media storage, advertising, sponsorship, analytics, and administration capabilities. Some domain areas are documented but their source was not sampled, so their internal call relationships are not asserted here.

Main entry points: [`backend/app/modules/leagues`](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/leagues) (Leagues and seasons), [`backend/app/database/supabase.py`](https://github.com/masher001/floorball-kenya/blob/main/backend/app/database/supabase.py) (Supabase data services), [`frontend/js/pages`](https://github.com/masher001/floorball-kenya/tree/main/frontend/js/pages) (Public pages and dashboards), [`frontend/js/api.js`](https://github.com/masher001/floorball-kenya/blob/main/frontend/js/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webpages["Public pages and dashboards"]
  node_webapi["API client<br/>[api.js]"]
  node_webauth["Session handling<br/>[auth.js]"]
  node_webconfig["Web configuration<br/>[config.js]"]
end

subgraph group_api["API and access"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_authroutes["Authentication routes<br/>[auth.py]"]
  node_users["User management"]
end

subgraph group_competition["Competition operations"]
  node_leagues["Leagues and seasons"]
  node_tournaments["Tournament draws"]
  node_matches["Matches and results"]
  node_officials["Officials and assignments"]
  node_standings["Standings and statistics"]
end

subgraph group_commerce["Marketplace and promotion"]
  node_market["Marketplace"]
  node_orders["Orders"]
  node_payments["Payments and commissions"]
  node_advertising["Campaign management"]
  node_adeligibility["Ad eligibility<br/>[service.py]"]
  node_sponsors["Sponsor directory"]
end

subgraph group_platform["Shared platform"]
  node_analytics["Analytics"]
  node_gallery["Gallery and media"]
  node_audit["Audit logging<br/>[service.py]"]
  node_supabase[("Supabase data services<br/>[supabase.py]")]
  node_storage["Supabase file storage<br/>[storage.py]"]
end

node_user(("Platform user"))
node_supabase_external[("Supabase")]

node_user -->|"uses"| node_webpages
node_webpages -->|"requests data"| node_webapi
node_webpages -.->|"uses sessions"| node_webauth
node_webapi -->|"reads endpoints"| node_webconfig
node_webapi -->|"sends HTTP requests"| node_backend
node_backend -->|"mounts routes"| node_authroutes
node_backend -->|"mounts module routes"| node_leagues
node_user -.->|"manages account"| node_users
node_user -.->|"follows competitions"| node_leagues
node_user -.->|"manages draws"| node_tournaments
node_user -.->|"views and submits results"| node_matches
node_user -->|"coordinates officials"| node_officials
node_user -.->|"shops"| node_market
node_user -.->|"manages orders"| node_orders
node_user -.->|"manages campaigns"| node_advertising
node_user -.->|"views sponsors"| node_sponsors
node_leagues -->|"reads and writes"| node_supabase
node_leagues -->|"exposes standings"| node_standings
node_officials -->|"assigns officials"| node_tournaments
node_gallery -->|"uploads media"| node_storage
node_storage -->|"uses client"| node_supabase
node_supabase -->|"connects to"| node_supabase_external
node_advertising -->|"records changes"| node_audit
node_adeligibility -->|"records changes"| node_audit
node_analytics -.->|"accesses data"| node_supabase
node_orders -.->|"payment workflow"| node_payments
node_matches -.->|"updates results"| node_standings

click node_webpages "https://github.com/masher001/floorball-kenya/tree/main/frontend/js/pages"
click node_webapi "https://github.com/masher001/floorball-kenya/blob/main/frontend/js/api.js"
click node_webauth "https://github.com/masher001/floorball-kenya/blob/main/frontend/js/ui/auth.js"
click node_webconfig "https://github.com/masher001/floorball-kenya/blob/main/frontend/js/config.js"
click node_backend "https://github.com/masher001/floorball-kenya/blob/main/backend/app/main.py"
click node_authroutes "https://github.com/masher001/floorball-kenya/blob/main/backend/app/routers/auth.py"
click node_users "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/users"
click node_leagues "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/leagues"
click node_tournaments "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/tournaments"
click node_matches "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/matches"
click node_officials "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/officials"
click node_standings "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/standings"
click node_market "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/marketplace"
click node_orders "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/orders"
click node_payments "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/payments"
click node_advertising "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/campaigns"
click node_adeligibility "https://github.com/masher001/floorball-kenya/blob/main/backend/app/modules/advertisements/service.py"
click node_sponsors "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/sponsors"
click node_analytics "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/analytics"
click node_gallery "https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/gallery"
click node_audit "https://github.com/masher001/floorball-kenya/blob/main/backend/app/modules/audit/service.py"
click node_supabase "https://github.com/masher001/floorball-kenya/blob/main/backend/app/database/supabase.py"
click node_storage "https://github.com/masher001/floorball-kenya/blob/main/backend/app/intergrations.py/storage.py"

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_webpages,node_webapi,node_webauth,node_webconfig,node_user toneBlue
class node_backend,node_authroutes,node_users,node_supabase_external toneAmber
class node_leagues,node_tournaments,node_matches,node_officials,node_standings toneMint
class node_market,node_orders,node_payments,node_advertising,node_adeligibility,node_sponsors toneRose
class node_analytics,node_gallery,node_audit,node_supabase,node_storage toneIndigo
```

## Components

### Web experience

- [Public pages and dashboards](https://github.com/masher001/floorball-kenya/tree/main/frontend/js/pages): `frontend/js/pages`
- [API client](https://github.com/masher001/floorball-kenya/blob/main/frontend/js/api.js): `frontend/js/api.js`
- [Session handling](https://github.com/masher001/floorball-kenya/blob/main/frontend/js/ui/auth.js): `frontend/js/ui/auth.js`
- [Web configuration](https://github.com/masher001/floorball-kenya/blob/main/frontend/js/config.js): `frontend/js/config.js`

### API and access

- [FastAPI application](https://github.com/masher001/floorball-kenya/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication routes](https://github.com/masher001/floorball-kenya/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [User management](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/users): `backend/app/modules/users`

### Competition operations

- [Leagues and seasons](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/leagues): `backend/app/modules/leagues`
- [Tournament draws](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/tournaments): `backend/app/modules/tournaments`
- [Matches and results](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/matches): `backend/app/modules/matches`
- [Officials and assignments](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/officials): `backend/app/modules/officials`
- [Standings and statistics](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/standings): `backend/app/modules/standings`

### Marketplace and promotion

- [Marketplace](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/marketplace): `backend/app/modules/marketplace`
- [Orders](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/orders): `backend/app/modules/orders`
- [Payments and commissions](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/payments): `backend/app/modules/payments`
- [Campaign management](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/campaigns): `backend/app/modules/campaigns`
- [Ad eligibility](https://github.com/masher001/floorball-kenya/blob/main/backend/app/modules/advertisements/service.py): `backend/app/modules/advertisements/service.py`
- [Sponsor directory](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/sponsors): `backend/app/modules/sponsors`

### Shared platform

- [Analytics](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/analytics): `backend/app/modules/analytics`
- [Gallery and media](https://github.com/masher001/floorball-kenya/tree/main/backend/app/modules/gallery): `backend/app/modules/gallery`
- [Audit logging](https://github.com/masher001/floorball-kenya/blob/main/backend/app/modules/audit/service.py): `backend/app/modules/audit/service.py`
- [Supabase data services](https://github.com/masher001/floorball-kenya/blob/main/backend/app/database/supabase.py): `backend/app/database/supabase.py`
- [Supabase file storage](https://github.com/masher001/floorball-kenya/blob/main/backend/app/intergrations.py/storage.py): `backend/app/intergrations.py/storage.py`

### Other components

- **Platform user**
- **Supabase**

## Connections

- Platform user → Public pages and dashboards: uses (evidence: `README.md`)
- Public pages and dashboards → API client: requests data (evidence: `README.md`)
- Public pages and dashboards → Session handling: uses sessions (evidence: `frontend/js/pages/admin-dashboard.js`)
- API client → Web configuration: reads endpoints (evidence: `frontend/js/api.js`)
- API client → FastAPI application: sends HTTP requests (evidence: `README.md`)
- FastAPI application → Authentication routes: mounts routes (evidence: `backend/app/main.py`)
- FastAPI application → Leagues and seasons: mounts module routes (evidence: `backend/app/main.py`)
- Platform user → User management: manages account
- Platform user → Leagues and seasons: follows competitions
- Platform user → Tournament draws: manages draws
- Platform user → Matches and results: views and submits results
- Platform user → Officials and assignments: coordinates officials (evidence: `backend/app/modules/officials/router.py`)
- Platform user → Marketplace: shops
- Platform user → Orders: manages orders
- Platform user → Campaign management: manages campaigns
- Platform user → Sponsor directory: views sponsors
- Leagues and seasons → Supabase data services: reads and writes (evidence: `backend/app/modules/leagues/router.py`)
- Leagues and seasons → Standings and statistics: exposes standings (evidence: `backend/app/modules/leagues/router.py`)
- Officials and assignments → Tournament draws: assigns officials (evidence: `backend/app/modules/officials/router.py`)
- Gallery and media → Supabase file storage: uploads media (evidence: `backend/app/modules/gallery/router.py`)
- Supabase file storage → Supabase data services: uses client (evidence: `backend/app/intergrations.py/storage.py`)
- Supabase data services → Supabase: connects to (evidence: `backend/app/database/supabase.py`)
- Campaign management → Audit logging: records changes (evidence: `backend/app/modules/campaigns/service.py`)
- Ad eligibility → Audit logging: records changes (evidence: `backend/app/modules/advertisements/service.py`)
- Analytics → Supabase data services: accesses data (evidence: `backend/app/modules/analytics/repository.py`)
- Orders → Payments and commissions: payment workflow
- Matches and results → Standings and statistics: updates results
