# maxweltchek/stravarunfaker architecture

> Architecture diagram of the GitHub repository maxweltchek/stravarunfaker, 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/maxweltchek/stravarunfaker
- Repository: https://github.com/maxweltchek/stravarunfaker

## Overview

Strava Run Faker lets a user mark a route on a map, optionally snap it to roads, choose a start time, duration, and heart-rate noise, then generate and download a GPX run. The browser sends route and generation requests to Flask; the server obtains a road route, synthesizes timed track points and speed-correlated heart rate, and returns GPX. Road snapping uses OSRM, while the browser displays OpenStreetMap tiles. The sampled source shows these main calls; the template and styling are represented by their exact tree paths but were not sampled.

Main entry points: [`static/app.js`](https://github.com/maxweltchek/stravarunfaker/blob/main/static/app.js) (Map and controls), [`app.py`](https://github.com/maxweltchek/stravarunfaker/blob/main/app.py) (HTTP endpoints), [`GPXDataGen.py`](https://github.com/maxweltchek/stravarunfaker/blob/main/GPXDataGen.py) (GPX and timing), [`roadSnapper.py`](https://github.com/maxweltchek/stravarunfaker/blob/main/roadSnapper.py) (Road routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_webui["Map and controls<br/>[app.js]"]
  node_page["Page template<br/>[index.html]"]
  node_styles["Page styling<br/>[styles.css]"]
  node_download["GPX download<br/>[app.js]"]
end

subgraph group_service["Flask service"]
  node_api["HTTP endpoints<br/>[app.py]"]
end

subgraph group_generation["Run generation"]
  node_snapper["Road routing<br/>[roadSnapper.py]"]
  node_gpx["GPX and timing<br/>[GPXDataGen.py]"]
  node_heartrate["Heart-rate synthesis"]
  node_tools["Distance and noise<br/>[tools.py]"]
end

subgraph group_integrations["External services"]
  node_osrm["OSRM router"]
  node_osm["OpenStreetMap tiles"]
end

node_runner(("Runner"))

node_runner -->|"uses"| node_webui
node_webui -->|"loads"| node_page
node_webui -.->|"styles"| node_styles
node_webui -->|"loads tiles"| node_osm
node_webui -->|"posts points"| node_api
node_webui -->|"requests snap"| node_api
node_api -->|"routes points"| node_snapper
node_snapper -->|"requests route"| node_osrm
node_api -->|"generates GPX"| node_gpx
node_gpx -->|"generates pulse"| node_heartrate
node_gpx -->|"measures route"| node_tools
node_heartrate -->|"uses helpers"| node_tools
node_api -->|"returns route"| node_webui
node_api -->|"returns GPX"| node_download
node_download -->|"downloads file"| node_runner

click node_webui "https://github.com/maxweltchek/stravarunfaker/blob/main/static/app.js"
click node_page "https://github.com/maxweltchek/stravarunfaker/blob/main/templates/index.html"
click node_styles "https://github.com/maxweltchek/stravarunfaker/blob/main/static/styles.css"
click node_api "https://github.com/maxweltchek/stravarunfaker/blob/main/app.py"
click node_snapper "https://github.com/maxweltchek/stravarunfaker/blob/main/roadSnapper.py"
click node_gpx "https://github.com/maxweltchek/stravarunfaker/blob/main/GPXDataGen.py"
click node_heartrate "https://github.com/maxweltchek/stravarunfaker/blob/main/heartRateGenerator.py"
click node_tools "https://github.com/maxweltchek/stravarunfaker/blob/main/tools.py"
click node_download "https://github.com/maxweltchek/stravarunfaker/blob/main/static/app.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_webui,node_page,node_styles,node_download toneBlue
class node_api toneAmber
class node_snapper,node_gpx,node_heartrate,node_tools toneMint
class node_osrm,node_osm toneRose
class node_runner toneIndigo
```

## Components

### Browser client

- [Map and controls](https://github.com/maxweltchek/stravarunfaker/blob/main/static/app.js): `static/app.js`
- [Page template](https://github.com/maxweltchek/stravarunfaker/blob/main/templates/index.html): `templates/index.html`
- [Page styling](https://github.com/maxweltchek/stravarunfaker/blob/main/static/styles.css): `static/styles.css`
- [GPX download](https://github.com/maxweltchek/stravarunfaker/blob/main/static/app.js): `static/app.js`

### Flask service

- [HTTP endpoints](https://github.com/maxweltchek/stravarunfaker/blob/main/app.py): `app.py`

### Run generation

- [Road routing](https://github.com/maxweltchek/stravarunfaker/blob/main/roadSnapper.py): `roadSnapper.py`
- [GPX and timing](https://github.com/maxweltchek/stravarunfaker/blob/main/GPXDataGen.py): `GPXDataGen.py`
- [Heart-rate synthesis](https://github.com/maxweltchek/stravarunfaker/blob/main/heartRateGenerator.py): `heartRateGenerator.py`
- [Distance and noise](https://github.com/maxweltchek/stravarunfaker/blob/main/tools.py): `tools.py`

### External services

- **OSRM router**
- **OpenStreetMap tiles**

### Other components

- **Runner**

## Connections

- Runner → Map and controls: uses (evidence: `README.md`)
- Map and controls → Page template: loads
- Map and controls → Page styling: styles
- Map and controls → OpenStreetMap tiles: loads tiles (evidence: `static/app.js`)
- Map and controls → HTTP endpoints: posts points (evidence: `static/app.js`)
- Map and controls → HTTP endpoints: requests snap (evidence: `static/app.js`)
- HTTP endpoints → Road routing: routes points (evidence: `app.py`)
- Road routing → OSRM router: requests route (evidence: `roadSnapper.py`)
- HTTP endpoints → GPX and timing: generates GPX (evidence: `app.py`)
- GPX and timing → Heart-rate synthesis: generates pulse (evidence: `GPXDataGen.py`)
- GPX and timing → Distance and noise: measures route (evidence: `GPXDataGen.py`)
- Heart-rate synthesis → Distance and noise: uses helpers (evidence: `heartRateGenerator.py`)
- HTTP endpoints → Map and controls: returns route (evidence: `app.py`)
- HTTP endpoints → GPX download: returns GPX (evidence: `app.py`)
- GPX download → Runner: downloads file (evidence: `static/app.js`)
