The Problem
A regional freight company with 6 depots and 120 vehicles was managing deliveries through a combination of WhatsApp groups, spreadsheets, and phone calls. Dispatchers had no real-time visibility into vehicle locations. Customers had no way to track their shipments. When a delivery failed, the reason was often unknown until the driver called back hours later.
The client needed a centralised system to manage the full delivery lifecycle. from consignment creation to proof-of-delivery. with live tracking for dispatchers and self-service tracking for customers.
What I Built
The platform spans four interfaces: dispatcher dashboard, driver mobile app, customer portal, and management reporting.
Shipment lifecycle management: consignments are created with origin, destination, dimensions, weight, and declared value. The system generates a barcode label and routes the consignment to the appropriate depot and vehicle run based on PostGIS-powered geographic matching against depot coverage zones.
Live vehicle tracking: the driver app broadcasts GPS location every 30 seconds over WebSockets. Dispatchers see all vehicles on a live map (Google Maps JS API) with status overlays (on route, at delivery, returning, idle). Location history is stored in PostGIS for route replay and SLA analysis.
Driver mobile app (React Native). turn-by-turn navigation via Google Maps integration, delivery manifest with one-tap status updates (arrived, delivered, attempted, failed), and proof-of-delivery capture (photo + e-signature). The app works offline. status updates queue and sync when connectivity returns.
Customer tracking portal: customers enter their waybill number and see the shipment's current status, location on map, estimated delivery window, and delivery photo/signature once delivered. Automated SMS notifications at key status changes (dispatched, out for delivery, delivered, exception).
Management dashboard: SLA compliance rates by depot, driver performance metrics, route efficiency analysis, and exception root cause breakdown.
Technical Highlights
The backend is Node.js with PostgreSQL + PostGIS. Geographic zone matching for depot routing uses ST_Contains queries against depot polygon definitions stored in PostGIS. Vehicle location history uses a time-partitioned table (daily partitions) to keep query performance consistent.
WebSocket connections from driver apps are managed through a Redis pub/sub system. each driver publishes location updates to a Redis channel, and the dispatcher dashboard subscribes to all active drivers. This architecture decouples location broadcasts from the main API and allows horizontal scaling.
SMS notifications are sent via Twilio, triggered by a PostgreSQL trigger + pg_notify event listener in Node.js, which avoids polling.
Outcome
The platform replaced the WhatsApp + spreadsheet workflow across all 6 depots within a 10-week phased rollout. Delivery exception rate (failed delivery attempts) dropped 35% in the 3 months after launch. attributed primarily to dispatchers being able to proactively reroute vehicles and the driver app's live manifest reducing address errors.
Customer service call volume dropped 60% as customers self-served their tracking queries through the portal.