Platform
Data model
- Written for
- Integration and backend engineers.
The platform stores a small, clearly defined set of entities. Everything hangs off an organization: its vehicles and drivers, and the rides they produce. Once you know these eight, the API reads naturally.
Entities#
| Entity | Key fields | Notes |
|---|---|---|
| organization | name, company_type (rental | fleet | logistics | other), fleet_size, primary_goals | The tenant. Users join through memberships, as either a member or an admin. |
| user / session | email, session tokens (30-day TTL), magic links | Passwordless, and a single user can belong to several organizations. |
| vehicle | make, model, year, plate, owner (user or org) | Whatever a sensor unit gets assigned to. |
| driver | name, email, phone, license_no, notes | The profile that rides are attributed to. It carries the personal driving score. |
| ride | started_at, ended_at, status (active | finalized), distance, max/avg speed, polyline, event counters (n_brake, n_accel, n_corner, n_impact, n_speeding), driver_id, vehicle_id | A single ride. It is created with a unit-minted UUID, so starting a ride offline is safe. |
| event | type (harsh_brake | harsh_accel | harsh_corner | impact | speeding), t_utc_ms, lat/lon, speed, peak_mg, duration_ms | A single detected maneuver or speeding episode, geo-tagged and pinned to its ride. Each type feeds the matching counter on the ride. |
| ride track | columnar arrays: t[], lat[], lon[], speed_mps[], a_long_mg[], a_lat_mg[], a_vert_mg[] | The 1 Hz telemetry stream, appended in batches as the ride goes on. |
| clip | r2_key, status (pending | uploaded), analysis_status (none | queued | done | failed | skipped), analysis_json, analyzed_at | A single audio recording plus its AI diagnosis. The raw audio is kept for 30 days. |
Storage & retention#
- Structured data (rides, events, tracks, diagnoses, profiles) lives in an edge-replicated SQL database and is kept for the life of your account.
- Audio clips live in object storage under human-readable keys (
owner/vehicle/timestamp_clip.wav). A nightly sweep deletes them 30 days after upload. The structured findings pulled out of them are kept. - On-device archive: the unit’s SD card holds its own copy of rides, events, and clips, acting as the vehicle’s black-box record.
Track data is stored and served as columnar arrays instead of one row per second. A full hour-long ride’s telemetry comes back as a single compact JSON document that’s cheap to fetch and easy to chart.