Last-Mile Delivery Tracker
Delivery management platform
Orders, zones, rate cards, agent assignment and an auditable tracking timeline for customers, agents and admins.
A three-sided delivery platform. Customers place orders with an auto-calculated charge, admins configure zones and rate cards and assign agents, and agents move orders through delivery. Customers get an email at every status change, a full tracking timeline, and a reschedule flow when a delivery fails.
What it does
- Order status state machine with an explicit transition map; every change writes to an append-only, immutable audit table that powers the tracking timeline.
- Rate engine driven entirely by admin-configured rows: volumetric vs actual billable weight, intra or inter-zone rate cards, and flat or percentage COD surcharges.
- Quotes are shown before confirmation and persisted on the order, so later rate-card edits never change a placed order's price.
- Auto-assignment prefers agents in the drop zone, then the pickup zone, then any available agent, with haversine re-ranking ready for live GPS.
- Failed deliveries loop through a reschedule flow that clears the agent and keeps its own audit trail.
- Email on every status change via Nodemailer, with every attempt logged; SMS is stubbed so the app runs end to end without credentials.
- JWT auth with role guards for customers, agents and admins; SQLite by default and a Prisma schema ready for Postgres.
Architecture
The rate engine, zone service, assignment service, order-status service and notification service each live in their own module, apart from the HTTP layer. Zones are detected by mapping each pre-registered area and pincode to exactly one zone, so lookup is deterministic with no address parsing. The repo includes a system-design write-up and seed data for every role.