Download the recorded evidence
← Engineering

Clear responsibilities.
Durable decisions.

PostgreSQL owns durable order state. Redis supports short-lived coordination. Background work follows committed events.

Humraahi application architectureCustomer and vendor Android apps communicate with the Express API using HTTP and Socket.IO. The website sends waitlist requests by HTTP. The API uses PostgreSQL and Redis and integrates with Razorpay. A background worker claims durable outbox work from PostgreSQL and sends notifications through FCM. Browser simulations run locally.HTTP + Socket.IOWaitlist HTTPOrdersWebhooksTransactional writesAuth / realtimeClaim / acknowledgeSend notificationCustomer AndroidOrders · tracking · handoverVendor AndroidClaims · location · deliveryNext.js websiteStory · waitlist · simulatorExpress APIAuth · validation · Socket.IORazorpayPayment orders · webhooksPostgreSQL + PostGISOrders · events · outboxRedisOTP · limits · realtime adapterBackground workerLeases · fan-out · retriesFCMPush delivery provider
Logical architecture. The worker can run separately from the HTTP API. The browser tracking simulator runs locally using the shared engine. This diagram describes responsibilities, not a production hosting topology.

The boundaries that matter.

Every transition has a boundary.

The normal journey advances from placed to delivered. Cancellation and expiry are explicit terminal states. These edges come directly from the server’s transition table.

Humraahi order-state graphPlaced can become claimed, cancelled or expired. Claimed can become arrived or cancelled. Arrived becomes verified, verified becomes paid, and paid becomes delivered. Delivered, cancelled and expired have no outgoing transitions.PLACEDCLAIMEDARRIVEDVERIFIEDPAIDDELIVEREDCANCELLEDEXPIRED
Double outlines indicate terminal states. The graph shows state legality; actor permissions and other guards are enforced separately.
Read the transition table
PLACED
CLAIMED, CANCELLED, EXPIRED
CLAIMED
ARRIVED, CANCELLED
ARRIVED
VERIFIED
VERIFIED
PAID
PAID
DELIVERED
DELIVERED
Terminal — no outgoing transitions
CANCELLED
Terminal — no outgoing transitions
EXPIRED
Terminal — no outgoing transitions

A guarded SQL update checks the previous state. The transition event is inserted in the same transaction. Claims also lock the order and vendor rows; a database constraint prevents multiple active orders for one vendor. QR and payment transitions use their dedicated services.