Start here
System overview
- Written for
- Fleet managers who want the big picture, and engineers before they read the API or developer pages.
There are three parts to it: the sensor unit in the vehicle, the MantAI cloud API, and the dashboard (or your own tools, through the API). Data only ever flows upward, and if the next hop happens to be down, each layer holds onto what it has until it’s back.
Architecture#
The three layers#
| Layer | Technology | Role |
|---|---|---|
| Sensor unit | ESP32-S3 firmware (C++/Arduino core) | Samples motion at 100 Hz, records audio clips, spots driving events on the unit, and uplinks over LTE. When it loses coverage, it buffers to its SD card. |
| Cloud API | Cloudflare Workers (Hono), D1, R2, Durable Objects[6] | Takes in telemetry, events, and clips, runs the AI acoustic analysis, works out ride stats and driver scores, pushes live data out over WebSockets, and serves the REST API. |
| Dashboard | React 18 + Vite single-page app | Fleet overview, live map, ride detail, sound diagnoses, driving patterns, driver profiles, and the AI chatbox. It is served from the same edge deployment as the API. |
The dashboard and API live at mantai-api.mantai-backend.workers.dev. API routes live under /v1/*, and every other path serves the dashboard application.
Life of a ride#
- Ride starts. Motion wakes the unit, and it creates a ride record with a globally unique ID. The ID is minted right on the unit, so rides stay safe even through coverage gaps.
- Telemetry streams. Position, speed, and three-axis acceleration are sampled and uplinked to the ride’s track in 1 Hz batches.
- Events fire. Harsh braking, acceleration, cornering, and impacts are caught on the unit from the 100 Hz motion stream, each reported with its location, speed, and peak g-force.
- Audio is captured. Every 5 minutes (you can change this) the unit records a short clip, saves it to the SD card, and uploads it for analysis.
- AI analyzes. Each clip is analyzed asynchronously once it arrives, and the findings, risk level, and recommendations get attached right back to it.
- Ride finalizes. We compute duration, distance, max and average speed, and event counts, tie the ride to a driver and vehicle, and update the driver’s score.
Designed for the real world
Coverage gaps, ignition cycles, and long idle stretches are just normal operating conditions here, not edge cases to worry about. The unit buffers locally and catches up the moment connectivity returns, and because ride records are created idempotently, a retry never ends up duplicating your data.
References#
- Cloudflare, "Workers Documentation," 2026. [Online]. Available: https://developers.cloudflare.com/workers/