# dagbolade/all_leagues-_prediction architecture

> Architecture diagram of the GitHub repository dagbolade/all_leagues-_prediction, 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/dagbolade/all_leagues-_prediction
- Repository: https://github.com/dagbolade/all_leagues-_prediction

## Overview

Matchday is a multi-sport analysis website and CLI, with sportslab/ as the active implementation. The principal workflow is provider data refresh into SQLite, chronological feature construction and model training, then website predictions and a private, settleable forecast journal. The graph follows the README’s documented active architecture; source excerpts for sportslab/web.py, features.py, model.py, and the CLI are unavailable, so those internal links are based on README statements rather than inspected call sites.

Main entry points: [`sportslab/web.py`](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/web.py) (Flask website), [`sportslab/ingest.py`](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/ingest.py) (Provider importer), [`sportslab/__main__.py`](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/__main__.py) (Sportslab CLI), [`sportslab/model.py`](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py) (Training and benchmark)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_cli["Sportslab CLI<br/>[__main__.py]"]
  node_web["Flask website<br/>[web.py]"]
  node_web_ui["Website interface<br/>[app.js]"]
end

subgraph group_data["Data operations"]
  node_ingest["Provider importer<br/>[ingest.py]"]
  node_catalog["Provider catalog<br/>[catalog.py]"]
  node_aliases["Team aliases<br/>[aliases.py]"]
  node_lock["Writer lock<br/>[locking.py]"]
end

subgraph group_prediction["Prediction and evaluation"]
  node_feature_pipeline["Chronological features<br/>[features.py]"]
  node_sport_models["Sport models<br/>[model.py]"]
  node_train["Training and benchmark<br/>[model.py]"]
end

subgraph group_state["State and artifacts"]
  node_store[("SQLite store<br/>[store.py]")]
  node_raw["Raw downloads<br/>[ingest.py]"]
  node_artifacts["Model artifacts<br/>[model.py]"]
  node_journal[("Forecast journal<br/>[store.py]")]
end

node_user(("Analyst"))
node_browser(("Browser"))
node_providers(("Sports data providers"))

node_user -->|"runs commands"| node_cli
node_user -->|"uses website"| node_browser
node_browser -->|"uses interface"| node_web_ui
node_web_ui -->|"requests views"| node_web
node_cli -->|"refreshes data"| node_ingest
node_providers -->|"provides results"| node_ingest
node_ingest -->|"selects sources"| node_catalog
node_ingest -->|"resolves identities"| node_aliases
node_ingest -->|"archives responses"| node_raw
node_ingest -->|"upserts matches"| node_store
node_cli -->|"locks writers"| node_lock
node_cli -->|"trains models"| node_train
node_train -->|"builds features"| node_feature_pipeline
node_train -->|"reads matches"| node_store
node_train -->|"writes versions"| node_artifacts
node_web -->|"builds features"| node_feature_pipeline
node_web -->|"predicts matches"| node_sport_models
node_web -->|"reads match data"| node_store
node_sport_models -->|"loads serving models"| node_artifacts
node_web -->|"records forecasts"| node_journal
node_web -->|"settles forecasts"| node_journal
node_web -->|"shows coverage"| node_store

click node_cli "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/__main__.py"
click node_web "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/web.py"
click node_web_ui "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/static/app.js"
click node_ingest "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/ingest.py"
click node_catalog "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/catalog.py"
click node_aliases "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/aliases.py"
click node_feature_pipeline "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/features.py"
click node_sport_models "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py"
click node_train "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py"
click node_lock "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/locking.py"
click node_store "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/store.py"
click node_raw "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/ingest.py"
click node_artifacts "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py"
click node_journal "https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/store.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_cli,node_web,node_web_ui,node_browser toneBlue
class node_ingest,node_catalog,node_aliases,node_lock toneAmber
class node_feature_pipeline,node_sport_models,node_train toneMint
class node_store,node_raw,node_artifacts,node_journal toneRose
class node_user,node_providers toneIndigo
```

## Components

### User interfaces

- [Sportslab CLI](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/__main__.py): `sportslab/__main__.py`
- [Flask website](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/web.py): `sportslab/web.py`
- [Website interface](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/static/app.js): `sportslab/static/app.js`

### Data operations

- [Provider importer](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/ingest.py): `sportslab/ingest.py`
- [Provider catalog](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/catalog.py): `sportslab/catalog.py`
- [Team aliases](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/aliases.py): `sportslab/aliases.py`
- [Writer lock](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/locking.py): `sportslab/locking.py`

### Prediction and evaluation

- [Chronological features](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/features.py): `sportslab/features.py`
- [Sport models](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py): `sportslab/model.py`
- [Training and benchmark](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py): `sportslab/model.py`

### State and artifacts

- [SQLite store](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/store.py): `sportslab/store.py`
- [Raw downloads](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/ingest.py): `sportslab/ingest.py`
- [Model artifacts](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/model.py): `sportslab/model.py`
- [Forecast journal](https://github.com/dagbolade/all_leagues-_prediction/blob/master/sportslab/store.py): `sportslab/store.py`

### Other components

- **Analyst**
- **Browser**
- **Sports data providers**

## Connections

- Analyst → Sportslab CLI: runs commands (evidence: `README.md`)
- Analyst → Browser: uses website (evidence: `README.md`)
- Browser → Website interface: uses interface (evidence: `README.md`)
- Website interface → Flask website: requests views (evidence: `README.md`)
- Sportslab CLI → Provider importer: refreshes data (evidence: `README.md`)
- Sports data providers → Provider importer: provides results (evidence: `README.md`)
- Provider importer → Provider catalog: selects sources (evidence: `README.md`)
- Provider importer → Team aliases: resolves identities (evidence: `README.md`)
- Provider importer → Raw downloads: archives responses (evidence: `README.md`)
- Provider importer → SQLite store: upserts matches (evidence: `README.md`)
- Sportslab CLI → Writer lock: locks writers (evidence: `README.md`)
- Sportslab CLI → Training and benchmark: trains models (evidence: `README.md`)
- Training and benchmark → Chronological features: builds features (evidence: `README.md`)
- Training and benchmark → SQLite store: reads matches (evidence: `README.md`)
- Training and benchmark → Model artifacts: writes versions (evidence: `README.md`)
- Flask website → Chronological features: builds features (evidence: `README.md`)
- Flask website → Sport models: predicts matches (evidence: `README.md`)
- Flask website → SQLite store: reads match data (evidence: `README.md`)
- Sport models → Model artifacts: loads serving models (evidence: `README.md`)
- Flask website → Forecast journal: records forecasts (evidence: `README.md`)
- Flask website → Forecast journal: settles forecasts (evidence: `README.md`)
- Flask website → SQLite store: shows coverage (evidence: `README.md`)
