Case Study

Food Delivery Aggregator for Multi-Restaurant Marketplace

How we built a FoodTech aggregator platform connecting 200+ restaurants with diners — with intelligent order routing, driver dispatch, and real-time tracking achieving <3min average delivery times.

Industry
FoodTech / E-Commerce
Duration
11 Months
Services
Full-Stack · Mobile · Real-Time
Markets
United States

FoodTech Marketplace · Real-Time Dispatch

200+
Restaurants
50K+
Orders/Month
<3min
Avg Delivery
Real-Time
Tracking

The Client's Vision

A regional food delivery operator had successfully onboarded 200+ restaurants across a dense urban market, but their operations were collapsing under scale. Orders were manually assigned to drivers via WhatsApp groups. Restaurants had no visibility into when drivers would arrive. Customers called support to ask “where's my order?” — and support had no real-time data to answer. Kitchen staff at popular restaurants were overwhelmed during lunch peaks because order flow was unpredictable.

The client needed a platform that could route orders to the nearest available restaurant location, dispatch drivers optimally based on proximity and capacity, sync order status in real time between restaurant tablets, driver apps, and the customer app, and handle payments and commissions across thousands of daily transactions. Speed and reliability were non-negotiable — the market was competitive, and a bad experience meant lost repeat business.

What Was Breaking

Order Routing

Orders came in without clear assignment to the right restaurant branch. Multi-location chains had to manually forward orders to the nearest kitchen. Duplicate orders sometimes went to wrong locations, causing delays and customer complaints.

Driver Dispatch

Drivers were assigned via human dispatchers or WhatsApp. Load balancing was poor — some drivers got too many orders while others sat idle. No visibility into driver availability or ETA back to restaurant zones.

Restaurant Onboarding

Each restaurant had different menu formats, operating hours, and POS systems. Manual data entry caused menu errors and pricing mismatches. New restaurant signup took weeks instead of days.

Real-Time Tracking

Customers had no live view of their order. Drivers shared location via WhatsApp, which was unreliable. Restaurants couldn't anticipate pickup times, leading to food sitting too long or drivers waiting.

The Architecture We Built

We built a three-sided marketplace: a Next.js web app for diners and restaurant management, React Native apps for drivers and restaurant kitchen displays, and a Node.js backend with Firebase for real-time events. Order routing uses geo-based rules to assign orders to the nearest restaurant branch. Driver dispatch uses a queue with proximity scoring — the system pushes assignments to the closest available driver. PostgreSQL holds orders, menus, and payments; Redis caches availability and live driver positions.

System Architecture

React Native — Customer, Driver & Kitchen Apps
Customer app for ordering and live tracking. Driver app for accepting orders and sharing GPS. Kitchen tablet for order queue and status updates
Next.js — Web App & Restaurant Portal
Customer web ordering, restaurant dashboard for menus and orders, and admin portal for operations and reporting
Node.js API & Order Engine
Order placement, routing logic, driver dispatch queue, and payment processing. Geo-based restaurant and driver matching
PostgreSQL — Orders, Menus & Users
Restaurants, menus, orders, drivers, and transaction history. Optimized for high write throughput and real-time queries
Redis & Firebase — Cache & Real-Time
Redis for driver availability, restaurant capacity, and rate limiting. Firebase Realtime Database for live order status and driver location sync

The driver dispatch algorithm was the hardest piece. We score drivers by distance to pickup, current load, and historical performance. Orders are pushed to the top-ranked available driver; if they don't accept within 30 seconds, we cascade to the next. Firebase syncs acceptance and status changes to all clients within milliseconds, so restaurants and customers see updates instantly.

Tech Stack

React Native
Next.js
Node.js
PostgreSQL
Redis
Firebase
Stripe
Geo Services

How We Delivered It

Phase 1 — Weeks 1–6
Discovery & Order Model

Mapped restaurant and driver workflows. Designed order lifecycle and status flow. Built geo-routing rules and restaurant branch assignment logic. Defined menu and menu-item data model for multi-vendor support.

Phase 2 — Weeks 7–20
Core Platform & Apps

Built Node.js order API and Stripe integration. Developed React Native customer and driver apps. Implemented restaurant portal for menus and order management. Firebase integration for real-time order status.

Phase 3 — Weeks 21–36
Dispatch & Tracking

Built driver dispatch queue with proximity scoring. Implemented GPS streaming and live map in customer app. Kitchen display tablet for order queue. Optimized for <3min average delivery in pilot zone.

Phase 4 — Weeks 37–44
Restaurant Onboarding & Scale

Built restaurant self-signup and menu import tools. Load-tested with 50K orders/month. Rolled out to full 200+ restaurant network. Monitored and tuned dispatch algorithm based on real-world performance.

The Impact

Manual routing
Automated dispatch
Geo-based order and driver assignment
No visibility
Real-time tracking
Live updates for customers and restaurants
Weeks to onboard
Days
Self-service restaurant signup and menu import
Support call volume
-65% reduction
Customers check app instead of calling
“We went from WhatsApp and spreadsheets to a platform that routes orders and dispatches drivers in seconds. Our average delivery time dropped to under three minutes in the pilot zone. Restaurant partners love the kitchen display — they know exactly when to start cooking.”
— COO, Food Delivery Operator

What Made This Work

Food delivery aggregates three real-time flows: customer orders, restaurant preparation, and driver movement. Any latency in syncing status between these sides creates friction — drivers arriving before food is ready, or food cooling while waiting for a driver. Firebase gave us sub-second updates across all clients without building a custom WebSocket infrastructure.

The dispatch algorithm had to balance fairness (drivers get equal opportunity), efficiency (minimize total delivery time), and availability (don't overload a single driver). We iterated on scoring weights using real order data — proximity mattered most, but load balancing prevented driver burnout during lunch peaks.

Restaurant onboarding was a hidden complexity. Menus vary wildly in structure — categories, modifiers, combos, availability windows. We built a flexible schema and a CSV import tool that maps columns to our model. New restaurants could go live in a day instead of a week, which was critical for scaling from 50 to 200+ partners.

Building a Food Delivery or Marketplace Platform?

We help FoodTech companies build real-time ordering, dispatch, and tracking systems. Let's talk about your architecture.

Book Strategy CallCase Studies