Order & Fleet Management Backend, ML Dispatch
Outcome
One backend serving three audiences and four front ends at once, with dispatch automated end to end: daily order assignment scaled from roughly 1,000 to roughly 3,500 orders, replacing a team of human dispatchers. Led as backend lead across a six-person web team plus a separate mobile team.
Overview
The complete backend behind an order-and-fleet management platform, built and led by a team of three backend engineers alongside three frontend developers and a separate mobile team. Rather than one service, it is a set of microservices covering the order and rider lifecycles, each encoding the client's own handling policies. The work spanned the database end to end — schema design, query optimisation, ongoing management and webhook handling — plus the REST APIs behind every surface of the product: the management portal, the onboarding panel, the driver portal and the riders' mobile app.
Three groups feed the same flow — the order providers who are the client's own customers, the internal management team, and the riders in the field — and every order follows one defined path through it. Riders join through a multi-step signup procedure they must complete before they can take work, and from there the platform handles blocking and unblocking, availability, and live location tracking, all behind JWT auth with per-role access controls.
Dispatch itself is automated. A K-Means clustering engine groups open orders against available riders on location, capacity and timing, then a business-rule layer applies the client's vendor and SLA constraints before an order is assigned. It replaced a team of human dispatchers and took daily assignment from roughly 1,000 orders to roughly 3,500.
Screens & Demos


Architecture & Pipeline
01
Order Providers
Client's own customers
02
Management Portal
Internal team
03
Onboarding & Driver Portals
Multi-step rider signup
04
Rider Mobile App
Field updates · live location
05
Django REST APIs
Shared entry point
- Django
06
JWT Authentication
Per-role access controls
07
Order & Rider Microservices
Handling policies per order
08
K-Means Assignment
Scikit-learn · location · capacity · time
- Scikit-learn
09
Business-Rule Filter
Vendor & SLA constraints
10
MongoDB
Schema design · optimized queries
- MongoDB
11
Database Webhooks
Event-driven updates
12
Background Queue
Celery · RabbitMQ · Redis
- Celery
- RabbitMQ
- Redis
13
Slack / Sentry · Dynoscale
Monitoring + auto-scale
- Slack
End-to-end flow, in order. Scroll sideways on a narrow screen.
Key Features
- Microservices covering the order and rider lifecycles separately
- K-Means clustering engine assigning open orders to available riders
- Business-rule layer applying the client's vendor and SLA constraints to every assignment
- 3.5× throughput — from ~1,000 to ~3,500 orders assigned per day, replacing manual dispatch
- Multi-step rider signup procedure riders complete before taking work
- Driver onboarding, block/unblock and availability endpoints
- Real-time driver location tracking
- Database design, development and ongoing management, end to end
- Database webhook handling for event-driven updates
- One order flow shared by order providers, the management team, and riders
- REST APIs behind all four surfaces: management portal, onboarding panel, driver portal, mobile app
- Advanced filtering across multiple order listing endpoints
- JWT authentication with per-role access controls
- Celery + RabbitMQ background queues
- Optimized MongoDB queries with scheduled maintenance scripts
- Slack and Sentry alerting; Dynoscale for auto-scaling
- Deployed on Heroku via GitHub CI/CD