# sevsunday/vt-stats architecture

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

- Interactive diagram: https://gitdiagram.com/sevsunday/vt-stats
- Repository: https://github.com/sevsunday/vt-stats

## Overview

VT Stats is a static Battlezone community statistics and game-reference site. Its documented data workflow processes uploaded match sessions into precomputed results, which the site presents through match analysis and replay; the product also includes map, model, ODF, weapons, and live-lobby experiences. The tree and README establish these major capabilities, but most feature-to-feature wiring was not sampled, so the graph avoids asserting unshown internal calls.

Main entry points: [`js/app.js`](https://github.com/sevsunday/vt-stats/blob/main/js/app.js) (Static site), [`scripts/process_stats.py`](https://github.com/sevsunday/vt-stats/blob/main/scripts/process_stats.py) (Statistics processing), [`js/match-elo.js`](https://github.com/sevsunday/vt-stats/blob/main/js/match-elo.js) (Match analyses), [`_map-analysis/render/js/replay.js`](https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/render/js/replay.js) (3D replay)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Match data"]
  node_session_files["Session files"]
  node_processing["Statistics processing<br/>[process_stats.py]"]
  node_processed[("Precomputed results")]
end

subgraph group_analysis["Match analysis"]
  node_match_analysis["Match analyses<br/>[match-elo.js]"]
  node_replay["3D replay<br/>[replay.js]"]
  node_elo["Provisional ELO<br/>[elo.py]"]
end

subgraph group_reference["Game reference"]
  node_map_browser["Map browser<br/>[viewer.js]"]
  node_map_ingest["Map ingestion<br/>[ingest_maps.py]"]
  node_odf_browser["ODF browser<br/>[odf-browser.js]"]
  node_model_browser["Game-model renders<br/>[models-viewer.js]"]
  node_lego_renders["Lego-model renders<br/>[lego-viewer.js]"]
  node_explorer["Game explorer<br/>[main.js]"]
  node_weapons_lab["Weapons Lab<br/>[weapon-sim.js]"]
end

subgraph group_live["Live tools"]
  node_gamewatch["GameWatch<br/>[main.js]"]
  node_lobby_tools["Lobby tools<br/>[main.js]"]
end

node_submitter(("Session submitter"))
node_site["Static site<br/>[app.js]"]

node_submitter -->|"uploads"| node_session_files
node_session_files -->|"reads sessions"| node_processing
node_processing -->|"writes results"| node_processed
node_processing -->|"fetches map metadata"| node_map_ingest
node_processed -->|"supplies site data"| node_site
node_site -->|"presents matches"| node_match_analysis
node_site -->|"offers replay"| node_replay
node_site -->|"presents ratings"| node_elo
node_site -->|"offers maps"| node_map_browser
node_site -->|"offers ODFs"| node_odf_browser
node_site -->|"offers models"| node_model_browser
node_site -->|"offers Lego renders"| node_lego_renders
node_site -->|"offers exploration"| node_explorer
node_site -->|"offers firing range"| node_weapons_lab
node_site -->|"shows live lobbies"| node_gamewatch
node_site -->|"offers lobby tools"| node_lobby_tools

click node_processing "https://github.com/sevsunday/vt-stats/blob/main/scripts/process_stats.py"
click node_site "https://github.com/sevsunday/vt-stats/blob/main/js/app.js"
click node_match_analysis "https://github.com/sevsunday/vt-stats/blob/main/js/match-elo.js"
click node_replay "https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/render/js/replay.js"
click node_elo "https://github.com/sevsunday/vt-stats/blob/main/scripts/elo.py"
click node_map_browser "https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/render/js/viewer.js"
click node_map_ingest "https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/scripts/ingest_maps.py"
click node_odf_browser "https://github.com/sevsunday/vt-stats/blob/main/js/odf-browser.js"
click node_model_browser "https://github.com/sevsunday/vt-stats/blob/main/js/models-viewer.js"
click node_lego_renders "https://github.com/sevsunday/vt-stats/blob/main/js/lego-viewer.js"
click node_explorer "https://github.com/sevsunday/vt-stats/blob/main/js/explorer/main.js"
click node_weapons_lab "https://github.com/sevsunday/vt-stats/blob/main/js/fx/weapon-sim.js"
click node_gamewatch "https://github.com/sevsunday/vt-stats/blob/main/js/gw/main.js"
click node_lobby_tools "https://github.com/sevsunday/vt-stats/blob/main/js/tools/main.js"

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_session_files,node_processing,node_processed toneBlue
class node_match_analysis,node_replay,node_elo toneAmber
class node_map_browser,node_map_ingest,node_odf_browser,node_model_browser,node_lego_renders,node_explorer,node_weapons_lab toneMint
class node_gamewatch,node_lobby_tools toneRose
class node_submitter toneIndigo
class node_site toneTeal
```

## Components

### Match data

- **Session files**
- [Statistics processing](https://github.com/sevsunday/vt-stats/blob/main/scripts/process_stats.py): `scripts/process_stats.py`
- **Precomputed results**

### Match analysis

- [Match analyses](https://github.com/sevsunday/vt-stats/blob/main/js/match-elo.js): `js/match-elo.js`
- [3D replay](https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/render/js/replay.js): `_map-analysis/render/js/replay.js`
- [Provisional ELO](https://github.com/sevsunday/vt-stats/blob/main/scripts/elo.py): `scripts/elo.py`

### Game reference

- [Map browser](https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/render/js/viewer.js): `_map-analysis/render/js/viewer.js`
- [Map ingestion](https://github.com/sevsunday/vt-stats/blob/main/_map-analysis/scripts/ingest_maps.py): `_map-analysis/scripts/ingest_maps.py`
- [ODF browser](https://github.com/sevsunday/vt-stats/blob/main/js/odf-browser.js): `js/odf-browser.js`
- [Game-model renders](https://github.com/sevsunday/vt-stats/blob/main/js/models-viewer.js): `js/models-viewer.js`
- [Lego-model renders](https://github.com/sevsunday/vt-stats/blob/main/js/lego-viewer.js): `js/lego-viewer.js`
- [Game explorer](https://github.com/sevsunday/vt-stats/blob/main/js/explorer/main.js): `js/explorer/main.js`
- [Weapons Lab](https://github.com/sevsunday/vt-stats/blob/main/js/fx/weapon-sim.js): `js/fx/weapon-sim.js`

### Live tools

- [GameWatch](https://github.com/sevsunday/vt-stats/blob/main/js/gw/main.js): `js/gw/main.js`
- [Lobby tools](https://github.com/sevsunday/vt-stats/blob/main/js/tools/main.js): `js/tools/main.js`

### Other components

- **Session submitter**
- [Static site](https://github.com/sevsunday/vt-stats/blob/main/js/app.js): `js/app.js`

## Connections

- Session submitter → Session files: uploads
- Session files → Statistics processing: reads sessions
- Statistics processing → Precomputed results: writes results
- Statistics processing → Map ingestion: fetches map metadata
- Precomputed results → Static site: supplies site data
- Static site → Match analyses: presents matches
- Static site → 3D replay: offers replay
- Static site → Provisional ELO: presents ratings
- Static site → Map browser: offers maps
- Static site → ODF browser: offers ODFs
- Static site → Game-model renders: offers models
- Static site → Lego-model renders: offers Lego renders
- Static site → Game explorer: offers exploration
- Static site → Weapons Lab: offers firing range
- Static site → GameWatch: shows live lobbies
- Static site → Lobby tools: offers lobby tools
