# artemakulov526/wnba_predictor architecture

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

- Interactive diagram: https://gitdiagram.com/artemakulov526/wnba_predictor
- Repository: https://github.com/artemakulov526/wnba_predictor

## Overview

This is a WNBA forecasting and betting-analysis product. Data collection and official injury reporting feed stored team and player game records; trained game and prop models produce matchup probabilities, player projections, and playoff odds. The web app exposes team information and matchup predictions, while separate game- and prop-pick logs preserve pregame views for later grading against results and market lines. The graph preserves README capabilities even where implementation details were not sampled; those branches are connected only where the README or source references support the relationship.

Main entry points: [`wnba/db.py`](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/db.py) (Database access), [`wnba/ml/predict.py`](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/predict.py) (Game predictions), [`wnba/ml/props.py`](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/props.py) (Player props), [`wnba/ml/train.py`](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/train.py) (Game model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_scrape_games["Team game data"]
  node_scrape_players["Player game logs<br/>[player_logs.py]"]
  node_scrape_injuries["Injury reports"]
  node_scrape_espn_injuries["ESPN injuries<br/>[injuries.py]"]
  node_scrape_market["Closing lines<br/>[teamrankings.py]"]
end

subgraph group_storage["Data and storage"]
  node_db_access["Database access<br/>[db.py]"]
  node_entities["Sports records<br/>[models.py]"]
end

subgraph group_forecasting["Forecasting"]
  node_features["Game features<br/>[features.py]"]
  node_elo["Elo ratings<br/>[elo.py]"]
  node_train["Game model training<br/>[train.py]"]
  node_predict["Game predictions<br/>[predict.py]"]
  node_rotation["Player rotation<br/>[rotation.py]"]
  node_props["Player props<br/>[props.py]"]
  node_totals["Game totals<br/>[totals.py]"]
  node_series["Playoff odds<br/>[series.py]"]
end

subgraph group_tracking["Tracking and markets"]
  node_market_model["Market analysis<br/>[market.py]"]
  node_game_log["Game pick tracking<br/>[tracking.py]"]
  node_prop_log["Prop tracking<br/>[props_log.py]"]
  node_saved_lines["Saved lines<br/>[saved_lines.py]"]
end

subgraph group_web["Web app"]
  node_web_app["FastAPI app<br/>[app.py]"]
  node_templates["Team pages"]
end

node_operator(("Operator"))
node_sports_sources(("Sports data sources"))
node_postgres[("PostgreSQL")]

node_operator -->|"runs ingestion"| node_scrape_games
node_operator -->|"runs ingestion"| node_scrape_players
node_operator -->|"runs ingestion"| node_scrape_injuries
node_operator -->|"runs ingestion"| node_scrape_market
node_sports_sources -->|"provides data"| node_scrape_games
node_sports_sources -->|"provides data"| node_scrape_players
node_sports_sources -->|"provides reports"| node_scrape_injuries
node_sports_sources -->|"provides lines"| node_scrape_market
node_scrape_games -->|"stores records"| node_db_access
node_scrape_players -->|"stores logs"| node_db_access
node_scrape_injuries -->|"supplements with"| node_scrape_espn_injuries
node_scrape_market -.->|"saves lines"| node_saved_lines
node_db_access -->|"connects to"| node_postgres
node_entities -->|"uses base"| node_db_access
node_features -->|"uses ratings"| node_elo
node_train -->|"builds features"| node_features
node_train -->|"loads data"| node_db_access
node_train -->|"uses ratings"| node_elo
node_predict -->|"builds features"| node_features
node_predict -->|"uses ratings"| node_elo
node_predict -->|"loads trained model"| node_train
node_predict -->|"loads data"| node_db_access
node_predict -->|"uses availability"| node_rotation
node_predict -->|"reads reports"| node_scrape_injuries
node_props -->|"loads logs"| node_db_access
node_props -->|"uses minutes"| node_rotation
node_props -->|"uses totals"| node_totals
node_props -->|"reads reports"| node_scrape_injuries
node_series -->|"uses probabilities"| node_predict
node_series -->|"loads data"| node_db_access
node_market_model -->|"uses features"| node_features
node_market_model -->|"uses evaluation"| node_train
node_market_model -->|"reads closing lines"| node_scrape_market
node_game_log -->|"records predictions"| node_predict
node_game_log -->|"loads results"| node_db_access
node_prop_log -->|"records projections"| node_props
node_prop_log -->|"uses tracking"| node_game_log
node_prop_log -->|"loads data"| node_db_access
node_saved_lines -->|"uses database"| node_db_access
node_saved_lines -->|"updates prop lines"| node_prop_log
node_operator -->|"uses app"| node_web_app
node_web_app -->|"requests prediction"| node_predict
node_web_app -->|"queries records"| node_db_access
node_web_app -->|"renders pages"| node_templates

click node_scrape_games "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/basketball_reference.py"
click node_scrape_players "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/player_logs.py"
click node_scrape_injuries "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/official_injuries.py"
click node_scrape_espn_injuries "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/injuries.py"
click node_scrape_market "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/teamrankings.py"
click node_db_access "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/db.py"
click node_entities "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/models.py"
click node_features "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/features.py"
click node_elo "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/elo.py"
click node_train "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/train.py"
click node_predict "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/predict.py"
click node_rotation "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/rotation.py"
click node_props "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/props.py"
click node_totals "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/totals.py"
click node_series "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/series.py"
click node_market_model "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/market.py"
click node_game_log "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/tracking.py"
click node_prop_log "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/props_log.py"
click node_saved_lines "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/saved_lines.py"
click node_web_app "https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/web/app.py"
click node_templates "https://github.com/artemakulov526/wnba_predictor/tree/main/wnba/web/templates"

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_scrape_games,node_scrape_players,node_scrape_injuries,node_scrape_espn_injuries,node_scrape_market toneBlue
class node_db_access,node_entities,node_postgres toneAmber
class node_features,node_elo,node_train,node_predict,node_rotation,node_props,node_totals,node_series toneMint
class node_market_model,node_game_log,node_prop_log,node_saved_lines toneRose
class node_web_app,node_templates,node_operator,node_sports_sources toneIndigo
```

## Components

### Data collection

- [Team game data](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/basketball_reference.py): `wnba/scraping/basketball_reference.py`
- [Player game logs](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/player_logs.py): `wnba/scraping/player_logs.py`
- [Injury reports](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/official_injuries.py): `wnba/scraping/official_injuries.py`
- [ESPN injuries](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/injuries.py): `wnba/scraping/injuries.py`
- [Closing lines](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/teamrankings.py): `wnba/scraping/teamrankings.py`

### Data and storage

- [Database access](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/db.py): `wnba/db.py`
- [Sports records](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/models.py): `wnba/models.py`

### Forecasting

- [Game features](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/features.py): `wnba/ml/features.py`
- [Elo ratings](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/elo.py): `wnba/ml/elo.py`
- [Game model training](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/train.py): `wnba/ml/train.py`
- [Game predictions](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/predict.py): `wnba/ml/predict.py`
- [Player rotation](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/rotation.py): `wnba/ml/rotation.py`
- [Player props](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/props.py): `wnba/ml/props.py`
- [Game totals](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/totals.py): `wnba/ml/totals.py`
- [Playoff odds](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/series.py): `wnba/ml/series.py`

### Tracking and markets

- [Market analysis](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/market.py): `wnba/ml/market.py`
- [Game pick tracking](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/tracking.py): `wnba/ml/tracking.py`
- [Prop tracking](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/ml/props_log.py): `wnba/ml/props_log.py`
- [Saved lines](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/scraping/saved_lines.py): `wnba/scraping/saved_lines.py`

### Web app

- [FastAPI app](https://github.com/artemakulov526/wnba_predictor/blob/main/wnba/web/app.py): `wnba/web/app.py`
- [Team pages](https://github.com/artemakulov526/wnba_predictor/tree/main/wnba/web/templates): `wnba/web/templates`

### Other components

- **Operator**
- **Sports data sources**
- **PostgreSQL**

## Connections

- Operator → Team game data: runs ingestion (evidence: `README.md`)
- Operator → Player game logs: runs ingestion (evidence: `README.md`)
- Operator → Injury reports: runs ingestion (evidence: `README.md`)
- Operator → Closing lines: runs ingestion (evidence: `README.md`)
- Sports data sources → Team game data: provides data (evidence: `README.md`)
- Sports data sources → Player game logs: provides data (evidence: `README.md`)
- Sports data sources → Injury reports: provides reports (evidence: `README.md`)
- Sports data sources → Closing lines: provides lines (evidence: `README.md`)
- Team game data → Database access: stores records (evidence: `wnba/scraping/basketball_reference.py`)
- Player game logs → Database access: stores logs (evidence: `wnba/scraping/player_logs.py`)
- Injury reports → ESPN injuries: supplements with (evidence: `wnba/scraping/official_injuries.py`)
- Closing lines → Saved lines: saves lines
- Database access → PostgreSQL: connects to (evidence: `wnba/db.py`)
- Sports records → Database access: uses base (evidence: `wnba/models.py`)
- Game features → Elo ratings: uses ratings (evidence: `wnba/ml/features.py`)
- Game model training → Game features: builds features (evidence: `wnba/ml/train.py`)
- Game model training → Database access: loads data (evidence: `wnba/ml/train.py`)
- Game model training → Elo ratings: uses ratings (evidence: `wnba/ml/train.py`)
- Game predictions → Game features: builds features (evidence: `wnba/ml/predict.py`)
- Game predictions → Elo ratings: uses ratings (evidence: `wnba/ml/predict.py`)
- Game predictions → Game model training: loads trained model (evidence: `wnba/ml/predict.py`)
- Game predictions → Database access: loads data (evidence: `wnba/ml/predict.py`)
- Game predictions → Player rotation: uses availability (evidence: `wnba/ml/predict.py`)
- Game predictions → Injury reports: reads reports (evidence: `wnba/ml/predict.py`)
- Player props → Database access: loads logs (evidence: `wnba/ml/props.py`)
- Player props → Player rotation: uses minutes (evidence: `wnba/ml/props.py`)
- Player props → Game totals: uses totals (evidence: `wnba/ml/props.py`)
- Player props → Injury reports: reads reports (evidence: `wnba/ml/props.py`)
- Playoff odds → Game predictions: uses probabilities (evidence: `wnba/ml/series.py`)
- Playoff odds → Database access: loads data (evidence: `wnba/ml/series.py`)
- Market analysis → Game features: uses features (evidence: `wnba/ml/market.py`)
- Market analysis → Game model training: uses evaluation (evidence: `wnba/ml/market.py`)
- Market analysis → Closing lines: reads closing lines (evidence: `wnba/ml/market.py`)
- Game pick tracking → Game predictions: records predictions (evidence: `wnba/ml/tracking.py`)
- Game pick tracking → Database access: loads results (evidence: `wnba/ml/tracking.py`)
- Prop tracking → Player props: records projections (evidence: `wnba/ml/props_log.py`)
- Prop tracking → Game pick tracking: uses tracking (evidence: `wnba/ml/props_log.py`)
- Prop tracking → Database access: loads data (evidence: `wnba/ml/props_log.py`)
- Saved lines → Database access: uses database (evidence: `wnba/scraping/saved_lines.py`)
- Saved lines → Prop tracking: updates prop lines (evidence: `wnba/scraping/saved_lines.py`)
- Operator → FastAPI app: uses app (evidence: `README.md`)
- FastAPI app → Game predictions: requests prediction (evidence: `wnba/web/app.py`)
- FastAPI app → Database access: queries records (evidence: `wnba/web/app.py`)
- FastAPI app → Team pages: renders pages (evidence: `wnba/web/app.py`)
