# 26lenkalaa/tabet architecture

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

- Interactive diagram: https://gitdiagram.com/26lenkalaa/tabet
- Repository: https://github.com/26lenkalaa/tabet

## Overview

TaBet forecasts sports results and evaluates them against betting-market odds, which the README says are benchmarks rather than model inputs. The principal workflow is sport-specific match data and features into forecasts, evaluation, and sport pages; a shared read-only API and Supabase-backed store support serving and data access. The README establishes the product boundaries, while source-index references support only the sampled module relationships below; unsampled subsystem links are omitted where their callers are not shown.

Main entry points: [`soccer (premier league)/tabet/experiments.py`](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/experiments.py) (Model experiments), [`soccer (premier league)/tabet/fd_cache.py`](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/fd_cache.py) (Season cache), [`soccer (premier league)/tabet/teams.py`](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/teams.py) (Team identity), [`soccer (premier league)/tabet/managers.py`](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/managers.py) (Manager effects)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_soccer["Soccer forecasting"]
  node_soccer_cli["Soccer commands<br/>[cli.py]"]
  node_soccer_ingest["Match ingestion<br/>[ingest.py]"]
  node_soccer_api_data["Football data collector<br/>[api_football.py]"]
  node_soccer_cache["Season cache<br/>[fd_cache.py]"]
  node_soccer_teams["Team identity<br/>[teams.py]"]
  node_soccer_model["Dixon-Coles model<br/>[model.py]"]
  node_soccer_features["Match features<br/>[features.py]"]
  node_soccer_experiments["Model experiments<br/>[experiments.py]"]
  node_soccer_fpl["Player data<br/>[fpl.py]"]
  node_soccer_managers["Manager effects<br/>[managers.py]"]
  node_soccer_benchmark["Market benchmark"]
  node_soccer_forecast["Forecasting<br/>[forecast.py]"]
  node_soccer_site_data["Soccer site data<br/>[site_data.py]"]
  node_soccer_research["XI research<br/>[run_dxi.py]"]
end

subgraph group_shared["Shared platform"]
  node_soccer_storage["Supabase storage client"]
  node_backend_api["Read-only API<br/>[app.js]"]
  node_backend_live["Live caching<br/>[live.js]"]
  node_supabase_repo[("Supabase repository<br/>[supabase.js]")]
  node_shared_site["Shared sport pages<br/>[common.js]"]
  node_football_page["NFL page<br/>[football.js]"]
  node_basket_page["Basketball page<br/>[basketball.js]"]
end

subgraph group_basketball["Basketball forecasts"]
  node_basket_api["Basketball API<br/>[main.py]"]
  node_basket_db[("Basketball database<br/>[db.py]")]
  node_basket_predict["Basketball prediction<br/>[predict.py]"]
  node_basket_models["Basketball ratings<br/>[ratings.py]"]
  node_basket_market["Odds market data<br/>[market.py]"]
  node_basket_ingest_odds["Odds ingestion<br/>[fetch_odds.py]"]
  node_basket_backtest["Basketball backtesting<br/>[backtest.py]"]
end

subgraph group_football["NFL forecasts"]
  node_football_model["NFL Elo model<br/>[model.py]"]
  node_football_data["NFL game data<br/>[data.py]"]
  node_football_backtest["NFL backtesting<br/>[backtest.py]"]
end

node_api_actor(("Website and API clients"))

node_soccer_ingest -->|"uses identities"| node_soccer_teams
node_soccer_fpl -->|"uses identities"| node_soccer_teams
node_soccer_managers -->|"uses identities"| node_soccer_teams
node_soccer_managers -->|"collects data"| node_soccer_api_data
node_soccer_managers -->|"uses cache"| node_soccer_cache
node_soccer_cache -->|"reads and writes"| node_soccer_storage
node_soccer_cache -->|"uses player data"| node_soccer_fpl
node_soccer_cache -->|"uses league data"| node_soccer_teams
node_soccer_experiments -->|"loads matches"| node_soccer_ingest
node_soccer_experiments -->|"builds features"| node_soccer_features
node_soccer_experiments -->|"fits baseline"| node_soccer_model
node_soccer_experiments -->|"evaluated by"| node_soccer_research
node_soccer_cli -.->|"runs forecasts"| node_soccer_forecast
node_soccer_forecast -.->|"exports results"| node_soccer_site_data
node_soccer_forecast -.->|"compares odds"| node_soccer_benchmark
node_api_actor -->|"requests data"| node_backend_api
node_backend_api -->|"uses caching"| node_backend_live
node_backend_api -.->|"queries repository"| node_supabase_repo
node_soccer_api_data -.->|"stores collected data"| node_soccer_storage
node_basket_api -->|"runs backtests"| node_basket_backtest
node_basket_api -->|"accesses database"| node_basket_db
node_basket_api -->|"uses market data"| node_basket_market
node_basket_predict -->|"reads and saves"| node_basket_db
node_basket_predict -->|"uses ratings"| node_basket_models
node_basket_db -->|"uses market data"| node_basket_market
node_basket_ingest_odds -->|"uses market definitions"| node_basket_market
node_football_model -->|"uses game data"| node_football_data
node_football_backtest -->|"evaluates model"| node_football_model
node_football_backtest -->|"loads game data"| node_football_data
node_shared_site -.->|"shared page utilities"| node_football_page
node_api_actor -->|"views page"| node_football_page
node_api_actor -->|"views page"| node_basket_page

click node_soccer_cli "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/cli.py"
click node_soccer_ingest "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/ingest.py"
click node_soccer_api_data "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/api_football.py"
click node_soccer_cache "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/fd_cache.py"
click node_soccer_teams "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/teams.py"
click node_soccer_model "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/model.py"
click node_soccer_features "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/features.py"
click node_soccer_experiments "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/experiments.py"
click node_soccer_fpl "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/fpl.py"
click node_soccer_managers "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/managers.py"
click node_soccer_benchmark "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/market_benchmark.py"
click node_soccer_forecast "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/forecast.py"
click node_soccer_site_data "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/site_data.py"
click node_soccer_research "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/prototypes/run_dxi.py"
click node_soccer_storage "https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/supabase_storage.py"
click node_backend_api "https://github.com/26lenkalaa/tabet/blob/main/backend/src/app.js"
click node_backend_live "https://github.com/26lenkalaa/tabet/blob/main/backend/src/live.js"
click node_supabase_repo "https://github.com/26lenkalaa/tabet/blob/main/backend/src/repo/supabase.js"
click node_shared_site "https://github.com/26lenkalaa/tabet/blob/main/site/common.js"
click node_basket_api "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/api/main.py"
click node_basket_db "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/db.py"
click node_basket_predict "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/predict.py"
click node_basket_models "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/models/ratings.py"
click node_basket_market "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/market.py"
click node_basket_ingest_odds "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/ingest/fetch_odds.py"
click node_basket_backtest "https://github.com/26lenkalaa/tabet/blob/main/basketball/src/backtest.py"
click node_football_model "https://github.com/26lenkalaa/tabet/blob/main/Football/model.py"
click node_football_data "https://github.com/26lenkalaa/tabet/blob/main/Football/data.py"
click node_football_backtest "https://github.com/26lenkalaa/tabet/blob/main/Football/backtest.py"
click node_football_page "https://github.com/26lenkalaa/tabet/blob/main/site/football.js"
click node_basket_page "https://github.com/26lenkalaa/tabet/blob/main/site/basketball.js"

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_soccer_cli,node_soccer_ingest,node_soccer_api_data,node_soccer_cache,node_soccer_teams,node_soccer_model,node_soccer_features,node_soccer_experiments,node_soccer_fpl,node_soccer_managers,node_soccer_benchmark,node_soccer_forecast,node_soccer_site_data,node_soccer_research,node_api_actor toneBlue
class node_soccer_storage,node_backend_api,node_backend_live,node_supabase_repo,node_shared_site,node_football_page,node_basket_page toneAmber
class node_basket_api,node_basket_db,node_basket_predict,node_basket_models,node_basket_market,node_basket_ingest_odds,node_basket_backtest toneMint
class node_football_model,node_football_data,node_football_backtest toneRose
```

## Components

### Soccer forecasting

- [Soccer commands](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/cli.py): `soccer (premier league)/tabet/cli.py`
- [Match ingestion](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/ingest.py): `soccer (premier league)/tabet/ingest.py`
- [Football data collector](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/api_football.py): `soccer (premier league)/tabet/api_football.py`
- [Season cache](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/fd_cache.py): `soccer (premier league)/tabet/fd_cache.py`
- [Team identity](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/teams.py): `soccer (premier league)/tabet/teams.py`
- [Dixon-Coles model](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/model.py): `soccer (premier league)/tabet/model.py`
- [Match features](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/features.py): `soccer (premier league)/tabet/features.py`
- [Model experiments](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/experiments.py): `soccer (premier league)/tabet/experiments.py`
- [Player data](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/fpl.py): `soccer (premier league)/tabet/fpl.py`
- [Manager effects](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/managers.py): `soccer (premier league)/tabet/managers.py`
- [Market benchmark](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/market_benchmark.py): `soccer (premier league)/tabet/market_benchmark.py`
- [Forecasting](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/forecast.py): `soccer (premier league)/tabet/forecast.py`
- [Soccer site data](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/site_data.py): `soccer (premier league)/tabet/site_data.py`
- [XI research](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/prototypes/run_dxi.py): `soccer (premier league)/prototypes/run_dxi.py`

### Shared platform

- [Supabase storage client](https://github.com/26lenkalaa/tabet/blob/main/soccer%20(premier%20league)/tabet/supabase_storage.py): `soccer (premier league)/tabet/supabase_storage.py`
- [Read-only API](https://github.com/26lenkalaa/tabet/blob/main/backend/src/app.js): `backend/src/app.js`
- [Live caching](https://github.com/26lenkalaa/tabet/blob/main/backend/src/live.js): `backend/src/live.js`
- [Supabase repository](https://github.com/26lenkalaa/tabet/blob/main/backend/src/repo/supabase.js): `backend/src/repo/supabase.js`
- [Shared sport pages](https://github.com/26lenkalaa/tabet/blob/main/site/common.js): `site/common.js`
- [NFL page](https://github.com/26lenkalaa/tabet/blob/main/site/football.js): `site/football.js`
- [Basketball page](https://github.com/26lenkalaa/tabet/blob/main/site/basketball.js): `site/basketball.js`

### Basketball forecasts

- [Basketball API](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/api/main.py): `basketball/src/api/main.py`
- [Basketball database](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/db.py): `basketball/src/db.py`
- [Basketball prediction](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/predict.py): `basketball/src/predict.py`
- [Basketball ratings](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/models/ratings.py): `basketball/src/models/ratings.py`
- [Odds market data](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/market.py): `basketball/src/market.py`
- [Odds ingestion](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/ingest/fetch_odds.py): `basketball/src/ingest/fetch_odds.py`
- [Basketball backtesting](https://github.com/26lenkalaa/tabet/blob/main/basketball/src/backtest.py): `basketball/src/backtest.py`

### NFL forecasts

- [NFL Elo model](https://github.com/26lenkalaa/tabet/blob/main/Football/model.py): `Football/model.py`
- [NFL game data](https://github.com/26lenkalaa/tabet/blob/main/Football/data.py): `Football/data.py`
- [NFL backtesting](https://github.com/26lenkalaa/tabet/blob/main/Football/backtest.py): `Football/backtest.py`

### Other components

- **Website and API clients**

## Connections

- Match ingestion → Team identity: uses identities (evidence: `soccer (premier league)/tabet/ingest.py`)
- Player data → Team identity: uses identities (evidence: `soccer (premier league)/tabet/fpl.py`)
- Manager effects → Team identity: uses identities (evidence: `soccer (premier league)/tabet/managers.py`)
- Manager effects → Football data collector: collects data (evidence: `soccer (premier league)/tabet/managers.py`)
- Manager effects → Season cache: uses cache (evidence: `soccer (premier league)/tabet/managers.py`)
- Season cache → Supabase storage client: reads and writes (evidence: `soccer (premier league)/tabet/fd_cache.py`)
- Season cache → Player data: uses player data (evidence: `soccer (premier league)/tabet/fd_cache.py`)
- Season cache → Team identity: uses league data (evidence: `soccer (premier league)/tabet/fd_cache.py`)
- Model experiments → Match ingestion: loads matches (evidence: `soccer (premier league)/tabet/experiments.py`)
- Model experiments → Match features: builds features (evidence: `soccer (premier league)/tabet/experiments.py`)
- Model experiments → Dixon-Coles model: fits baseline (evidence: `soccer (premier league)/tabet/experiments.py`)
- Model experiments → XI research: evaluated by (evidence: `soccer (premier league)/prototypes/run_dxi.py`)
- Soccer commands → Forecasting: runs forecasts
- Forecasting → Soccer site data: exports results
- Forecasting → Market benchmark: compares odds
- Website and API clients → Read-only API: requests data (evidence: `README.md`)
- Read-only API → Live caching: uses caching (evidence: `backend/src/app.js`)
- Read-only API → Supabase repository: queries repository (evidence: `backend/src/repo/supabase.js`)
- Football data collector → Supabase storage client: stores collected data
- Basketball API → Basketball backtesting: runs backtests (evidence: `basketball/src/api/main.py`)
- Basketball API → Basketball database: accesses database (evidence: `basketball/src/api/main.py`)
- Basketball API → Odds market data: uses market data (evidence: `basketball/src/api/main.py`)
- Basketball prediction → Basketball database: reads and saves (evidence: `basketball/src/predict.py`)
- Basketball prediction → Basketball ratings: uses ratings (evidence: `basketball/src/predict.py`)
- Basketball database → Odds market data: uses market data (evidence: `basketball/src/db.py`)
- Odds ingestion → Odds market data: uses market definitions (evidence: `basketball/src/ingest/fetch_odds.py`)
- NFL Elo model → NFL game data: uses game data (evidence: `Football/model.py`)
- NFL backtesting → NFL Elo model: evaluates model (evidence: `Football/backtest.py`)
- NFL backtesting → NFL game data: loads game data (evidence: `Football/backtest.py`)
- Shared sport pages → NFL page: shared page utilities
- Website and API clients → NFL page: views page (evidence: `README.md`)
- Website and API clients → Basketball page: views page (evidence: `README.md`)
