# ahmadnasser5/scout-egyptian-league-players architecture

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

- Interactive diagram: https://gitdiagram.com/ahmadnasser5/scout-egyptian-league-players
- Repository: https://github.com/ahmadnasser5/scout-egyptian-league-players

## Overview

Touchline is an Egyptian League scouting product: FotMob statistics are collected and analyzed into player, role, similarity, and rating data, which the API serves to a React scouting interface. The main user journey loads the league snapshot, lets a scout search and filter players, then inspect profiles, role-peer metrics, similar players, and comparisons. The repository also includes a scheduled-data-refresh workflow and archived matchday snapshots. Notebook internals are not sampled; their stages and ordering are represented only where the README or refresh script documents them.

Main entry points: [`scripts/refresh_data.py`](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/scripts/refresh_data.py) (Refresh runner), [`notebooks/04_feature_engineering.ipynb`](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/04_feature_engineering.ipynb) (Feature engineering), [`notebooks/06_clustering.ipynb`](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/06_clustering.ipynb) (Role clustering), [`notebooks/Untitled0.ipynb`](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/Untitled0.ipynb) (Dataset export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Scouting analysis"]
  node_cleaning["Data cleaning"]
  node_features["Feature engineering"]
  node_similarity["Player similarity"]
  node_clustering["Role clustering"]
  node_rating_models["Rating models"]
  node_export["Dataset export<br/>[Untitled0.ipynb]"]
  node_snapshot[("Current dataset")]
end

subgraph group_refresh["Data refresh"]
  node_scraper["FotMob scraping<br/>[scrap.ipynb]"]
  node_refresh_runner["Refresh runner<br/>[refresh_data.py]"]
end

subgraph group_backend["Serving layer"]
  node_api["Scouting API<br/>[Program.cs]"]
end

subgraph group_frontend["Scouting interface"]
  node_webapp["Scouting experience<br/>[main.jsx]"]
end

node_scout(("Scout"))
node_fotmob(("FotMob statistics"))

node_refresh_runner -->|"executes fetch"| node_scraper
node_fotmob -.->|"supplies statistics"| node_scraper
node_refresh_runner -->|"runs notebook"| node_cleaning
node_refresh_runner -->|"runs notebook"| node_features
node_refresh_runner -->|"runs notebook"| node_clustering
node_refresh_runner -->|"runs notebook"| node_export
node_cleaning -->|"precedes"| node_features
node_features -->|"precedes"| node_clustering
node_clustering -->|"precedes"| node_export
node_refresh_runner -.->|"supports analysis"| node_similarity
node_refresh_runner -.->|"supports analysis"| node_rating_models
node_export -->|"exports dataset"| node_snapshot
node_api -->|"reads JSON"| node_snapshot
node_webapp -->|"fetches data"| node_api
node_scout -->|"explores players"| node_webapp

click node_scraper "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/scrap_data/scrap.ipynb"
click node_refresh_runner "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/scripts/refresh_data.py"
click node_cleaning "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/02_data_cleaning.ipynb"
click node_features "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/04_feature_engineering.ipynb"
click node_similarity "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/05_similarity.ipynb"
click node_clustering "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/06_clustering.ipynb"
click node_rating_models "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/07_rating_models.ipynb"
click node_export "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/Untitled0.ipynb"
click node_snapshot "https://github.com/ahmadnasser5/scout-egyptian-league-players/tree/main/data/latest"
click node_api "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/api/Program.cs"
click node_webapp "https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/web/src/main.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_cleaning,node_features,node_similarity,node_clustering,node_rating_models,node_export,node_snapshot toneBlue
class node_scraper,node_refresh_runner toneAmber
class node_api toneMint
class node_webapp toneRose
class node_scout,node_fotmob toneIndigo
```

## Components

### Scouting analysis

- [Data cleaning](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/02_data_cleaning.ipynb): `notebooks/02_data_cleaning.ipynb`
- [Feature engineering](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/04_feature_engineering.ipynb): `notebooks/04_feature_engineering.ipynb`
- [Player similarity](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/05_similarity.ipynb): `notebooks/05_similarity.ipynb`
- [Role clustering](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/06_clustering.ipynb): `notebooks/06_clustering.ipynb`
- [Rating models](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/07_rating_models.ipynb): `notebooks/07_rating_models.ipynb`
- [Dataset export](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/notebooks/Untitled0.ipynb): `notebooks/Untitled0.ipynb`
- [Current dataset](https://github.com/ahmadnasser5/scout-egyptian-league-players/tree/main/data/latest): `data/latest`

### Data refresh

- [FotMob scraping](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/scrap_data/scrap.ipynb): `scrap_data/scrap.ipynb`
- [Refresh runner](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/scripts/refresh_data.py): `scripts/refresh_data.py`

### Serving layer

- [Scouting API](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/api/Program.cs): `api/Program.cs`

### Scouting interface

- [Scouting experience](https://github.com/ahmadnasser5/scout-egyptian-league-players/blob/main/web/src/main.jsx): `web/src/main.jsx`

### Other components

- **Scout**
- **FotMob statistics**

## Connections

- Refresh runner → FotMob scraping: executes fetch (evidence: `scripts/refresh_data.py`)
- FotMob statistics → FotMob scraping: supplies statistics
- Refresh runner → Data cleaning: runs notebook (evidence: `scripts/refresh_data.py`)
- Refresh runner → Feature engineering: runs notebook (evidence: `scripts/refresh_data.py`)
- Refresh runner → Role clustering: runs notebook (evidence: `scripts/refresh_data.py`)
- Refresh runner → Dataset export: runs notebook (evidence: `scripts/refresh_data.py`)
- Data cleaning → Feature engineering: precedes (evidence: `README.md`)
- Feature engineering → Role clustering: precedes (evidence: `README.md`)
- Role clustering → Dataset export: precedes (evidence: `README.md`)
- Refresh runner → Player similarity: supports analysis
- Refresh runner → Rating models: supports analysis
- Dataset export → Current dataset: exports dataset (evidence: `README.md`)
- Scouting API → Current dataset: reads JSON (evidence: `api/Program.cs`)
- Scouting experience → Scouting API: fetches data (evidence: `web/src/main.jsx`)
- Scout → Scouting experience: explores players (evidence: `web/src/main.jsx`)
