# ananyo-sen-b2530066/distributed-gaming-analytics architecture

> Architecture diagram of the GitHub repository ananyo-sen-b2530066/distributed-gaming-analytics, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ananyo-sen-b2530066/distributed-gaming-analytics
- Repository: https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics

## Overview

This is a Flask-based Counter-Strike player analytics app. A user submits player stats and chooses prediction or statistical analysis; Flask builds per-player Ray tasks, waits for results, and renders them. A separate training path transforms the CSV dataset and trains target-specific Random Forest models. The README documents Ray workers and local worker-side model loading; those deployment details are shown as documented capabilities, while unsampled templates and task internals limit further call-level detail.

Main entry points: [`app.py`](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/app.py) (Flask routes), [`ray_tasks.py`](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py) (Ray task logic), [`train_model.py`](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/train_model.py) (Model training), [`templates/index.html`](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/templates/index.html) (Input form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_form["Input form<br/>[index.html]"]
  node_flask["Flask routes<br/>[app.py]"]
  node_results["Results view<br/>[result.html]"]
end

subgraph group_compute["Distributed analytics"]
  node_ray{{"Ray cluster"}}
  node_workers["Ray workers"]
  node_tasks["Ray task logic<br/>[ray_tasks.py]"]
  node_prediction["Player prediction<br/>[ray_tasks.py]"]
  node_analysis["Statistical analysis<br/>[ray_tasks.py]"]
  node_averages["Dataset averages<br/>[ray_tasks.py]"]
end

subgraph group_ml["Model training"]
  node_trainer["Model training<br/>[train_model.py]"]
  node_models["Prediction models"]
end

subgraph group_data["Player data"]
  node_transform["Dataset transform<br/>[utils.py]"]
  node_dataset[("Player dataset<br/>[cs2_dataset.csv]")]
end

node_user(("Player"))

node_user -->|"enters stats"| node_form
node_form -.->|"submits form"| node_flask
node_flask -->|"initializes"| node_ray
node_flask -->|"dispatches tasks"| node_tasks
node_tasks -->|"runs prediction"| node_prediction
node_tasks -->|"runs analysis"| node_analysis
node_flask -->|"renders results"| node_results
node_flask -->|"waits for results"| node_ray
node_ray -->|"schedules tasks"| node_workers
node_workers -->|"executes remotely"| node_prediction
node_workers -->|"executes remotely"| node_analysis
node_tasks -->|"initializes averages"| node_averages
node_analysis -->|"uses averages"| node_averages
node_trainer -->|"loads transformed data"| node_transform
node_transform -->|"reads CSV"| node_dataset
node_trainer -->|"writes models"| node_models
node_prediction -.->|"loads local model"| node_models

click node_form "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/templates/index.html"
click node_flask "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/app.py"
click node_results "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/templates/result.html"
click node_tasks "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py"
click node_prediction "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py"
click node_analysis "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py"
click node_averages "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py"
click node_trainer "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/train_model.py"
click node_transform "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/utils.py"
click node_dataset "https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/data/cs2_dataset.csv"

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_form,node_flask,node_results toneBlue
class node_ray,node_workers,node_tasks,node_prediction,node_analysis,node_averages toneAmber
class node_trainer,node_models toneMint
class node_transform,node_dataset toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Input form](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/templates/index.html): `templates/index.html`
- [Flask routes](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/app.py): `app.py`
- [Results view](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/templates/result.html): `templates/result.html`

### Distributed analytics

- **Ray cluster**
- **Ray workers**
- [Ray task logic](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py): `ray_tasks.py`
- [Player prediction](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py): `ray_tasks.py`
- [Statistical analysis](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py): `ray_tasks.py`
- [Dataset averages](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/ray_tasks.py): `ray_tasks.py`

### Model training

- [Model training](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/train_model.py): `train_model.py`
- **Prediction models**

### Player data

- [Dataset transform](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/utils.py): `utils.py`
- [Player dataset](https://github.com/ananyo-sen-b2530066/distributed-gaming-analytics/blob/main/data/cs2_dataset.csv): `data/cs2_dataset.csv`

### Other components

- **Player**

## Connections

- Player → Input form: enters stats (evidence: `README.md`)
- Input form → Flask routes: submits form
- Flask routes → Ray cluster: initializes (evidence: `app.py`)
- Flask routes → Ray task logic: dispatches tasks (evidence: `app.py`)
- Ray task logic → Player prediction: runs prediction (evidence: `ray_tasks.py`)
- Ray task logic → Statistical analysis: runs analysis (evidence: `ray_tasks.py`)
- Flask routes → Results view: renders results (evidence: `app.py`)
- Flask routes → Ray cluster: waits for results (evidence: `app.py`)
- Ray cluster → Ray workers: schedules tasks (evidence: `README.md`)
- Ray workers → Player prediction: executes remotely (evidence: `README.md`)
- Ray workers → Statistical analysis: executes remotely (evidence: `README.md`)
- Ray task logic → Dataset averages: initializes averages (evidence: `ray_tasks.py`)
- Statistical analysis → Dataset averages: uses averages (evidence: `ray_tasks.py`)
- Model training → Dataset transform: loads transformed data (evidence: `train_model.py`)
- Dataset transform → Player dataset: reads CSV (evidence: `utils.py`)
- Model training → Prediction models: writes models (evidence: `train_model.py`)
- Player prediction → Prediction models: loads local model (evidence: `README.md`)
