Delivery Marketplace API
The backend of a three-sided delivery marketplace (customers, sellers and delivery partners): Express, PostgreSQL and Socket.IO.
Android foreground serviceGPS every 10 sSocket.IOExpress backendcustomer's map
RazorpayZoho PaymentsGoogle Routes, Places, DirectionsMSG91 SMS and OTPAWS S3FCM push
The product
One TypeScript backend serves a three-sided delivery marketplace app: customers shop and book parcels, sellers run their stores, and delivery partners pick up and deliver.
We were a team of three. I wrote most of the backend, including all of payments, sockets, push notifications, caching, embeddings, maps and the deploy pipeline.
Under the hood
THE ENGINEERING
- 01
Payments behind one provider interface (Zoho first, Razorpay as the fallback); an order is marked paid only after the provider's own server confirms it
- 02
Live tracking over Socket.IO: the partner app sends its location every 10 s and the customer follows it on a map with route and ETA
- 03
Semantic search with pgvector: item embeddings (HNSW index) matched by cosine similarity against 214 subcategory descriptions to fill category pages
- 04
Order offers go to one free partner at a time with a 15 s window; unclaimed orders wait in a basket indexed by Uber H3 cell, so partners see open orders in their own cell
- 05
Phone OTP sign-in (MSG91) through a short-lived transit token to an access token
- 06
GitHub Actions deploys on every push: SSH, build, PM2 reload
Next case study
Nyas →