
About the project
The challenge
A grocery retailer with several branches wanted online ordering in which each order is fulfilled by the closest store, delivered by that store's riders, and visible to staff, riders and customers as it moves. The starting point was a single-store e-commerce backend with no concept of branches, riders or delivery.
What was built
That codebase was extended into a multi-store delivery API with about 198 endpoints and 21 data models.
Addresses are checked by location. When a customer saves an address, and again at checkout, a MongoDB geo query finds the nearest store inside the delivery radius set by the admin and assigns the order to it.
Online payments run through Razorpay. No order is stored until payment is confirmed: the webhook verifies Razorpay's signature, creates the order once even if the call arrives twice, records the payment and triggers notifications. Stripe and cash on delivery are also supported.
Orders follow a rule-checked path from pending to delivered, with cancel, return, refund and replacement routes and an automatic status history. Riders sign in with a WhatsApp code, complete identity checks, work in shifts and receive orders grouped into delivery batches. Branch admins see only their own store.
Stores, riders and customers get live Socket.IO events, and customers receive WhatsApp messages for login codes, order confirmation and rider assignment. A bulk importer produces a validated Excel template and stages uploads before they are published to the catalogue.
The outcome
One API covers customers, platform and branch admins, and riders, and ships as a Docker image.
Gallery



0 likes · 0 views · Nov 29, 2026
Node.js API for multi-store grocery delivery: nearest-store routing, rider batches, Razorpay payments and live Socket.IO updates.