# chronoracer/chronoracer-dashboard architecture

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

## Overview

Electra Racing Dashboard is an onboard driver display and measurement app, with a simulator for laptop use. The principal workflow is car or simulated acquisition into a shared telemetry bus, then live gauges and alarms; GPS samples also feed track recording and lap/sector timing, while drive sessions are recorded and readings can be sent to Chronoracer. The graph preserves menu, operator messaging, and server-race capabilities documented in the README. Some subsystem links are documented rather than source-verified because their implementation excerpts were not provided.

Main entry points: [`backend/app/bootstrap.py`](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/app/bootstrap.py) (App bootstrap), [`backend/data_bus/telemetry_bus.py`](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_bus/telemetry_bus.py) (Telemetry bus), [`backend/cars/sources.py`](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/cars/sources.py) (Source selection), [`backend/data_sources/racebox_service.py`](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/racebox_service.py) (RaceBox GPS)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and acquisition"]
  node_entry["App bootstrap<br/>[bootstrap.py]"]
  node_carprofile["Car profiles<br/>[profile.py]"]
  node_sources["Source selection<br/>[sources.py]"]
  node_sim["Data simulator<br/>[service.py]"]
  node_racebox["RaceBox GPS<br/>[racebox_service.py]"]
  node_toyota["Toyota OBD"]
  node_tpms["TPMS source<br/>[tpms_service.py]"]
end

subgraph group_telemetry["Telemetry and driver display"]
  node_channels["Channel registry<br/>[registry.py]"]
  node_bus["Telemetry bus<br/>[telemetry_bus.py]"]
  node_state[("State store<br/>[state_store.py]")]
  node_dashvm["Dash view model<br/>[dash.py]"]
  node_alarms["Sensor alarms<br/>[sensor_alarms.py]"]
  node_dash["Gauge layouts<br/>[driver_manager.py]"]
end

subgraph group_timing["Tracks and timing"]
  node_gpsfeed["GPS feed<br/>[feed.py]"]
  node_trackrepo[("Track repository<br/>[repository.py]")]
  node_trackmodel["Track model<br/>[model.py]"]
  node_timingengine["Lap timing<br/>[gate_timer.py]"]
  node_race_mode["Race mode<br/>[race.py]"]
  node_sessions["Session manager<br/>[manager.py]"]
  node_drivestore[("Drive recording<br/>[drive_store.py]")]
end

subgraph group_interaction["Driver interaction"]
  node_menu["Menu navigation<br/>[navigator.py]"]
  node_screens["App screens<br/>[factory.py]"]
  node_operator["Operator messages"]
end

subgraph group_integrations["External services"]
  node_kafka["Kafka service<br/>[kafka_service.py]"]
  node_uplink["Kafka uplink<br/>[uplink.py]"]
  node_relay["Race server relay<br/>[server_race.py]"]
  node_carhardware{{"Car sensors"}}
  node_chronoracer{{"Chronoracer"}}
end

node_driver(("Driver"))
node_raceoperator(("Race operator"))
node_qml["Dashboard UI"]

node_driver -->|"starts app"| node_entry
node_entry -->|"loads profile"| node_carprofile
node_entry -->|"starts sources"| node_sources
node_sources -->|"selects source"| node_sim
node_sources -->|"selects source"| node_racebox
node_sources -->|"selects source"| node_toyota
node_sources -->|"selects source"| node_tpms
node_carhardware -.->|"GPS input"| node_racebox
node_carhardware -.->|"OBD input"| node_toyota
node_racebox -->|"publishes samples"| node_bus
node_toyota -->|"publishes readings"| node_bus
node_sim -->|"publishes samples"| node_bus
node_entry -->|"creates bus"| node_bus
node_entry -->|"configures channels"| node_channels
node_bus -->|"updates state"| node_state
node_entry -->|"configures alarms"| node_alarms
node_bus -->|"delivers telemetry"| node_alarms
node_bus -->|"provides readings"| node_dashvm
node_state -->|"provides state"| node_dashvm
node_dash -->|"manages layouts"| node_dashvm
node_dashvm -->|"exposes gauges"| node_qml
node_racebox -->|"emits GPS events"| node_gpsfeed
node_entry -->|"wires repository"| node_trackrepo
node_trackrepo -->|"stores tracks"| node_trackmodel
node_gpsfeed -.->|"feeds samples"| node_timingengine
node_trackrepo -.->|"supplies track"| node_timingengine
node_timingengine -.->|"provides lap timing"| node_race_mode
node_entry -->|"wires manager"| node_sessions
node_sessions -->|"starts recorder"| node_drivestore
node_entry -->|"wires navigation"| node_menu
node_menu -.->|"routes screens"| node_screens
node_raceoperator -->|"sends messages"| node_operator
node_kafka -->|"consumes telemetry"| node_bus
node_entry -->|"starts uplink"| node_uplink
node_uplink -->|"sends readings"| node_chronoracer
node_chronoracer -.->|"delivers messages"| node_kafka
node_entry -->|"wires race start"| node_relay
node_relay -->|"starts race"| node_chronoracer

click node_entry "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/app/bootstrap.py"
click node_carprofile "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/cars/profile.py"
click node_sources "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/cars/sources.py"
click node_sim "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/sim/service.py"
click node_racebox "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/racebox_service.py"
click node_toyota "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/toyota_poll_service.py"
click node_tpms "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/tpms_service.py"
click node_channels "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/channels/registry.py"
click node_bus "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_bus/telemetry_bus.py"
click node_state "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_bus/state_store.py"
click node_dashvm "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/viewmodels/dash.py"
click node_alarms "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/sensor_alarms.py"
click node_dash "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/driver_manager.py"
click node_gpsfeed "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/gps/feed.py"
click node_trackrepo "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/tracks/repository.py"
click node_trackmodel "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/tracks/model.py"
click node_timingengine "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/timing/gate_timer.py"
click node_race_mode "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/modes/race.py"
click node_sessions "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/sessions/manager.py"
click node_drivestore "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/recording/drive_store.py"
click node_menu "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/menu/navigator.py"
click node_screens "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/screens/factory.py"
click node_operator "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/operator_messages.py"
click node_kafka "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/kafka/kafka_service.py"
click node_uplink "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/kafka/uplink.py"
click node_relay "https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/relay/server_race.py"

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_entry,node_carprofile,node_sources,node_sim,node_racebox,node_toyota,node_tpms,node_qml toneBlue
class node_channels,node_bus,node_state,node_dashvm,node_alarms,node_dash toneAmber
class node_gpsfeed,node_trackrepo,node_trackmodel,node_timingengine,node_race_mode,node_sessions,node_drivestore toneMint
class node_menu,node_screens,node_operator toneRose
class node_kafka,node_uplink,node_relay,node_carhardware,node_chronoracer,node_driver,node_raceoperator toneIndigo
```

## Components

### Runtime and acquisition

- [App bootstrap](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/app/bootstrap.py): `backend/app/bootstrap.py`
- [Car profiles](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/cars/profile.py): `backend/cars/profile.py`
- [Source selection](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/cars/sources.py): `backend/cars/sources.py`
- [Data simulator](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/sim/service.py): `backend/data_sources/sim/service.py`
- [RaceBox GPS](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/racebox_service.py): `backend/data_sources/racebox_service.py`
- [Toyota OBD](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/toyota_poll_service.py): `backend/data_sources/toyota_poll_service.py`
- [TPMS source](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_sources/tpms_service.py): `backend/data_sources/tpms_service.py`

### Telemetry and driver display

- [Channel registry](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/channels/registry.py): `backend/channels/registry.py`
- [Telemetry bus](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_bus/telemetry_bus.py): `backend/data_bus/telemetry_bus.py`
- [State store](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/data_bus/state_store.py): `backend/data_bus/state_store.py`
- [Dash view model](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/viewmodels/dash.py): `backend/viewmodels/dash.py`
- [Sensor alarms](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/sensor_alarms.py): `backend/dash/sensor_alarms.py`
- [Gauge layouts](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/driver_manager.py): `backend/dash/driver_manager.py`

### Tracks and timing

- [GPS feed](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/gps/feed.py): `backend/gps/feed.py`
- [Track repository](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/tracks/repository.py): `backend/tracks/repository.py`
- [Track model](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/tracks/model.py): `backend/tracks/model.py`
- [Lap timing](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/timing/gate_timer.py): `backend/timing/gate_timer.py`
- [Race mode](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/modes/race.py): `backend/modes/race.py`
- [Session manager](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/sessions/manager.py): `backend/sessions/manager.py`
- [Drive recording](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/recording/drive_store.py): `backend/recording/drive_store.py`

### Driver interaction

- [Menu navigation](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/menu/navigator.py): `backend/menu/navigator.py`
- [App screens](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/screens/factory.py): `backend/screens/factory.py`
- [Operator messages](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/dash/operator_messages.py): `backend/dash/operator_messages.py`

### External services

- [Kafka service](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/kafka/kafka_service.py): `backend/kafka/kafka_service.py`
- [Kafka uplink](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/kafka/uplink.py): `backend/kafka/uplink.py`
- [Race server relay](https://github.com/chronoracer/chronoracer-dashboard/blob/master/backend/relay/server_race.py): `backend/relay/server_race.py`
- **Car sensors**
- **Chronoracer**

### Other components

- **Driver**
- **Race operator**
- **Dashboard UI**

## Connections

- Driver → App bootstrap: starts app
- App bootstrap → Car profiles: loads profile (evidence: `backend/app/bootstrap.py`)
- App bootstrap → Source selection: starts sources (evidence: `backend/app/bootstrap.py`)
- Source selection → Data simulator: selects source (evidence: `backend/cars/sources.py`)
- Source selection → RaceBox GPS: selects source (evidence: `backend/cars/sources.py`)
- Source selection → Toyota OBD: selects source (evidence: `backend/cars/sources.py`)
- Source selection → TPMS source: selects source (evidence: `backend/cars/sources.py`)
- Car sensors → RaceBox GPS: GPS input
- Car sensors → Toyota OBD: OBD input
- RaceBox GPS → Telemetry bus: publishes samples (evidence: `backend/data_sources/racebox_service.py`)
- Toyota OBD → Telemetry bus: publishes readings (evidence: `backend/data_sources/toyota_poll_service.py`)
- Data simulator → Telemetry bus: publishes samples (evidence: `backend/data_sources/sim/service.py`)
- App bootstrap → Telemetry bus: creates bus (evidence: `backend/app/bootstrap.py`)
- App bootstrap → Channel registry: configures channels (evidence: `backend/app/bootstrap.py`)
- Telemetry bus → State store: updates state (evidence: `backend/data_bus/state_store.py`)
- App bootstrap → Sensor alarms: configures alarms (evidence: `backend/app/bootstrap.py`)
- Telemetry bus → Sensor alarms: delivers telemetry (evidence: `backend/dash/sensor_alarms.py`)
- Telemetry bus → Dash view model: provides readings (evidence: `backend/viewmodels/dash.py`)
- State store → Dash view model: provides state (evidence: `backend/viewmodels/dash.py`)
- Gauge layouts → Dash view model: manages layouts (evidence: `backend/viewmodels/dash.py`)
- Dash view model → Dashboard UI: exposes gauges
- RaceBox GPS → GPS feed: emits GPS events (evidence: `backend/data_sources/racebox_service.py`)
- App bootstrap → Track repository: wires repository
- Track repository → Track model: stores tracks (evidence: `backend/tracks/repository.py`)
- GPS feed → Lap timing: feeds samples
- Track repository → Lap timing: supplies track
- Lap timing → Race mode: provides lap timing
- App bootstrap → Session manager: wires manager
- Session manager → Drive recording: starts recorder (evidence: `backend/sessions/manager.py`)
- App bootstrap → Menu navigation: wires navigation
- Menu navigation → App screens: routes screens
- Race operator → Operator messages: sends messages
- Kafka service → Telemetry bus: consumes telemetry (evidence: `backend/kafka/kafka_service.py`)
- App bootstrap → Kafka uplink: starts uplink (evidence: `backend/app/bootstrap.py`)
- Kafka uplink → Chronoracer: sends readings
- Chronoracer → Kafka service: delivers messages
- App bootstrap → Race server relay: wires race start
- Race server relay → Chronoracer: starts race
