A fleet in motion. Every command has a path back.
A real-time fleet simulator shipped as a single Go binary. Simulated vehicles talk to an embedded broker as real MQTT clients.
The product
Fleet Pulse is a rental and leasing simulator shipped as one Go binary. Real MQTT clients represent simulated vehicles, while a map and portfolio views expose telemetry, contracts and command state.
- Go
- React
- TypeScript
- PostgreSQL
- MQTT
- SSE
- Leaflet
The main flow
Devices publish telemetry
Simulated vehicles connect to the embedded mochi-mqtt broker as real clients and follow a committed Greater São Paulo route library.
The browser follows the fleet
HTTP supplies the initial snapshot. A buffered SSE stream delivers telemetry, command and area-exit events; slow clients can lose older events.
A visitor sends a door command
Lock and unlock accept an Idempotency-Key and return HTTP 202 with a command identifier. The vehicle receives the MQTT command and acknowledges it.
The command settles
PENDING → SENT → ACKED, FAILED or TIMEOUT. Expiry is five seconds from SENT; queue capacity is bounded per vehicle.
Architecture
Simulated MQTT devices ↔ embedded broker ↔ telemetry ingest / command machine
React + Leaflet ↔ HTTP API → PostgreSQL + vehicle-state cache
SSE hub → browser · React build → go:embed → single Go binary
One process, explicit boundaries
Standard-library HTTP, embedded MQTT, simulator, command machine, SSE hub and embedded React assets run in one Go process.
Durable portfolio, transient commands
PostgreSQL stores portfolio data and last-known positions, with an in-memory vehicle-state cache. Rental door command state and the live stream are lost on restart. There is no position history.
Availability and limits
All vehicles, routes and contracts are simulated. There is no authentication: visitors share the demonstration and can perform its actions. No replicas, historical position store or real vehicle control. The accelerated simulation clock is separate from real telemetry timestamps.