Purpose
The Backend is the ground-side counterpart to the car's Telemetry Node. It's a Python service (the "Telemetry Middleman") that receives the UDP CSV telemetry stream at the pit, fans it out live to Grafana, InfluxDB, and Marple, 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 owns
- Ingest: parses the UDP CSV stream from the car into a typed packet, using one schema file shared across every sink.
- Live streaming: pushes every packet to Grafana Live inline, with no queueing latency.
- Storage: writes every field to InfluxDB, batched, plus a separate stats bucket and a lap-analysis bucket.
- Lap tracking: an independent, runtime-configurable finish-line detector built on GPS coordinates.
- Control: a FastAPI dashboard and REST API to toggle sinks and tune lap thresholds without a restart.
Stack
| Layer | What we use |
|---|---|
| Language | Python 3.11 |
| Web API | FastAPI + uvicorn |
| Time series | InfluxDB (3 buckets: telemetry, stats, analysis) |
| Live push | Grafana Live |
| Analysis export | Marple |
| Deployment | Docker Compose, GitHub Actions CI/CD |
How the data flows
Where to go next
Start with the Cloud Server Overview for the full thread inventory, or jump into a page:
- Middleman: the eight threads, the CSV parser, the ring-buffer queues, and the web dashboard.
- Lap Tracking: the backend's own finish-line detector, separate from the firmware's onboard one.
- InfluxDB: the three buckets and how timestamps are resolved.
- Grafana: the live push path and session lifecycle.
- Server Setup: the Docker Compose stack and deployment.
Configuration
Every setting lives in one .env file, read by both the Python process (config.py) and Docker Compose. The CSV column layout is defined once in schema.py, the only file to touch if the firmware's wire format changes.
NOTE
Keep this live: if you change a thread's behavior, add a sink, or touch the CSV schema, update the matching page under the Backend docs in the same PR.
