Cloud Server Overview
The Backend is the ground-side counterpart to the car's Telemetry Node: a Python service (the "Telemetry Middleman") that receives the UDP CSV stream, fans it out to three destinations in real time, tracks laps independently from GPS, and exposes a web dashboard and control API. It runs in Docker alongside InfluxDB and Grafana on the pit server.
What it does
- Ingests UDP CSV packets from the car, see Middleman.
- Streams live to Grafana with no queueing latency, see Grafana.
- Stores every field to InfluxDB for later analysis, see InfluxDB.
- Forwards to Marple, per session, about once a second, see Middleman.
- Tracks laps from GPS coordinates, with a runtime-configurable finish line, see Lap Tracking.
- Serves a web dashboard and REST control API.
Data flow
Threads at a glance
| Thread | Reads | Does | Docs |
|---|---|---|---|
activity-monitor | packet arrival | Declares the stream active/inactive | Middleman |
udp-receiver | UDP socket | Parses CSV, pushes to Grafana inline, fans out to 3 queues | Middleman |
influx-writer | influx_q | Batches points into the telemetry bucket | InfluxDB |
marple-sender | marple_q | Flushes to Marple once a second, per session | Middleman |
influx-stats | stats_q | Writes middleman health metrics to the stats bucket | InfluxDB |
stats-reporter | counters | Prints a status table, feeds stats_q | Middleman |
lap-tracker | analysis_q | Detects finish-line crossings, writes lap events | Lap Tracking |
web-api | HTTP | FastAPI dashboard and control endpoints | Middleman |
Every thread reads its configuration from one typed Config object (config.py), sourced from .env. The CSV column layout is defined once in schema.py, mirroring the firmware's CSV output; that's the only file to touch if the wire format changes. See Server Setup for deployment.
