# oulael-laabi/b2r-esports-analytics architecture

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

- Interactive diagram: https://gitdiagram.com/oulael-laabi/b2r-esports-analytics
- Repository: https://github.com/oulael-laabi/b2r-esports-analytics

## Overview

B2R is an esports performance analytics platform: staff data and match telemetry are analyzed through a Python pipeline, producing player rankings, coach analytics, weekly reports, a Power BI dashboard, and a JSON content feed. The graph distinguishes the documented stages and shared data-access layer. Some source files are unsampled, so those subsystem details are included from the README, while unsupported runtime connections are omitted.

Main entry points: [`scripts/run_pipeline.py`](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/run_pipeline.py) (Pipeline runner), [`scripts/b2r_common.py`](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/b2r_common.py) (Data access and shared logic), [`data/exports`](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/exports) (CSV and SQL exports), [`notebooks/p7_studio_sync.py`](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p7_studio_sync.py) (Studio data sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data foundation"]
  node_generator["Demo data generator"]
  node_input["Player form input"]
  node_dataset["Generated data"]
  node_mysql[("MySQL database<br/>[01_schema.sql]")]
end

subgraph group_analytics["Performance analytics"]
  node_validation["ETL validation"]
  node_match["Match analysis"]
  node_ranking["Player ranking"]
  node_coach["Coach analytics"]
end

subgraph group_delivery["Reports and outputs"]
  node_weekly["Weekly report and alerts"]
  node_sync["Studio data sync<br/>[p7_studio_sync.py]"]
  node_exports["CSV and SQL exports"]
  node_pdf["Weekly PDF reports"]
  node_json["Studio JSON feed"]
  node_dashboard["Power BI dashboard<br/>[README.md]"]
end

subgraph group_shared["Shared runtime"]
  node_pipeline["Pipeline runner<br/>[run_pipeline.py]"]
  node_common["Data access and shared logic<br/>[b2r_common.py]"]
end

node_staff(("Staff"))
node_content(("Content team"))

node_staff -->|"provides entries"| node_input
node_pipeline -->|"runs"| node_validation
node_pipeline -->|"runs"| node_match
node_pipeline -->|"runs"| node_ranking
node_pipeline -->|"runs"| node_coach
node_pipeline -->|"runs"| node_weekly
node_pipeline -->|"runs"| node_sync
node_pipeline -->|"optionally runs"| node_generator
node_generator -.->|"generates"| node_dataset
node_validation -->|"reads"| node_input
node_validation -->|"loads references"| node_common
node_match -->|"loads player data"| node_common
node_match -->|"writes analysis"| node_exports
node_ranking -->|"uses shared logic"| node_common
node_ranking -->|"reads match stats"| node_exports
node_ranking -->|"writes ranking"| node_exports
node_coach -->|"loads feedback"| node_common
node_coach -->|"reads match stats and ranking"| node_exports
node_coach -->|"writes analytics"| node_exports
node_weekly -->|"uses alert logic"| node_common
node_weekly -->|"generates"| node_pdf
node_sync -->|"loads source data"| node_common
node_sync -->|"reads ranking and match data"| node_exports
node_sync -->|"reads SQL views"| node_mysql
node_sync -->|"writes feed"| node_json
node_json -.->|"supplies content"| node_content
node_common -->|"queries when available"| node_mysql
node_common -->|"falls back to CSV"| node_dataset
node_mysql -.->|"feeds Import dashboard"| node_dashboard

click node_pipeline "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/run_pipeline.py"
click node_generator "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/generate_dataset.py"
click node_input "https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/raw"
click node_dataset "https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/generated"
click node_mysql "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/sql/01_schema.sql"
click node_common "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/b2r_common.py"
click node_validation "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p1_etl_validation.py"
click node_match "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p3_match_analysis.py"
click node_ranking "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p4_player_ranking.py"
click node_coach "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p5_coach_analytics.py"
click node_weekly "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p6_weekly_report.py"
click node_sync "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p7_studio_sync.py"
click node_exports "https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/exports"
click node_pdf "https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/outputs/reports"
click node_json "https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/outputs/studio"
click node_dashboard "https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/powerbi/README.md"

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_generator,node_input,node_dataset,node_mysql toneBlue
class node_validation,node_match,node_ranking,node_coach toneAmber
class node_weekly,node_sync,node_exports,node_pdf,node_json,node_dashboard toneMint
class node_pipeline,node_common toneRose
class node_staff,node_content toneIndigo
```

## Components

### Data foundation

- [Demo data generator](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/generate_dataset.py): `scripts/generate_dataset.py`
- [Player form input](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/raw): `data/raw`
- [Generated data](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/generated): `data/generated`
- [MySQL database](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/sql/01_schema.sql): `sql/01_schema.sql`

### Performance analytics

- [ETL validation](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p1_etl_validation.py): `notebooks/p1_etl_validation.py`
- [Match analysis](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p3_match_analysis.py): `notebooks/p3_match_analysis.py`
- [Player ranking](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p4_player_ranking.py): `notebooks/p4_player_ranking.py`
- [Coach analytics](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p5_coach_analytics.py): `notebooks/p5_coach_analytics.py`

### Reports and outputs

- [Weekly report and alerts](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p6_weekly_report.py): `notebooks/p6_weekly_report.py`
- [Studio data sync](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/notebooks/p7_studio_sync.py): `notebooks/p7_studio_sync.py`
- [CSV and SQL exports](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/data/exports): `data/exports`
- [Weekly PDF reports](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/outputs/reports): `outputs/reports`
- [Studio JSON feed](https://github.com/oulael-laabi/b2r-esports-analytics/tree/main/outputs/studio): `outputs/studio`
- [Power BI dashboard](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/powerbi/README.md): `powerbi/README.md`

### Shared runtime

- [Pipeline runner](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/run_pipeline.py): `scripts/run_pipeline.py`
- [Data access and shared logic](https://github.com/oulael-laabi/b2r-esports-analytics/blob/main/scripts/b2r_common.py): `scripts/b2r_common.py`

### Other components

- **Staff**
- **Content team**

## Connections

- Staff → Player form input: provides entries
- Pipeline runner → ETL validation: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Match analysis: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Player ranking: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Coach analytics: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Weekly report and alerts: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Studio data sync: runs (evidence: `scripts/run_pipeline.py`)
- Pipeline runner → Demo data generator: optionally runs (evidence: `scripts/run_pipeline.py`)
- Demo data generator → Generated data: generates (evidence: `README.md`)
- ETL validation → Player form input: reads (evidence: `notebooks/p1_etl_validation.py`)
- ETL validation → Data access and shared logic: loads references (evidence: `notebooks/p1_etl_validation.py`)
- Match analysis → Data access and shared logic: loads player data (evidence: `notebooks/p3_match_analysis.py`)
- Match analysis → CSV and SQL exports: writes analysis (evidence: `notebooks/p3_match_analysis.py`)
- Player ranking → Data access and shared logic: uses shared logic (evidence: `notebooks/p4_player_ranking.py`)
- Player ranking → CSV and SQL exports: reads match stats (evidence: `notebooks/p4_player_ranking.py`)
- Player ranking → CSV and SQL exports: writes ranking (evidence: `notebooks/p4_player_ranking.py`)
- Coach analytics → Data access and shared logic: loads feedback (evidence: `notebooks/p5_coach_analytics.py`)
- Coach analytics → CSV and SQL exports: reads match stats and ranking (evidence: `notebooks/p5_coach_analytics.py`)
- Coach analytics → CSV and SQL exports: writes analytics (evidence: `notebooks/p5_coach_analytics.py`)
- Weekly report and alerts → Data access and shared logic: uses alert logic (evidence: `notebooks/p6_weekly_report.py`)
- Weekly report and alerts → Weekly PDF reports: generates (evidence: `notebooks/p6_weekly_report.py`)
- Studio data sync → Data access and shared logic: loads source data (evidence: `notebooks/p7_studio_sync.py`)
- Studio data sync → CSV and SQL exports: reads ranking and match data (evidence: `notebooks/p7_studio_sync.py`)
- Studio data sync → MySQL database: reads SQL views (evidence: `notebooks/p7_studio_sync.py`)
- Studio data sync → Studio JSON feed: writes feed (evidence: `notebooks/p7_studio_sync.py`)
- Studio JSON feed → Content team: supplies content (evidence: `README.md`)
- Data access and shared logic → MySQL database: queries when available (evidence: `scripts/b2r_common.py`)
- Data access and shared logic → Generated data: falls back to CSV (evidence: `scripts/b2r_common.py`)
- MySQL database → Power BI dashboard: feeds Import dashboard (evidence: `README.md`)
