The problem
Three sides of a marketplace had to be balanced at once. Customers want essentials fast and at a fair price. Neighbourhood stores need to never miss an order. Independent riders want transparent, worthwhile work. A single dispatch algorithm satisfies none of them — so the delivery had to be priced by the people doing it, without letting that openness become a fraud surface.
How we built it
- Split the platform into focused NestJS services — identity, core (stores, riders, catalogue, cities), orders, wallet, product ingestion and notifications — talking over a RabbitMQ event bus behind a single path-based API gateway.
- Built delivery as a reverse auction: each order opens a bidding job, riders submit a price and ETA, and the customer accepts — or an auto-strategy picks the lowest price, fastest ETA or a weighted blend.
- Secured the physical handoff with a dual-OTP handshake — a pickup code between rider and store, and a separate delivery code from the customer that an order cannot settle without.
- Ran money through an in-house wallet with holds, COD escrow and delivery-time settlement that splits funds between the stores and the rider's fee.
- Scoped everything by city and streamed live rider location to the customer during delivery, with a dedicated ingestion service keeping each store's catalogue in sync.
- Shipped two React Native apps against the same API — a customer app to order, track and pay, and a rider app to browse city-scoped jobs, bid and deliver.
The result
Orders move through a bidding-driven lifecycle with live rider tracking, an in-house wallet with COD escrow, and a dual-OTP pickup-and-delivery handshake that no order can settle without.
