# gelerom/champmaster architecture

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

- Interactive diagram: https://gitdiagram.com/gelerom/champmaster
- Repository: https://github.com/gelerom/champmaster

## Overview

ChampMaster is a championship-management application: users register racers, results can be read from an image, and the product calculates points and displays standings. The graph preserves those documented stages alongside championship, team, organization, and account-management capabilities visible in the tree. The excerpts show frontend routing and authentication state, image-analysis modules, and PostgreSQL access; many route and feature implementations were not sampled, so uncertain connections are left out or marked unverified.

Main entry points: [`frontend/src/api/axiosConfig.jsx`](https://github.com/gelerom/champmaster/blob/main/frontend/src/api/axiosConfig.jsx) (API client), [`app/data/db_connection.py`](https://github.com/gelerom/champmaster/blob/main/app/data/db_connection.py) (Database connection), [`app/routes/api.py`](https://github.com/gelerom/champmaster/blob/main/app/routes/api.py) (Application API), [`app/data/db_vysledky_pg.py`](https://github.com/gelerom/champmaster/blob/main/app/data/db_vysledky_pg.py) (Race results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_app["Web routes<br/>[App.jsx]"]
  node_user_state["User context<br/>[UserContext.jsx]"]
  node_http_client["API client<br/>[axiosConfig.jsx]"]
  node_championship_ui["Championship manager"]
  node_team_ui["Team manager"]
  node_role_ui["Organization manager"]
end

subgraph group_services["Championship services"]
  node_api_routes["Application API<br/>[api.py]"]
  node_analysis_route["Analysis endpoint<br/>[analysis.py]"]
  node_image_analysis["Image analysis<br/>[main.py]"]
  node_ocr["OCR engine<br/>[ocr.py]"]
  node_result_ranking["Points and standings"]
  node_scheduler["Championship scheduler"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Authentication routes<br/>[login_logout.py]"]
  node_auth_helpers["Auth services<br/>[auth_helpers.py]"]
  node_email["Email delivery<br/>[email_service.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_connection["Database connection<br/>[db_connection.py]"]
  node_championship_data["Championship data"]
  node_driver_data["Driver data<br/>[db_jezdci_pg.py]"]
  node_team_data["Team data<br/>[db_tymy_pg.py]"]
  node_results_data["Race results<br/>[db_vysledky_pg.py]"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Racer or manager"))

node_visitor -->|"uses"| node_web_app
node_web_app -->|"provides context"| node_user_state
node_user_state -->|"requests data"| node_http_client
node_championship_ui -.->|"sends requests"| node_http_client
node_team_ui -->|"sends requests"| node_http_client
node_role_ui -->|"sends requests"| node_http_client
node_http_client -.->|"calls API"| node_api_routes
node_api_routes -.->|"accesses"| node_championship_data
node_api_routes -.->|"accesses"| node_driver_data
node_api_routes -.->|"accesses"| node_team_data
node_visitor -.->|"submits result image"| node_analysis_route
node_analysis_route -.->|"invokes analysis"| node_image_analysis
node_image_analysis -->|"performs OCR"| node_ocr
node_image_analysis -->|"loads race data"| node_results_data
node_visitor -.->|"views points and standings"| node_result_ranking
node_scheduler -.->|"updates statuses"| node_championship_data
node_auth_routes -.->|"uses auth services"| node_auth_helpers
node_auth_helpers -.->|"sends verification mail"| node_email
node_championship_data -->|"opens connection"| node_db_connection
node_driver_data -->|"opens connection"| node_db_connection
node_team_data -->|"opens connection"| node_db_connection
node_results_data -->|"opens connection"| node_db_connection
node_db_connection -->|"connects to"| node_postgres
node_driver_data -->|"queries results"| node_results_data
node_results_data -->|"queries championship"| node_championship_data

click node_web_app "https://github.com/gelerom/champmaster/blob/main/frontend/src/App.jsx"
click node_user_state "https://github.com/gelerom/champmaster/blob/main/frontend/src/context/UserContext.jsx"
click node_http_client "https://github.com/gelerom/champmaster/blob/main/frontend/src/api/axiosConfig.jsx"
click node_championship_ui "https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/SampionatManagerPage.jsx"
click node_team_ui "https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/TeamManagerPage/TeamManagerPage.jsx"
click node_role_ui "https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/RoleManagerPage.jsx"
click node_api_routes "https://github.com/gelerom/champmaster/blob/main/app/routes/api.py"
click node_analysis_route "https://github.com/gelerom/champmaster/blob/main/app/routes/analysis.py"
click node_image_analysis "https://github.com/gelerom/champmaster/blob/main/app/logic/analyza_obrazu/main.py"
click node_ocr "https://github.com/gelerom/champmaster/blob/main/app/logic/analyza_obrazu/ocr.py"
click node_result_ranking "https://github.com/gelerom/champmaster/blob/main/app/logic/pozice_vysledkove_tabulky.py"
click node_scheduler "https://github.com/gelerom/champmaster/blob/main/app/logic/championship_scheduler.py"
click node_auth_routes "https://github.com/gelerom/champmaster/blob/main/app/routes/auth/login_logout.py"
click node_auth_helpers "https://github.com/gelerom/champmaster/blob/main/app/my_auth/auth_helpers.py"
click node_email "https://github.com/gelerom/champmaster/blob/main/app/my_auth/email_service.py"
click node_db_connection "https://github.com/gelerom/champmaster/blob/main/app/data/db_connection.py"
click node_championship_data "https://github.com/gelerom/champmaster/blob/main/app/data/db_sampionaty_pg.py"
click node_driver_data "https://github.com/gelerom/champmaster/blob/main/app/data/db_jezdci_pg.py"
click node_team_data "https://github.com/gelerom/champmaster/blob/main/app/data/db_tymy_pg.py"
click node_results_data "https://github.com/gelerom/champmaster/blob/main/app/data/db_vysledky_pg.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_web_app,node_user_state,node_http_client,node_championship_ui,node_team_ui,node_role_ui toneBlue
class node_api_routes,node_analysis_route,node_image_analysis,node_ocr,node_result_ranking,node_scheduler toneAmber
class node_auth_routes,node_auth_helpers,node_email toneMint
class node_db_connection,node_championship_data,node_driver_data,node_team_data,node_results_data,node_postgres toneRose
class node_visitor toneIndigo
```

## Components

### Web application

- [Web routes](https://github.com/gelerom/champmaster/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [User context](https://github.com/gelerom/champmaster/blob/main/frontend/src/context/UserContext.jsx): `frontend/src/context/UserContext.jsx`
- [API client](https://github.com/gelerom/champmaster/blob/main/frontend/src/api/axiosConfig.jsx): `frontend/src/api/axiosConfig.jsx`
- [Championship manager](https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/SampionatManagerPage.jsx): `frontend/src/pages/SampionatManagerPage.jsx`
- [Team manager](https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/TeamManagerPage/TeamManagerPage.jsx): `frontend/src/pages/TeamManagerPage/TeamManagerPage.jsx`
- [Organization manager](https://github.com/gelerom/champmaster/blob/main/frontend/src/pages/RoleManagerPage.jsx): `frontend/src/pages/RoleManagerPage.jsx`

### Championship services

- [Application API](https://github.com/gelerom/champmaster/blob/main/app/routes/api.py): `app/routes/api.py`
- [Analysis endpoint](https://github.com/gelerom/champmaster/blob/main/app/routes/analysis.py): `app/routes/analysis.py`
- [Image analysis](https://github.com/gelerom/champmaster/blob/main/app/logic/analyza_obrazu/main.py): `app/logic/analyza_obrazu/main.py`
- [OCR engine](https://github.com/gelerom/champmaster/blob/main/app/logic/analyza_obrazu/ocr.py): `app/logic/analyza_obrazu/ocr.py`
- [Points and standings](https://github.com/gelerom/champmaster/blob/main/app/logic/pozice_vysledkove_tabulky.py): `app/logic/pozice_vysledkove_tabulky.py`
- [Championship scheduler](https://github.com/gelerom/champmaster/blob/main/app/logic/championship_scheduler.py): `app/logic/championship_scheduler.py`

### Identity and access

- [Authentication routes](https://github.com/gelerom/champmaster/blob/main/app/routes/auth/login_logout.py): `app/routes/auth/login_logout.py`
- [Auth services](https://github.com/gelerom/champmaster/blob/main/app/my_auth/auth_helpers.py): `app/my_auth/auth_helpers.py`
- [Email delivery](https://github.com/gelerom/champmaster/blob/main/app/my_auth/email_service.py): `app/my_auth/email_service.py`

### Persistence

- [Database connection](https://github.com/gelerom/champmaster/blob/main/app/data/db_connection.py): `app/data/db_connection.py`
- [Championship data](https://github.com/gelerom/champmaster/blob/main/app/data/db_sampionaty_pg.py): `app/data/db_sampionaty_pg.py`
- [Driver data](https://github.com/gelerom/champmaster/blob/main/app/data/db_jezdci_pg.py): `app/data/db_jezdci_pg.py`
- [Team data](https://github.com/gelerom/champmaster/blob/main/app/data/db_tymy_pg.py): `app/data/db_tymy_pg.py`
- [Race results](https://github.com/gelerom/champmaster/blob/main/app/data/db_vysledky_pg.py): `app/data/db_vysledky_pg.py`
- **PostgreSQL**

### Other components

- **Racer or manager**

## Connections

- Racer or manager → Web routes: uses
- Web routes → User context: provides context (evidence: `frontend/src/App.jsx`)
- User context → API client: requests data (evidence: `frontend/src/context/UserContext.jsx`)
- Championship manager → API client: sends requests
- Team manager → API client: sends requests (evidence: `frontend/src/pages/TeamManagerPage/TeamManagerPage.jsx`)
- Organization manager → API client: sends requests (evidence: `frontend/src/pages/RoleManagerPage.jsx`)
- API client → Application API: calls API
- Application API → Championship data: accesses
- Application API → Driver data: accesses
- Application API → Team data: accesses
- Racer or manager → Analysis endpoint: submits result image
- Analysis endpoint → Image analysis: invokes analysis
- Image analysis → OCR engine: performs OCR (evidence: `app/logic/analyza_obrazu/main.py`)
- Image analysis → Race results: loads race data
- Racer or manager → Points and standings: views points and standings
- Championship scheduler → Championship data: updates statuses
- Authentication routes → Auth services: uses auth services
- Auth services → Email delivery: sends verification mail
- Championship data → Database connection: opens connection (evidence: `app/data/db_sampionaty_pg.py`)
- Driver data → Database connection: opens connection (evidence: `app/data/db_jezdci_pg.py`)
- Team data → Database connection: opens connection (evidence: `app/data/db_tymy_pg.py`)
- Race results → Database connection: opens connection (evidence: `app/data/db_vysledky_pg.py`)
- Database connection → PostgreSQL: connects to (evidence: `app/data/db_connection.py`)
- Driver data → Race results: queries results (evidence: `app/data/db_jezdci_pg.py`)
- Race results → Championship data: queries championship (evidence: `app/data/db_vysledky_pg.py`)
