# aathi-11/sna_case_study architecture

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

- Interactive diagram: https://gitdiagram.com/aathi-11/sna_case_study
- Repository: https://github.com/aathi-11/sna_case_study

## Overview

This repository is a football passing-network research and scouting application built around StatsBomb match events. Its main workflow prepares and truncates match data, builds directed player-passing graphs, computes team/player metrics and communities, then supports comparisons, visualizations and opposition reports. A separate dashboard path exports processed datasets to JSON for browser-based exploration. The README documents the analytical stages and capabilities; sampled code confirms several implementations, but not every connection between analysis modules or the dashboard frontend’s data loading.

Main entry points: [`src/graphs.py`](https://github.com/aathi-11/sna_case_study/blob/main/src/graphs.py) (Passing graphs), [`src/metrics.py`](https://github.com/aathi-11/sna_case_study/blob/main/src/metrics.py) (Network metrics), [`src/communities.py`](https://github.com/aathi-11/sna_case_study/blob/main/src/communities.py) (Community detection), [`src/export_dashboard_data.py`](https://github.com/aathi-11/sna_case_study/blob/main/src/export_dashboard_data.py) (Dashboard export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_prep["Event preparation<br/>[data_prep.py]"]
  node_rawdata[("Cached match data")]
  node_processed[("Processed datasets")]
end

subgraph group_analysis["Network analysis"]
  node_graphs["Passing graphs<br/>[graphs.py]"]
  node_metrics["Network metrics<br/>[metrics.py]"]
  node_communities["Community detection<br/>[communities.py]"]
end

subgraph group_research["Research extensions"]
  node_comparisons["Statistical comparisons<br/>[comparisons.py]"]
  node_blockmodeling["Block modeling<br/>[blockmodeling.py]"]
  node_weak_ties["Weak-tie analysis<br/>[weak_ties.py]"]
  node_plots["Pitch visualizations<br/>[plots.py]"]
end

subgraph group_scouting["Scouting outputs"]
  node_scouting["Scouting reports<br/>[scouting.py]"]
end

subgraph group_dashboard["Interactive dashboard"]
  node_dashboard_export["Dashboard export"]
  node_launcher["Dashboard launcher<br/>[run_dashboard.py]"]
  node_webserver["Local web server<br/>[run_dashboard.py]"]
  node_webui["Interactive dashboard<br/>[app.js]"]
  node_dashboard_data["Dashboard JSON"]
end

node_statsbomb(("StatsBomb data"))

node_statsbomb -->|"supplies events"| node_prep
node_prep -->|"caches data"| node_rawdata
node_rawdata -->|"builds from"| node_graphs
node_graphs -->|"supports metrics"| node_metrics
node_graphs -->|"supports detection"| node_communities
node_metrics -->|"feeds comparisons"| node_comparisons
node_communities -->|"classifies passes"| node_weak_ties
node_graphs -->|"builds team graph"| node_weak_ties
node_graphs -->|"builds team graph"| node_plots
node_communities -->|"colors communities"| node_plots
node_metrics -->|"measures fragility"| node_plots
node_graphs -->|"builds team graph"| node_scouting
node_metrics -->|"measures vulnerability"| node_scouting
node_communities -->|"summarizes structure"| node_scouting
node_processed -->|"aggregates datasets"| node_dashboard_export
node_dashboard_export -->|"writes JSON"| node_dashboard_data
node_launcher -->|"runs if missing"| node_dashboard_export
node_launcher -->|"starts server"| node_webserver
node_webserver -->|"serves dashboard"| node_webui
node_webui -.->|"loads data"| node_dashboard_data

click node_prep "https://github.com/aathi-11/sna_case_study/blob/main/src/data_prep.py"
click node_rawdata "https://github.com/aathi-11/sna_case_study/tree/main/data/raw"
click node_graphs "https://github.com/aathi-11/sna_case_study/blob/main/src/graphs.py"
click node_processed "https://github.com/aathi-11/sna_case_study/tree/main/data/processed"
click node_metrics "https://github.com/aathi-11/sna_case_study/blob/main/src/metrics.py"
click node_communities "https://github.com/aathi-11/sna_case_study/blob/main/src/communities.py"
click node_comparisons "https://github.com/aathi-11/sna_case_study/blob/main/src/comparisons.py"
click node_blockmodeling "https://github.com/aathi-11/sna_case_study/blob/main/src/blockmodeling.py"
click node_weak_ties "https://github.com/aathi-11/sna_case_study/blob/main/src/weak_ties.py"
click node_plots "https://github.com/aathi-11/sna_case_study/blob/main/src/plots.py"
click node_scouting "https://github.com/aathi-11/sna_case_study/blob/main/src/scouting.py"
click node_dashboard_export "https://github.com/aathi-11/sna_case_study/blob/main/src/export_dashboard_data.py"
click node_launcher "https://github.com/aathi-11/sna_case_study/blob/main/run_dashboard.py"
click node_webserver "https://github.com/aathi-11/sna_case_study/blob/main/run_dashboard.py"
click node_webui "https://github.com/aathi-11/sna_case_study/blob/main/dashboard/app.js"
click node_dashboard_data "https://github.com/aathi-11/sna_case_study/blob/main/dashboard/data/dashboard_data.json"

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_prep,node_rawdata,node_processed toneBlue
class node_graphs,node_metrics,node_communities toneAmber
class node_comparisons,node_blockmodeling,node_weak_ties,node_plots toneMint
class node_scouting toneRose
class node_dashboard_export,node_launcher,node_webserver,node_webui,node_dashboard_data,node_statsbomb toneIndigo
```

## Components

### Data preparation

- [Event preparation](https://github.com/aathi-11/sna_case_study/blob/main/src/data_prep.py): `src/data_prep.py`
- [Cached match data](https://github.com/aathi-11/sna_case_study/tree/main/data/raw): `data/raw`
- [Processed datasets](https://github.com/aathi-11/sna_case_study/tree/main/data/processed): `data/processed`

### Network analysis

- [Passing graphs](https://github.com/aathi-11/sna_case_study/blob/main/src/graphs.py): `src/graphs.py`
- [Network metrics](https://github.com/aathi-11/sna_case_study/blob/main/src/metrics.py): `src/metrics.py`
- [Community detection](https://github.com/aathi-11/sna_case_study/blob/main/src/communities.py): `src/communities.py`

### Research extensions

- [Statistical comparisons](https://github.com/aathi-11/sna_case_study/blob/main/src/comparisons.py): `src/comparisons.py`
- [Block modeling](https://github.com/aathi-11/sna_case_study/blob/main/src/blockmodeling.py): `src/blockmodeling.py`
- [Weak-tie analysis](https://github.com/aathi-11/sna_case_study/blob/main/src/weak_ties.py): `src/weak_ties.py`
- [Pitch visualizations](https://github.com/aathi-11/sna_case_study/blob/main/src/plots.py): `src/plots.py`

### Scouting outputs

- [Scouting reports](https://github.com/aathi-11/sna_case_study/blob/main/src/scouting.py): `src/scouting.py`

### Interactive dashboard

- [Dashboard export](https://github.com/aathi-11/sna_case_study/blob/main/src/export_dashboard_data.py): `src/export_dashboard_data.py`
- [Dashboard launcher](https://github.com/aathi-11/sna_case_study/blob/main/run_dashboard.py): `run_dashboard.py`
- [Local web server](https://github.com/aathi-11/sna_case_study/blob/main/run_dashboard.py): `run_dashboard.py`
- [Interactive dashboard](https://github.com/aathi-11/sna_case_study/blob/main/dashboard/app.js): `dashboard/app.js`
- [Dashboard JSON](https://github.com/aathi-11/sna_case_study/blob/main/dashboard/data/dashboard_data.json): `dashboard/data/dashboard_data.json`

### Other components

- **StatsBomb data**

## Connections

- StatsBomb data → Event preparation: supplies events (evidence: `README.md`)
- Event preparation → Cached match data: caches data (evidence: `README.md`)
- Cached match data → Passing graphs: builds from (evidence: `README.md`)
- Passing graphs → Network metrics: supports metrics (evidence: `README.md`)
- Passing graphs → Community detection: supports detection (evidence: `README.md`)
- Network metrics → Statistical comparisons: feeds comparisons (evidence: `README.md`)
- Community detection → Weak-tie analysis: classifies passes (evidence: `src/weak_ties.py`)
- Passing graphs → Weak-tie analysis: builds team graph (evidence: `src/weak_ties.py`)
- Passing graphs → Pitch visualizations: builds team graph (evidence: `src/plots.py`)
- Community detection → Pitch visualizations: colors communities (evidence: `src/plots.py`)
- Network metrics → Pitch visualizations: measures fragility (evidence: `src/plots.py`)
- Passing graphs → Scouting reports: builds team graph (evidence: `src/scouting.py`)
- Network metrics → Scouting reports: measures vulnerability (evidence: `src/scouting.py`)
- Community detection → Scouting reports: summarizes structure (evidence: `src/scouting.py`)
- Processed datasets → Dashboard export: aggregates datasets (evidence: `src/export_dashboard_data.py`)
- Dashboard export → Dashboard JSON: writes JSON (evidence: `src/export_dashboard_data.py`)
- Dashboard launcher → Dashboard export: runs if missing (evidence: `run_dashboard.py`)
- Dashboard launcher → Local web server: starts server (evidence: `run_dashboard.py`)
- Local web server → Interactive dashboard: serves dashboard (evidence: `run_dashboard.py`)
- Interactive dashboard → Dashboard JSON: loads data
