# vedanshprakash/ipl-analytics-pro architecture

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

- Interactive diagram: https://gitdiagram.com/vedanshprakash/ipl-analytics-pro
- Repository: https://github.com/vedanshprakash/ipl-analytics-pro

## Overview

IPL Analytics Pro turns Cricsheet ball-by-ball data into a normalized warehouse, analytics and a live win-probability model, served through FastAPI to a React dashboard. The graph preserves documented analytics branches as well as the main dashboard workflow. Some pipeline and SQL relationships are README-documented rather than source-excerpted; those edges cite the README.

Main entry points: [`frontend/src/App.jsx`](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/App.jsx) (Dashboard app), [`data`](https://github.com/vedanshprakash/ipl-analytics-pro/tree/main/data) (SQLite warehouse), [`etl/convert_cricsheet.py`](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/convert_cricsheet.py) (CSV converter), [`etl/build_warehouse.py`](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/build_warehouse.py) (Warehouse ETL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_converter["CSV converter"]
  node_match_csv["Match records<br/>[matches.csv]"]
  node_delivery_csv["Delivery records<br/>[deliveries.csv]"]
  node_warehouse_builder["Warehouse ETL<br/>[build_warehouse.py]"]
  node_warehouse[("SQLite warehouse")]
end

subgraph group_analytics["Analytics and prediction"]
  node_sql_analytics["Advanced SQL"]
  node_training_data["Training data builder"]
  node_model_trainer["Win model training"]
  node_model_artifacts[("Model and metrics")]
end

subgraph group_service["API service"]
  node_api["Analytics and prediction API<br/>[main.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_app_entry["React entry<br/>[main.jsx]"]
  node_app["Dashboard app<br/>[App.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_team_view["Team leaderboard"]
  node_player_view["Player leaderboards"]
  node_venue_view["Venue chart<br/>[VenueChart.jsx]"]
  node_champion_view["Season champions"]
  node_predictor_view["Win simulator"]
  node_seam_divider["Seam divider<br/>[SeamDivider.jsx]"]
end

node_cricsheet[("Cricsheet archive")]
node_browser_user(("Dashboard user"))

node_cricsheet -->|"provides archive"| node_converter
node_converter -->|"writes records"| node_match_csv
node_converter -->|"writes deliveries"| node_delivery_csv
node_match_csv -->|"loads matches"| node_warehouse_builder
node_delivery_csv -->|"loads deliveries"| node_warehouse_builder
node_warehouse_builder -->|"builds tables"| node_warehouse
node_warehouse -->|"supports queries"| node_sql_analytics
node_warehouse -->|"supplies data"| node_training_data
node_training_data -->|"prepares features"| node_model_trainer
node_model_trainer -->|"saves model"| node_model_artifacts
node_warehouse -->|"serves analytics"| node_api
node_model_artifacts -->|"loads predictor"| node_api
node_browser_user -.->|"opens dashboard"| node_app_entry
node_app_entry -->|"renders"| node_app
node_app -->|"requests data"| node_api_client
node_api_client -->|"calls endpoints"| node_api
node_app -->|"renders results"| node_team_view
node_app -->|"renders results"| node_player_view
node_app -->|"renders results"| node_venue_view
node_app -->|"renders results"| node_champion_view
node_app -->|"renders simulator"| node_predictor_view
node_predictor_view -->|"submits prediction"| node_api_client
node_app -->|"renders divider"| node_seam_divider

click node_converter "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/convert_cricsheet.py"
click node_match_csv "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/data/matches.csv"
click node_delivery_csv "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/data/deliveries.csv"
click node_warehouse_builder "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/build_warehouse.py"
click node_warehouse "https://github.com/vedanshprakash/ipl-analytics-pro/tree/main/data"
click node_sql_analytics "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/sql/advanced_analytics.sql"
click node_training_data "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/ml/build_training_data.py"
click node_model_trainer "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/ml/train_win_predictor.py"
click node_model_artifacts "https://github.com/vedanshprakash/ipl-analytics-pro/tree/main/ml/models"
click node_api "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/api/main.py"
click node_app_entry "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/main.jsx"
click node_app "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/api/client.js"
click node_team_view "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/TeamLeaderboard.jsx"
click node_player_view "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/PlayerLeaderboard.jsx"
click node_venue_view "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/VenueChart.jsx"
click node_champion_view "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/SeasonChampions.jsx"
click node_predictor_view "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/WinProbabilitySimulator.jsx"
click node_seam_divider "https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/SeamDivider.jsx"

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_converter,node_match_csv,node_delivery_csv,node_warehouse_builder,node_warehouse,node_browser_user toneBlue
class node_sql_analytics,node_training_data,node_model_trainer,node_model_artifacts,node_cricsheet toneAmber
class node_api toneMint
class node_app_entry,node_app,node_api_client,node_team_view,node_player_view,node_venue_view,node_champion_view,node_predictor_view,node_seam_divider toneRose
```

## Components

### Data preparation

- [CSV converter](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/convert_cricsheet.py): `etl/convert_cricsheet.py`
- [Match records](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/data/matches.csv): `data/matches.csv`
- [Delivery records](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/data/deliveries.csv): `data/deliveries.csv`
- [Warehouse ETL](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/etl/build_warehouse.py): `etl/build_warehouse.py`
- [SQLite warehouse](https://github.com/vedanshprakash/ipl-analytics-pro/tree/main/data): `data`

### Analytics and prediction

- [Advanced SQL](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/sql/advanced_analytics.sql): `sql/advanced_analytics.sql`
- [Training data builder](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/ml/build_training_data.py): `ml/build_training_data.py`
- [Win model training](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/ml/train_win_predictor.py): `ml/train_win_predictor.py`
- [Model and metrics](https://github.com/vedanshprakash/ipl-analytics-pro/tree/main/ml/models): `ml/models`

### API service

- [Analytics and prediction API](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/api/main.py): `api/main.py`

### Dashboard

- [React entry](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Dashboard app](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Team leaderboard](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/TeamLeaderboard.jsx): `frontend/src/components/TeamLeaderboard.jsx`
- [Player leaderboards](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/PlayerLeaderboard.jsx): `frontend/src/components/PlayerLeaderboard.jsx`
- [Venue chart](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/VenueChart.jsx): `frontend/src/components/VenueChart.jsx`
- [Season champions](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/SeasonChampions.jsx): `frontend/src/components/SeasonChampions.jsx`
- [Win simulator](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/WinProbabilitySimulator.jsx): `frontend/src/components/WinProbabilitySimulator.jsx`
- [Seam divider](https://github.com/vedanshprakash/ipl-analytics-pro/blob/main/frontend/src/components/SeamDivider.jsx): `frontend/src/components/SeamDivider.jsx`

### Other components

- **Cricsheet archive**
- **Dashboard user**

## Connections

- Cricsheet archive → CSV converter: provides archive (evidence: `README.md`)
- CSV converter → Match records: writes records (evidence: `README.md`)
- CSV converter → Delivery records: writes deliveries (evidence: `README.md`)
- Match records → Warehouse ETL: loads matches (evidence: `README.md`)
- Delivery records → Warehouse ETL: loads deliveries (evidence: `README.md`)
- Warehouse ETL → SQLite warehouse: builds tables (evidence: `etl/build_warehouse.py`)
- SQLite warehouse → Advanced SQL: supports queries (evidence: `README.md`)
- SQLite warehouse → Training data builder: supplies data (evidence: `README.md`)
- Training data builder → Win model training: prepares features (evidence: `README.md`)
- Win model training → Model and metrics: saves model (evidence: `README.md`)
- SQLite warehouse → Analytics and prediction API: serves analytics (evidence: `api/main.py`)
- Model and metrics → Analytics and prediction API: loads predictor (evidence: `api/main.py`)
- Dashboard user → React entry: opens dashboard
- React entry → Dashboard app: renders (evidence: `frontend/src/main.jsx`)
- Dashboard app → API client: requests data (evidence: `frontend/src/App.jsx`)
- API client → Analytics and prediction API: calls endpoints (evidence: `README.md`)
- Dashboard app → Team leaderboard: renders results (evidence: `frontend/src/App.jsx`)
- Dashboard app → Player leaderboards: renders results (evidence: `frontend/src/App.jsx`)
- Dashboard app → Venue chart: renders results (evidence: `frontend/src/App.jsx`)
- Dashboard app → Season champions: renders results (evidence: `frontend/src/App.jsx`)
- Dashboard app → Win simulator: renders simulator (evidence: `frontend/src/App.jsx`)
- Win simulator → API client: submits prediction (evidence: `frontend/src/components/WinProbabilitySimulator.jsx`)
- Dashboard app → Seam divider: renders divider (evidence: `frontend/src/App.jsx`)
