On routeIdleUnassignedReturningSelected routeHeavy traffic
Event stream 0 msg/s
Track a parcel
The page your customers see. It reads the same live stream as the dispatch console.
Active right now
New shipment
Shippers usually create these through the REST API. Dispatchers can also book one by hand here.
Quote
Nearest drivers PostGIS · ST_DWithin 5 km
API request
Fleet roster
Ten drivers across two hubs. Rows update with every location ping.
| Driver | Vehicle | Status | Current task | Queue | Speed | Last ping | Delivered | On-time |
|---|
How it works
Next.js front ends, a NestJS API, PostgreSQL with PostGIS for geography, Redis for live state and fan-out, WebSockets to every open screen.
Driver matching
Candidates come from a spatial index, then get ranked by queue length, vehicle capacity and routed pickup time.
SELECT d.id, d.name, ST_Distance(d.last_loc::geography, s.pickup::geography) AS meters FROM drivers d JOIN shipments s ON s.id = $1 WHERE d.status IN ('idle','on_route') AND ST_DWithin(d.last_loc::geography, s.pickup::geography, 5000) ORDER BY d.last_loc <-> s.pickup LIMIT 5;
Live state in Redis
Each ping updates a geo set and publishes once. The gateway fans that message out to every subscribed screen.
# every 5 s per driver GEOADD fleet:live -79.3912 43.6687 DRV-104 PUBLISH drv:DRV-104 '{"lat":…,"lng":…}' # ETA cache, recomputed on change SET eta:SDR4K7M2QXPR 1452 EX 60 # status changes XADD shipment-events * id SDR… to OUT_FOR_DELIVERY
Last WebSocket frame
The most recent event pushed to dispatcher screens, live.