A high-performance, real-time geospatial logistics platform designed to simulate Quick-Commerce delivery and manage 100+ autonomous delivery drivers with sub-second latency.
This project demonstrates system design at scale, combining real-time streaming, geospatial indexing, and transactional consistency using a hybrid database architecture.
๐ *Built to showcase backend performance optimization, real-time systems, and distributed data handling
๐ Demo Video:
The demo video is hosted under GitHub Issues for easy access and versioning.
โก๏ธ Click here to watch the demo
(Open the linked issue to view the video showcasing real-time tracking, dispatching, and live map updates)
The system is designed to handle the C10K problem by clearly separating Hot data (real-time locations) from Cold data (orders & transactions).
-
Simulator (Python)
- Autonomous agents calculate routes using OSRM
- Push batched location updates (~20Hz) to the backend
-
Hot Path (Real-Time)
- Node.js ingests location streams
- Writes directly to Redis (Pipelines)
- Broadcasts updates to clients via Socket.io
-
Cold Path (Transactional)
- On order creation:
- Backend queries Redis using GEORADIUS
- Nearest
IDLEdriver is selected & locked - Order is persisted in PostgreSQL
- On order creation:
This project demonstrates a hybrid database approach optimized for performance and reliability.
Used for critical data that must never be lost, such as:
- Orders
- Financial records
- Delivery history
| id | customer_name | item | status | driver_id | delivery_lat | delivery_lng |
|---|---|---|---|---|---|---|
| 101 | Alice Johnson | Laptop | DELIVERED | driver_5 | 51.507 | -0.127 |
| 102 | Bob Smith | Pizza | ASSIGNED | driver_12 | 51.515 | -0.091 |
| 103 | Charlie Day | Sushi | PICKED_UP | driver_3 | 51.490 | -0.201 |
๐ pgAdmin Access:
http://localhost:5050
Used for ultra-fast writes and spatial queries.
# Redis CLI
GEORADIUS drivers -0.12 51.50 5 km ASC WITHDIST
1) "driver_5" (0.2 km)
2) "driver_12" (1.4 km)
3) "driver_8" (3.1 km){
"driver_5": "ASSIGNED",
"driver_12": "IDLE",
"driver_3": "PICKUP"
}-
Real-Time Tracking
Sub-second latency using Redis + Socket.io -
Smart Dispatching
Automatically assigns the nearest IDLE driver using geospatial queries -
Smooth Animation
Client-side drift interpolation converts 1Hz server ticks into 60fps motion -
Realistic Simulation
Python agents follow real road geometry and traffic rules via OSRM -
Containerized Setup
Fully Dockerized (Frontend, Backend, Databases, Simulator)
- React.js
- Leaflet
- Socket.io-client
- CSS3
- Node.js
- Express
- Socket.io
- Redis โ Geospatial indexing & caching
- PostgreSQL โ Relational persistence (Sequelize ORM)
- Python
- Requests
- Polyline
- Docker
- Docker Compose
- Docker
- Docker Compose
git clone https://github.com/yourusername/logistics-simulator.git
cd logistics-simulatordocker-compose up --buildThis starts Redis, PostgreSQL, Backend, and Frontend.
cd simulator
pip install -r requirements.txt
python main.py- Frontend Dashboard: http://localhost:3000
- pgAdmin: http://localhost:5050
- Email:
admin@admin.com - Password:
admin
- Email:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/warehouses |
Get list of warehouse locations |
| POST | /api/driver-locations |
Batch update driver positions |
| POST | /api/orders |
Create a new delivery order |
| POST | /api/orders/finish |
Mark an order as delivered |
-
ETA Calculation
Display dynamic arrival times using OSRM duration data -
Hot Zones Visualization
Heatmaps for high-demand areas -
Vehicle Types
Scooters vs Vans with different speeds & capacities

