# 420doma/trip architecture

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

- Interactive diagram: https://gitdiagram.com/420doma/trip
- Repository: https://github.com/420doma/trip

## Overview

420Doma’s Trip is documented as a motorcycle telemetry tracker: a phone sends GPS updates, a Flask service processes and stores rides, and a browser dashboard presents mileage, maps, charts, calendar details, and device status. The file tree contains only the frontend shell, PWA manifest, and service worker; the README documents the backend and database, but their source files are absent. Those components are therefore shown with null paths, and documented relationships are cited to the README.

Main entry points: [`index.html`](https://github.com/420doma/trip/blob/main/index.html) (Web Dashboard), [`sw.js`](https://github.com/420doma/trip/blob/main/sw.js) (Service Worker), [`manifest.json`](https://github.com/420doma/trip/blob/main/manifest.json) (Install Metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_telemetry["Telemetry Processing"]
  node_api["Flask API"]
  node_gps["GPS Processing"]
  node_ride_store[("Ride Database")]
end

subgraph group_dashboard["Ride Dashboard"]
  node_spa["Web Dashboard<br/>[index.html]"]
  node_odometer["Mileage Stats<br/>[index.html]"]
  node_map["Road Heatmap<br/>[index.html]"]
  node_charts["Activity Charts<br/>[index.html]"]
  node_calendar["Ride Calendar<br/>[index.html]"]
  node_device_status["Phone Status<br/>[index.html]"]
end

subgraph group_pwa["PWA Support"]
  node_manifest["Install Metadata<br/>[manifest.json]"]
  node_sw["Service Worker<br/>[sw.js]"]
end

node_rider(("Rider"))
node_phone["Phone Tracker"]
node_browser(("Web Browser"))

node_rider -->|"starts tracking"| node_phone
node_phone -->|"sends GPS"| node_api
node_api -->|"processes points"| node_gps
node_gps -->|"stores rides"| node_ride_store
node_api -->|"persists data"| node_ride_store
node_spa -->|"polls telemetry"| node_api
node_api -->|"returns ride data"| node_spa
node_spa -->|"renders mileage"| node_odometer
node_spa -->|"renders routes"| node_map
node_spa -->|"renders activity"| node_charts
node_spa -->|"shows daily detail"| node_calendar
node_spa -->|"shows status"| node_device_status
node_rider -->|"views dashboard"| node_spa
node_browser -->|"loads app"| node_spa
node_browser -->|"installs app"| node_manifest
node_browser -->|"runs worker"| node_sw
node_sw -->|"claims clients"| node_browser
node_sw -->|"notifies activation"| node_spa

click node_spa "https://github.com/420doma/trip/blob/main/index.html"
click node_odometer "https://github.com/420doma/trip/blob/main/index.html"
click node_map "https://github.com/420doma/trip/blob/main/index.html"
click node_charts "https://github.com/420doma/trip/blob/main/index.html"
click node_calendar "https://github.com/420doma/trip/blob/main/index.html"
click node_device_status "https://github.com/420doma/trip/blob/main/index.html"
click node_manifest "https://github.com/420doma/trip/blob/main/manifest.json"
click node_sw "https://github.com/420doma/trip/blob/main/sw.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_api,node_gps,node_ride_store,node_browser toneBlue
class node_spa,node_odometer,node_map,node_charts,node_calendar,node_device_status toneAmber
class node_manifest,node_sw toneMint
class node_rider,node_phone toneIndigo
```

## Components

### Telemetry Processing

- **Flask API**
- **GPS Processing**
- **Ride Database**

### Ride Dashboard

- [Web Dashboard](https://github.com/420doma/trip/blob/main/index.html): `index.html`
- [Mileage Stats](https://github.com/420doma/trip/blob/main/index.html): `index.html`
- [Road Heatmap](https://github.com/420doma/trip/blob/main/index.html): `index.html`
- [Activity Charts](https://github.com/420doma/trip/blob/main/index.html): `index.html`
- [Ride Calendar](https://github.com/420doma/trip/blob/main/index.html): `index.html`
- [Phone Status](https://github.com/420doma/trip/blob/main/index.html): `index.html`

### PWA Support

- [Install Metadata](https://github.com/420doma/trip/blob/main/manifest.json): `manifest.json`
- [Service Worker](https://github.com/420doma/trip/blob/main/sw.js): `sw.js`

### Other components

- **Rider**
- **Phone Tracker**
- **Web Browser**

## Connections

- Rider → Phone Tracker: starts tracking (evidence: `README.md`)
- Phone Tracker → Flask API: sends GPS (evidence: `README.md`)
- Flask API → GPS Processing: processes points (evidence: `README.md`)
- GPS Processing → Ride Database: stores rides (evidence: `README.md`)
- Flask API → Ride Database: persists data (evidence: `README.md`)
- Web Dashboard → Flask API: polls telemetry (evidence: `README.md`)
- Flask API → Web Dashboard: returns ride data (evidence: `README.md`)
- Web Dashboard → Mileage Stats: renders mileage (evidence: `README.md`)
- Web Dashboard → Road Heatmap: renders routes (evidence: `README.md`)
- Web Dashboard → Activity Charts: renders activity (evidence: `README.md`)
- Web Dashboard → Ride Calendar: shows daily detail (evidence: `README.md`)
- Web Dashboard → Phone Status: shows status (evidence: `README.md`)
- Rider → Web Dashboard: views dashboard (evidence: `README.md`)
- Web Browser → Web Dashboard: loads app (evidence: `README.md`)
- Web Browser → Install Metadata: installs app (evidence: `README.md`)
- Web Browser → Service Worker: runs worker (evidence: `sw.js`)
- Service Worker → Web Browser: claims clients (evidence: `sw.js`)
- Service Worker → Web Dashboard: notifies activation (evidence: `sw.js`)
