All Case Studies
Web + API Logistics & Supply Chain

Real-time Cargo Tracking Platform

Replaced a spreadsheet-based dispatch system with a live tracking platform handling 10,000+ daily shipments across 6 countries.

Logistics SaaS (Confidential) 14 weeks 3 engineers 2024
10k+ Daily shipments
62% Dispatch time cut
99.98% Uptime
Tech Stack
Next.jsNode.jsPostgreSQLRedisWebSocketsDockerAWS

The Challenge

The client's operations team was managing international cargo dispatch across 6 countries using a combination of Excel spreadsheets and WhatsApp groups. With 10,000+ daily shipments, data was scattered, decisions were reactive, and the error rate was climbing. They needed a real-time platform that their 200+ field agents could use on any device.

Our Solution

We designed a server-sent events architecture for live shipment updates, a role-based web interface for dispatchers and field agents, and a RESTful API consumed by both the web app and a React Native field companion app. PostgreSQL handles persistence; Redis manages the event bus and session state. All infrastructure runs on AWS ECS with auto-scaling.

The Results

Within 3 months of launch, dispatch time dropped by 62%, manual errors fell by 91%, and field agents submitted updates 4× faster than the previous WhatsApp-based process. The platform now handles peak loads of 800 concurrent users without degradation.

SYSTEM ARCHITECTURE

Under the Hood: Architecture & Data Flow

Distributed event-driven architecture featuring dual client interfaces, low-latency SSE message fanout via Redis Pub/Sub, and high-concurrency multi-tenant PostgreSQL storage.

Throughput: 10,000+ shipments/day
Latency: < 50ms event fanout
Edge & Client Tier
Client
Dispatcher Operations Console Next.js 14 / React 18
Real-time multi-pane dashboard for dispatchers
SSE Event StreamInteractive Map LayerRole-scoped UI
Field Courier Companion React Native / SQLite
Mobile field application with offline queue
Offline SQLite StoreBarcode & OCR ScannerAPNs/FCM Push
HTTPS / TLS 1.3
Gateway & Event Bus
Ingress
Nginx Ingress Proxy Nginx 1.25 / Brotli
TLS termination and routing gateway
TLS 1.3 TerminationRate LimitingHTTP/2 Multiplexing
Real-time Event Broadcaster Redis 7 / Pub-Sub
Sub-50ms message fanout engine
Sub-50ms FanoutIn-memory QueueChannel Multiplexing
Internal Mesh / gRPC
Application Services
Compute
Shipment Lifecycle Engine Node.js / Express
Core cargo dispatch and state machine
State Machine EngineJWT Claims ValidationETA Calculations
Telemetry Ingestion Worker Node.js Cluster
High-volume GPS and scan event processor
Geofence DetectionBatch IngestionPayload Validation
Persistence & State Sync
Persistence & Cache
Storage
PostgreSQL 15 Database PostgreSQL 15 (AWS RDS)
ACID relational store with Row-Level Security
Row-Level Security (RLS)Yearly Audit PartitionsRead Replicas
Redis State & Session Cache Redis 7 / ElastiCache
Courier live sessions and rate limits
Ephemeral CoordinatesActive Token CacheDistributed Locks
Component Details
STEP 1 OF 5
HTTPS / TLS 1.3
Field Courier Companion Nginx Ingress Proxy
Field courier scans cargo QR code; app encrypts payload and dispatches via HTTPS request.
Key Engineering Decisions & Trade-offs
✓ Server-Sent Events over WebSockets for Dispatchers

Because dispatchers only need one-way real-time push from the server, SSE dramatically reduced connection overhead and proxy reconnect storms compared to bidirectional WebSockets.

✓ PostgreSQL Row-Level Security (RLS)

Allowed all 6 regional teams to share a single consolidated database cluster while preventing accidental cross-tenant data leaks at the database kernel level.

TECHNICAL DEPTH

Deep Dive Specifications

Architecture

Event-driven architecture using SSE for live data push to browsers without polling overhead. Redis Pub/Sub fans out shipment updates to all connected dispatcher clients in under 50ms. PostgreSQL row-level security enforces tenant isolation across 6 country instances on a single database cluster.

Auth & Roles

JWT-based auth with role scopes: DISPATCHER, AGENT, MANAGER, SUPER_ADMIN. Each role sees a different UI surface. All API routes validated server-side against the JWT scope — the frontend permission system is UI-only and never trusted for data access.

Mobile Agent App

React Native app for iOS and Android used by field agents to scan barcodes, attach photos, and submit status updates. Offline queue syncs when connectivity resumes. Push notifications via APNs/FCM alert agents on high-priority assignments.

SIMILAR PROJECT IN MIND?

Let's talk about what you need.

Start a Conversation More Case Studies
See our work Start a project