# badr-abba/atlasperformance architecture

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

- Interactive diagram: https://gitdiagram.com/badr-abba/atlasperformance
- Repository: https://github.com/badr-abba/atlasperformance

## Overview

AtlasPerformance is a football analytics platform for World Cup and Africa Cup of Nations data. Its main workflow is to extract competition, team, match and player data from a football API, clean and validate it, persist it, then serve API and dashboard views with statistics and player-performance insights. The graph also includes the documented match-comparison and search capabilities. Some routes and frontend wiring are only partially sampled; those links are shown only where the README or source index supports them.

Main entry points: [`etl/run_etl.py`](https://github.com/badr-abba/atlasperformance/blob/main/etl/run_etl.py) (ETL orchestrator), [`app/main.py`](https://github.com/badr-abba/atlasperformance/blob/main/app/main.py) (FastAPI application), [`app/models.py`](https://github.com/badr-abba/atlasperformance/blob/main/app/models.py) (Domain models), [`app/database.py`](https://github.com/badr-abba/atlasperformance/blob/main/app/database.py) (PostgreSQL database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data ingestion"]
  node_etl_runner["ETL orchestrator<br/>[run_etl.py]"]
  node_extract_comp["Competition extraction<br/>[competitions.py]"]
  node_extract_teams["Team extraction<br/>[teams.py]"]
  node_extract_matches["Match extraction<br/>[matches.py]"]
  node_extract_players["Player and stats extraction<br/>[players.py]"]
  node_http["API client and cache<br/>[http_client.py]"]
end

subgraph group_processing["ETL processing"]
  node_cleaners["Data cleaning<br/>[cleaners.py]"]
  node_validators["Data validation<br/>[validators.py]"]
  node_loaders["Database loaders<br/>[loaders.py]"]
end

subgraph group_app["Application API"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_domain_routes["Competition and team routes<br/>[competitions.py]"]
  node_match_routes["Match routes<br/>[matches.py]"]
  node_player_routes["Player routes<br/>[players.py]"]
  node_performance_routes["Performance routes<br/>[performances.py]"]
  node_schemas["API schemas"]
end

subgraph group_analytics["Analytics experience"]
  node_analytics_routes["Analytics routes<br/>[analytics.py]"]
  node_statistics["Statistics service"]
  node_dashboard["Dashboard and search"]
end

subgraph group_storage["Persistence"]
  node_orm["Domain models<br/>[models.py]"]
  node_database[("PostgreSQL database<br/>[database.py]")]
end

node_user(("Analyst"))
node_football_api{{"Football data API"}}

node_user -->|"requests views"| node_api_app
node_api_app -->|"registers"| node_domain_routes
node_api_app -->|"registers"| node_match_routes
node_api_app -->|"registers"| node_player_routes
node_api_app -->|"registers"| node_performance_routes
node_api_app -->|"registers"| node_analytics_routes
node_api_app -.->|"serves dashboard"| node_dashboard
node_etl_runner -->|"fetches competitions"| node_extract_comp
node_etl_runner -->|"fetches teams"| node_extract_teams
node_etl_runner -->|"fetches matches"| node_extract_matches
node_etl_runner -->|"fetches players"| node_extract_players
node_extract_comp -->|"requests data"| node_http
node_extract_teams -->|"requests data"| node_http
node_extract_matches -->|"requests data"| node_http
node_extract_players -->|"requests data"| node_http
node_http -->|"sends GET requests"| node_football_api
node_etl_runner -->|"cleans records"| node_cleaners
node_etl_runner -->|"validates records"| node_validators
node_etl_runner -->|"loads records"| node_loaders
node_loaders -->|"writes records"| node_database
node_loaders -->|"maps entities"| node_orm
node_domain_routes -->|"queries data"| node_database
node_domain_routes -->|"queries entities"| node_orm
node_match_routes -->|"queries data"| node_database
node_match_routes -->|"queries entities"| node_orm
node_player_routes -->|"queries data"| node_database
node_player_routes -->|"queries entities"| node_orm
node_performance_routes -->|"queries data"| node_database
node_performance_routes -->|"queries entities"| node_orm
node_analytics_routes -->|"requests calculations"| node_statistics
node_analytics_routes -->|"queries data"| node_database
node_statistics -->|"aggregates records"| node_orm
node_player_routes -->|"validates responses"| node_schemas
node_match_routes -->|"validates responses"| node_schemas
node_orm -->|"uses base"| node_database

click node_etl_runner "https://github.com/badr-abba/atlasperformance/blob/main/etl/run_etl.py"
click node_extract_comp "https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/competitions.py"
click node_extract_teams "https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/teams.py"
click node_extract_matches "https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/matches.py"
click node_extract_players "https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/players.py"
click node_http "https://github.com/badr-abba/atlasperformance/blob/main/etl/utils/http_client.py"
click node_cleaners "https://github.com/badr-abba/atlasperformance/blob/main/etl/transform/cleaners.py"
click node_validators "https://github.com/badr-abba/atlasperformance/blob/main/etl/transform/validators.py"
click node_loaders "https://github.com/badr-abba/atlasperformance/blob/main/etl/load/loaders.py"
click node_api_app "https://github.com/badr-abba/atlasperformance/blob/main/app/main.py"
click node_domain_routes "https://github.com/badr-abba/atlasperformance/blob/main/app/routers/competitions.py"
click node_match_routes "https://github.com/badr-abba/atlasperformance/blob/main/app/routers/matches.py"
click node_player_routes "https://github.com/badr-abba/atlasperformance/blob/main/app/routers/players.py"
click node_performance_routes "https://github.com/badr-abba/atlasperformance/blob/main/app/routers/performances.py"
click node_analytics_routes "https://github.com/badr-abba/atlasperformance/blob/main/app/routers/analytics.py"
click node_statistics "https://github.com/badr-abba/atlasperformance/blob/main/app/services/statistics_service.py"
click node_dashboard "https://github.com/badr-abba/atlasperformance/tree/main/frontend/templates"
click node_schemas "https://github.com/badr-abba/atlasperformance/tree/main/app/schemas"
click node_orm "https://github.com/badr-abba/atlasperformance/blob/main/app/models.py"
click node_database "https://github.com/badr-abba/atlasperformance/blob/main/app/database.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_etl_runner,node_extract_comp,node_extract_teams,node_extract_matches,node_extract_players,node_http toneBlue
class node_cleaners,node_validators,node_loaders toneAmber
class node_api_app,node_domain_routes,node_match_routes,node_player_routes,node_performance_routes,node_schemas,node_football_api toneMint
class node_analytics_routes,node_statistics,node_dashboard toneRose
class node_orm,node_database,node_user toneIndigo
```

## Components

### Data ingestion

- [ETL orchestrator](https://github.com/badr-abba/atlasperformance/blob/main/etl/run_etl.py): `etl/run_etl.py`
- [Competition extraction](https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/competitions.py): `etl/extract/competitions.py`
- [Team extraction](https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/teams.py): `etl/extract/teams.py`
- [Match extraction](https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/matches.py): `etl/extract/matches.py`
- [Player and stats extraction](https://github.com/badr-abba/atlasperformance/blob/main/etl/extract/players.py): `etl/extract/players.py`
- [API client and cache](https://github.com/badr-abba/atlasperformance/blob/main/etl/utils/http_client.py): `etl/utils/http_client.py`

### ETL processing

- [Data cleaning](https://github.com/badr-abba/atlasperformance/blob/main/etl/transform/cleaners.py): `etl/transform/cleaners.py`
- [Data validation](https://github.com/badr-abba/atlasperformance/blob/main/etl/transform/validators.py): `etl/transform/validators.py`
- [Database loaders](https://github.com/badr-abba/atlasperformance/blob/main/etl/load/loaders.py): `etl/load/loaders.py`

### Application API

- [FastAPI application](https://github.com/badr-abba/atlasperformance/blob/main/app/main.py): `app/main.py`
- [Competition and team routes](https://github.com/badr-abba/atlasperformance/blob/main/app/routers/competitions.py): `app/routers/competitions.py`
- [Match routes](https://github.com/badr-abba/atlasperformance/blob/main/app/routers/matches.py): `app/routers/matches.py`
- [Player routes](https://github.com/badr-abba/atlasperformance/blob/main/app/routers/players.py): `app/routers/players.py`
- [Performance routes](https://github.com/badr-abba/atlasperformance/blob/main/app/routers/performances.py): `app/routers/performances.py`
- [API schemas](https://github.com/badr-abba/atlasperformance/tree/main/app/schemas): `app/schemas`

### Analytics experience

- [Analytics routes](https://github.com/badr-abba/atlasperformance/blob/main/app/routers/analytics.py): `app/routers/analytics.py`
- [Statistics service](https://github.com/badr-abba/atlasperformance/blob/main/app/services/statistics_service.py): `app/services/statistics_service.py`
- [Dashboard and search](https://github.com/badr-abba/atlasperformance/tree/main/frontend/templates): `frontend/templates`

### Persistence

- [Domain models](https://github.com/badr-abba/atlasperformance/blob/main/app/models.py): `app/models.py`
- [PostgreSQL database](https://github.com/badr-abba/atlasperformance/blob/main/app/database.py): `app/database.py`

### Other components

- **Analyst**
- **Football data API**

## Connections

- Analyst → FastAPI application: requests views (evidence: `README.md`)
- FastAPI application → Competition and team routes: registers (evidence: `app/main.py`)
- FastAPI application → Match routes: registers (evidence: `app/main.py`)
- FastAPI application → Player routes: registers (evidence: `app/main.py`)
- FastAPI application → Performance routes: registers (evidence: `app/main.py`)
- FastAPI application → Analytics routes: registers (evidence: `app/main.py`)
- FastAPI application → Dashboard and search: serves dashboard
- ETL orchestrator → Competition extraction: fetches competitions (evidence: `etl/run_etl.py`)
- ETL orchestrator → Team extraction: fetches teams (evidence: `etl/run_etl.py`)
- ETL orchestrator → Match extraction: fetches matches (evidence: `etl/run_etl.py`)
- ETL orchestrator → Player and stats extraction: fetches players (evidence: `etl/run_etl.py`)
- Competition extraction → API client and cache: requests data (evidence: `etl/extract/competitions.py`)
- Team extraction → API client and cache: requests data (evidence: `etl/extract/teams.py`)
- Match extraction → API client and cache: requests data (evidence: `etl/extract/matches.py`)
- Player and stats extraction → API client and cache: requests data (evidence: `etl/extract/players.py`)
- API client and cache → Football data API: sends GET requests (evidence: `etl/utils/http_client.py`)
- ETL orchestrator → Data cleaning: cleans records (evidence: `etl/run_etl.py`)
- ETL orchestrator → Data validation: validates records (evidence: `etl/run_etl.py`)
- ETL orchestrator → Database loaders: loads records (evidence: `etl/run_etl.py`)
- Database loaders → PostgreSQL database: writes records (evidence: `etl/load/loaders.py`)
- Database loaders → Domain models: maps entities (evidence: `etl/load/loaders.py`)
- Competition and team routes → PostgreSQL database: queries data (evidence: `app/routers/competitions.py`)
- Competition and team routes → Domain models: queries entities (evidence: `app/routers/competitions.py`)
- Match routes → PostgreSQL database: queries data (evidence: `app/routers/matches.py`)
- Match routes → Domain models: queries entities (evidence: `app/routers/matches.py`)
- Player routes → PostgreSQL database: queries data (evidence: `app/routers/players.py`)
- Player routes → Domain models: queries entities (evidence: `app/routers/players.py`)
- Performance routes → PostgreSQL database: queries data (evidence: `app/routers/performances.py`)
- Performance routes → Domain models: queries entities (evidence: `app/routers/performances.py`)
- Analytics routes → Statistics service: requests calculations (evidence: `app/routers/analytics.py`)
- Analytics routes → PostgreSQL database: queries data (evidence: `app/routers/analytics.py`)
- Statistics service → Domain models: aggregates records (evidence: `app/services/statistics_service.py`)
- Player routes → API schemas: validates responses (evidence: `app/routers/players.py`)
- Match routes → API schemas: validates responses (evidence: `app/routers/matches.py`)
- Domain models → PostgreSQL database: uses base (evidence: `app/models.py`)
