# mmrnayan/fpl-hub-v3 architecture

> Architecture diagram of the GitHub repository mmrnayan/fpl-hub-v3, 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/mmrnayan/fpl-hub-v3
- Repository: https://github.com/mmrnayan/fpl-hub-v3

## Overview

FPL-Hub is a Fantasy Premier League analytics pipeline whose main workflow collects API data, organizes season-tagged files, loads SQL staging tables, transforms them through silver and gold views, and presents a Power BI star-schema dashboard. The repository also includes player scoring and classification logic, plus DAX measures for dashboard KPIs and views. The README documents the broad pipeline and model; unsampled SQL, DAX, and orchestration details limit claims about their internal wiring.

Main entry points: [`python/data`](https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/data) (Season CSVs), [`powerbi/test2.pbix`](https://github.com/mmrnayan/fpl-hub-v3/blob/main/powerbi/test2.pbix) (FPL dashboard), [`sql/gold views`](https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/gold%20views) (Gold star schema), [`python/automation script/files to runn`](https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/automation%20script/files%20to%20runn) (API extraction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_extract["API extraction"]
  node_files[("Season CSVs")]
end

subgraph group_processing["Player analytics"]
  node_score["Player scoring<br/>[player_scores.py]"]
  node_classify["Player classification"]
end

subgraph group_warehouse["SQL warehouse"]
  node_load["SQL loading"]
  node_bronze[("Bronze staging")]
  node_silver["Silver views"]
  node_gold["Gold star schema"]
  node_fact[("Player-gameweek fact<br/>[fact table.sql]")]
  node_dimensions[("Model dimensions")]
  node_bridge[("Fixture bridge<br/>[fixture bridge.sql]")]
end

subgraph group_reporting["Power BI reporting"]
  node_dashboard["FPL dashboard<br/>[test2.pbix]"]
  node_overview["Overview KPIs"]
  node_playerdash["Player explorer<br/>[html.dax]"]
  node_seasonprep["Season comparisons"]
end

node_fpl(("FPL API"))
node_user(("Dashboard user"))

node_fpl -->|"provides API data"| node_extract
node_extract -->|"writes season files"| node_files
node_files -->|"loads CSVs"| node_load
node_load -->|"loads raw tables"| node_bronze
node_bronze -->|"feeds views"| node_silver
node_silver -->|"feeds views"| node_gold
node_gold -->|"supplies model"| node_dashboard
node_files -.->|"reads gameweek data"| node_score
node_score -.->|"writes player scores"| node_files
node_files -.->|"reads gameweek data"| node_classify
node_classify -.->|"writes classifications"| node_files
node_fact -->|"forms fact model"| node_gold
node_dimensions -->|"forms dimensional model"| node_gold
node_bridge -->|"links teams and fixtures"| node_dimensions
node_dashboard -.->|"uses measures"| node_overview
node_dashboard -.->|"uses measures"| node_playerdash
node_dashboard -.->|"uses measures"| node_seasonprep
node_user -->|"views reports"| node_dashboard

click node_extract "https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/automation%20script/files%20to%20runn"
click node_files "https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/data"
click node_score "https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/player_scores.py"
click node_classify "https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/assigning_classes.py"
click node_load "https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/sql_table_upload_script.py"
click node_bronze "https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql"
click node_silver "https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/silver%20views"
click node_gold "https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/gold%20views"
click node_fact "https://github.com/mmrnayan/fpl-hub-v3/blob/main/sql/gold%20views/fact%20table.sql"
click node_dimensions "https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/gold%20views"
click node_bridge "https://github.com/mmrnayan/fpl-hub-v3/blob/main/sql/gold%20views/fixture%20bridge.sql"
click node_dashboard "https://github.com/mmrnayan/fpl-hub-v3/blob/main/powerbi/test2.pbix"
click node_overview "https://github.com/mmrnayan/fpl-hub-v3/tree/main/dax%20snippets/overview%20page%20measures"
click node_playerdash "https://github.com/mmrnayan/fpl-hub-v3/blob/main/dax%20snippets/explore%20player%20measures/html.dax"
click node_seasonprep "https://github.com/mmrnayan/fpl-hub-v3/tree/main/dax%20snippets/pre%20season%20prep%20measures"

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_extract,node_files,node_user toneBlue
class node_score,node_classify toneAmber
class node_load,node_bronze,node_silver,node_gold,node_fact,node_dimensions,node_bridge,node_fpl toneMint
class node_dashboard,node_overview,node_playerdash,node_seasonprep toneRose
```

## Components

### Data collection

- [API extraction](https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/automation%20script/files%20to%20runn): `python/automation script/files to runn`
- [Season CSVs](https://github.com/mmrnayan/fpl-hub-v3/tree/main/python/data): `python/data`

### Player analytics

- [Player scoring](https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/player_scores.py): `python/automation script/files to runn/player_scores.py`
- [Player classification](https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/assigning_classes.py): `python/automation script/files to runn/assigning_classes.py`

### SQL warehouse

- [SQL loading](https://github.com/mmrnayan/fpl-hub-v3/blob/main/python/automation%20script/files%20to%20runn/sql_table_upload_script.py): `python/automation script/files to runn/sql_table_upload_script.py`
- [Bronze staging](https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql): `sql`
- [Silver views](https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/silver%20views): `sql/silver views`
- [Gold star schema](https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/gold%20views): `sql/gold views`
- [Player-gameweek fact](https://github.com/mmrnayan/fpl-hub-v3/blob/main/sql/gold%20views/fact%20table.sql): `sql/gold views/fact table.sql`
- [Model dimensions](https://github.com/mmrnayan/fpl-hub-v3/tree/main/sql/gold%20views): `sql/gold views`
- [Fixture bridge](https://github.com/mmrnayan/fpl-hub-v3/blob/main/sql/gold%20views/fixture%20bridge.sql): `sql/gold views/fixture bridge.sql`

### Power BI reporting

- [FPL dashboard](https://github.com/mmrnayan/fpl-hub-v3/blob/main/powerbi/test2.pbix): `powerbi/test2.pbix`
- [Overview KPIs](https://github.com/mmrnayan/fpl-hub-v3/tree/main/dax%20snippets/overview%20page%20measures): `dax snippets/overview page measures`
- [Player explorer](https://github.com/mmrnayan/fpl-hub-v3/blob/main/dax%20snippets/explore%20player%20measures/html.dax): `dax snippets/explore player measures/html.dax`
- [Season comparisons](https://github.com/mmrnayan/fpl-hub-v3/tree/main/dax%20snippets/pre%20season%20prep%20measures): `dax snippets/pre season prep measures`

### Other components

- **FPL API**
- **Dashboard user**

## Connections

- FPL API → API extraction: provides API data (evidence: `README.md`)
- API extraction → Season CSVs: writes season files (evidence: `README.md`)
- Season CSVs → SQL loading: loads CSVs (evidence: `README.md`)
- SQL loading → Bronze staging: loads raw tables (evidence: `README.md`)
- Bronze staging → Silver views: feeds views (evidence: `README.md`)
- Silver views → Gold star schema: feeds views (evidence: `README.md`)
- Gold star schema → FPL dashboard: supplies model (evidence: `README.md`)
- Season CSVs → Player scoring: reads gameweek data
- Player scoring → Season CSVs: writes player scores
- Season CSVs → Player classification: reads gameweek data
- Player classification → Season CSVs: writes classifications
- Player-gameweek fact → Gold star schema: forms fact model (evidence: `README.md`)
- Model dimensions → Gold star schema: forms dimensional model (evidence: `README.md`)
- Fixture bridge → Model dimensions: links teams and fixtures (evidence: `README.md`)
- FPL dashboard → Overview KPIs: uses measures
- FPL dashboard → Player explorer: uses measures
- FPL dashboard → Season comparisons: uses measures
- Dashboard user → FPL dashboard: views reports (evidence: `README.md`)
