v1.0.0
Home Buy Now

FoodFleet Documentation

A complete, production-ready food delivery SaaS platform with multi-vendor support, real-time tracking, PWA customer app, and more.

Version 1.0.0 β€” Stable release. All core modules included. Suitable for production deployment.

What is FoodFleet?

FoodFleet is a complete Food Delivery SaaS Platform that lets you launch your own food delivery marketplace β€” similar to Zomato or Swiggy β€” with full control over branding, pricing, and operations.

The platform includes four separate applications:

ApplicationTechDefault PortPurpose
Customer PWAReact.js (PWA)3000End-user food ordering app
Admin PanelReact.js3001Super-admin platform management
Vendor PanelReact.js3002Restaurant owner management
Delivery AppReact.js (PWA)3003Delivery partner mobile app
Backend APINode.js + Express5000RESTful API + Socket.io server

System Requirements

Node.js 18+ MySQL 8.0+ npm 9+
RequirementMinimumRecommended
Node.js18.0.020.x LTS
MySQL8.08.0.x latest
RAM2 GB4 GB+
Disk5 GB20 GB+ (for uploads)
OSWindows 10/Ubuntu 20.04Ubuntu 22.04 LTS
XAMPP (local)8.2+Latest stable

For Windows local development, XAMPP is recommended. For production, use a VPS running Ubuntu 22.04 with Nginx as a reverse proxy.

Installation

1

Extract the package

Download and extract the zip file to your web server root.

bash
# Extract to XAMPP htdocs (Windows)
unzip foodfleet-saas.zip -d C:/xampp/htdocs/
cd C:/xampp/htdocs/foodfleet-saas
2

Set up the database

Create a MySQL database and import the SQL dump.

bash
# Open MySQL (or use phpMyAdmin)
mysql -u root -p

# Create database
CREATE DATABASE foodfleet_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;

# Import schema + seed data
mysql -u root -p foodfleet_db < database/foodfleet_seed.sql
3

Configure environment

Copy the example env file and fill in your credentials.

bash
cd backend
cp .env.example .env
# Edit .env with your DB credentials, API keys, etc.
4

Install backend dependencies

bash
cd backend
npm install
5

Install frontend dependencies for all apps

bash
# Install all at once
cd ../customer-app && npm install
cd ../admin-panel && npm install
cd ../vendor-panel && npm install
cd ../delivery-app && npm install
6

Start all services

Open separate terminals for each service, or use the included startup script.

bash
# Option A: Start all with script
npm run start:all

# Option B: Start individually
# Terminal 1 - Backend API
cd backend && npm start       # Port 5000

# Terminal 2 - Customer App
cd customer-app && npm start  # Port 3000

# Terminal 3 - Admin Panel
cd admin-panel && npm start   # Port 3001

# Terminal 4 - Vendor Panel
cd vendor-panel && npm start  # Port 3002

# Terminal 5 - Delivery App
cd delivery-app && npm start  # Port 3003

Ensure XAMPP MySQL service is running before starting the backend. The backend will fail to connect if MySQL is not available on port 3306.

First Run Guide

After all services are started, open your browser and navigate to http://localhost:3001 to access the Admin Panel.

1

Log in to Admin Panel

Use the default super-admin credentials: [email protected] / Admin@123

2

Configure platform settings

Go to Settings β†’ Platform to set your platform name, logo, currency, and timezone.

3

Add your first city and zone

Navigate to Zones β†’ Add City. Define the delivery radius and service area on the map.

4

Approve the demo restaurant

Go to Vendors β†’ Click on Spice Garden β†’ Set status to Active.

5

Place a test order

Open http://localhost:3000, log in as the demo customer, and place a test order to verify the full flow.

Demo Accounts

All four demo accounts are pre-seeded in the database. Use them to explore each module.

RoleEmailPasswordURL
Super Admin[email protected]Admin@123:3001
Vendor (Spice Garden)[email protected]Vendor@123:3002
Delivery Partner[email protected]Delivery@123:3003
Customer[email protected]Customer@123:3000

System Architecture Overview

FoodFleet follows a microservice-inspired monorepo architecture with a single Node.js backend serving all four frontend applications via REST API and Socket.io.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ CLIENT LAYER β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Customer PWAβ”‚ Admin Panel β”‚Vendor Panel β”‚ Delivery App β”‚ β”‚ :3000 β”‚ :3001 β”‚ :3002 β”‚ :3003 β”‚ β”‚ React PWA β”‚ React.js β”‚ React.js β”‚ React PWA β”‚ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ REST API + WebSocket β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ API LAYER β”‚ β”‚ Node.js + Express.js :5000 β”‚ β”‚ Socket.io (Real-time events) β”‚ β”‚ JWT Authentication Middleware β”‚ β”‚ Multer (File uploads) + Redis (Cache) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ DATA LAYER β”‚ β”‚ MySQL 8.0 (Primary DB) Redis (Sessions + Cache) β”‚ β”‚ Local disk / S3 (Media) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Real-time Event Flow

Order lifecycle events are propagated via Socket.io rooms. Each order has a unique room that the customer, vendor, admin, and delivery partner all subscribe to.

Customer places order β†’ Backend creates order (MySQL) β†’ Socket emit: vendor:new_order β†’ Vendor accepts / KDS confirms β†’ Socket emit: order:accepted β†’ Auto-assign delivery partner β†’ Socket emit: delivery:new_request β†’ Delivery partner accepts β†’ Socket emit: order:out_for_delivery β†’ Live GPS updates every 5 seconds β†’ OTP confirmation on delivery β†’ Socket emit: order:delivered β†’ Payout ledger updated automatically

Module Descriptions

ModuleLocationDescription
customer-app//customer-appReact PWA for end customers. Order food, track orders, manage wallet.
admin-panel//admin-panelSuper-admin dashboard. Complete platform control, analytics, config.
vendor-panel//vendor-panelRestaurant owner panel. Menu, orders, KDS, reports, payouts.
delivery-app//delivery-appDelivery partner PWA. Order acceptance, navigation, earnings.
backend//backendNode.js API server. All business logic, socket events, auth, DB.
database//databaseSQL schema + seed data. Import once to get started.

Tech Stack

LayerTechnologyVersionPurpose
FrontendReact.js18.xUI for all 4 panels
State ManagementRedux Toolkit2.xGlobal state
Real-timeSocket.io4.xLive orders, tracking
BackendNode.js + Express20 / 4.xREST API server
DatabaseMySQL8.0Primary data store
ORMSequelize6.xDB queries/migrations
CacheRedis7.xSessions, rate limiting
AuthJWT + bcryptβ€”Secure authentication
MapsGoogle Maps APIβ€”Live tracking, routing
StorageMulter + Local/S3β€”Image uploads
EmailNodemailer6.xTransactional emails
PushFirebase FCMβ€”Push notifications

API Authentication

All protected API endpoints require a Bearer JWT token in the Authorization header.

http
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Authentication Endpoints

MethodEndpointDescriptionAuth
POST/api/auth/loginLogin (all roles)No
POST/api/auth/registerCustomer registrationNo
POST/api/auth/refreshRefresh access tokenNo
POST/api/auth/logoutLogout and invalidate tokenYes
POST/api/auth/forgot-passwordSend password reset emailNo
POST/api/auth/reset-passwordReset password with tokenNo

Login Request Example

json β€” POST /api/auth/login
{
  "email": "[email protected]",
  "password": "Customer@123",
  "role": "customer"
}
json β€” Response
{
  "success": true,
  "data": {
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "user": {
      "id": 1,
      "name": "Demo Customer",
      "email": "[email protected]",
      "role": "customer",
      "wallet_balance": 250.00
    }
  }
}

Customer API Endpoints

MethodEndpointDescriptionAuth
GET/api/restaurantsList restaurants (with geo filter)No
GET/api/restaurants/:id/menuGet restaurant menuNo
POST/api/ordersPlace new orderYes
GET/api/ordersGet customer order historyYes
GET/api/orders/:id/trackReal-time order trackingYes
GET/api/customer/profileGet customer profileYes
PUT/api/customer/profileUpdate profileYes
GET/api/customer/addressesGet saved addressesYes
POST/api/customer/addressesAdd new addressYes
GET/api/customer/walletGet wallet balance and historyYes
POST/api/customer/wallet/addAdd money to walletYes
POST/api/reviewsSubmit order reviewYes
POST/api/coupons/validateValidate coupon codeYes
GET/api/recommendationsAI food recommendationsYes

Vendor API Endpoints

MethodEndpointDescriptionAuth
GET/api/vendor/ordersGet incoming ordersVendor
PUT/api/vendor/orders/:id/statusAccept/reject/ready orderVendor
GET/api/vendor/menuGet restaurant menuVendor
POST/api/vendor/menu/itemsAdd menu itemVendor
PUT/api/vendor/menu/items/:idUpdate menu itemVendor
DELETE/api/vendor/menu/items/:idDelete menu itemVendor
GET/api/vendor/analyticsRevenue and order analyticsVendor
GET/api/vendor/earningsPayout and earnings ledgerVendor
GET/api/vendor/profileRestaurant profileVendor
PUT/api/vendor/profileUpdate restaurant detailsVendor
PUT/api/vendor/toggle-statusOpen/close restaurantVendor

Admin API Endpoints

MethodEndpointDescriptionAuth
GET/api/admin/dashboardPlatform overview statsAdmin
GET/api/admin/vendorsList all vendorsAdmin
PUT/api/admin/vendors/:id/statusApprove/suspend vendorAdmin
GET/api/admin/customersList all customersAdmin
GET/api/admin/ordersAll platform ordersAdmin
GET/api/admin/analyticsFull platform analyticsAdmin
POST/api/admin/couponsCreate couponAdmin
POST/api/admin/bannersAdd homepage bannerAdmin
GET/api/admin/zonesManage delivery zonesAdmin
GET/api/admin/settingsGet platform settingsAdmin
PUT/api/admin/settingsUpdate platform settingsAdmin
GET/api/admin/payoutsPending payout requestsAdmin
POST/api/admin/payouts/:id/processProcess vendor payoutAdmin

Delivery API Endpoints

MethodEndpointDescriptionAuth
PUT/api/delivery/toggle-availabilityGo online/offlineDelivery
GET/api/delivery/orders/pendingPending order requestsDelivery
POST/api/delivery/orders/:id/acceptAccept orderDelivery
POST/api/delivery/orders/:id/declineDecline orderDelivery
POST/api/delivery/orders/:id/picked-upMark as picked upDelivery
POST/api/delivery/orders/:id/deliverConfirm delivery (OTP)Delivery
POST/api/delivery/locationUpdate GPS locationDelivery
GET/api/delivery/earningsEarnings dashboardDelivery

Customer PWA Guide

The Customer App is a React-based PWA that customers can install on iOS and Android directly from the browser. It supports offline menu browsing via service workers.

Key Files

structure
customer-app/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ manifest.json      # PWA manifest
β”‚   └── sw.js              # Service worker
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/             # Route pages
β”‚   β”œβ”€β”€ components/        # Shared UI components
β”‚   β”œβ”€β”€ redux/             # State management
β”‚   β”œβ”€β”€ hooks/             # Custom React hooks
β”‚   └── utils/             # Helpers, axios config
└── .env                   # API URL, Google Maps key

PWA Installation

The customer app includes a built-in install prompt. When users open the app in Chrome or Safari, a banner prompts them to "Add to Home Screen" for a native app-like experience.

For iOS Safari, users must manually tap Share β†’ Add to Home Screen. The install prompt API is not available on iOS.

Vendor Panel Guide

The Vendor Panel gives restaurant owners full control over their business on the platform.

Key Features Walkthrough

1

Menu Management

Navigate to Menu β†’ Categories to create categories. Under each category, add items with photos, prices, variants (sizes), and addons (toppings).

2

KDS (Kitchen Display)

Go to Orders β†’ KDS View for a full-screen kitchen display. New orders auto-appear with audio alert. Mark items as prepared in sequence.

3

Operating Hours

Under Settings β†’ Hours, set day-wise open/close times. Toggle "Holiday Mode" to instantly close with a custom message.

Admin Panel Guide

The Admin Panel is the nerve center of the platform. All operational, financial, and configuration controls are here.

Commission Management

Go to Finance β†’ Commissions. Set platform-wide default commission rate or override per-vendor. Commission is automatically deducted from vendor earnings on each order.

Multi-City Setup

Navigate to Zones β†’ Cities β†’ Add City. Define the city polygon on the map, set default delivery fee formula, and assign an admin manager if needed.

Delivery App Guide

The Delivery App is optimized for mobile browsers. Delivery partners work entirely from the PWA β€” no native app needed.

Order Flow

1

Go Online

Tap the big toggle on the home screen. Location tracking starts automatically via browser Geolocation API.

2

Receive Order

A card appears with restaurant and customer location. Accept within 30 seconds or the system tries another partner.

3

Navigate to Restaurant

Tap "Navigate to Restaurant" to open turn-by-turn directions in Google Maps (or preferred app).

4

Confirm Delivery

Ask customer for the 4-digit OTP, enter it to confirm delivery. Earnings are credited instantly.

Environment Variables

Copy backend/.env.example to backend/.env and fill in your values.

VARIABLEDEFAULTDESCRIPTION
PORT5000API server port
DB_HOSTlocalhostMySQL host
DB_PORT3306MySQL port
DB_NAMEfoodfleet_dbDatabase name
DB_USERrootMySQL username
DB_PASSWORDMySQL password
JWT_SECRETchange_thisJWT signing secret (use random 64-char string)
JWT_EXPIRE7dToken expiry duration
REDIS_URLredis://localhost:6379Redis connection URL
GOOGLE_MAPS_API_KEYGoogle Maps API key (enable Geocoding + Directions)
RAZORPAY_KEY_IDRazorpay API key
RAZORPAY_KEY_SECRETRazorpay secret
SMTP_HOSTsmtp.gmail.comSMTP server for emails
SMTP_USEREmail address
SMTP_PASSEmail password / app password
FCM_SERVER_KEYFirebase Cloud Messaging key for push notifications
UPLOAD_PATH./uploadsLocal file storage path (or use S3)
CLIENT_URLhttp://localhost:3000Customer app URL (CORS)

Payment Gateway Setup

Razorpay (Recommended for India)

1

Create Razorpay account

Sign up at razorpay.com and complete KYC verification.

2

Get API keys

Go to Settings β†’ API Keys β†’ Generate Test Keys. Copy Key ID and Secret to your .env file.

3

Set in Admin Panel

Navigate to Admin β†’ Settings β†’ Payments. Enter your Razorpay credentials and toggle Razorpay to Active.

Always use Test Keys during development. Switch to Live Keys only when deploying to production after Razorpay approves your account.

Platform Settings

Access via Admin Panel β†’ Settings. Key configurable options:

SettingDefaultDescription
Platform NameFoodFleetDisplayed across all apps
Default Commission18%Platform commission on each order
Min Order Amountβ‚Ή99Minimum cart value to place order
Default Delivery Feeβ‚Ή30Base delivery charge
Free Delivery Thresholdβ‚Ή299Orders above this get free delivery
GST Rate5%Tax applied to food items
Referral Bonusβ‚Ή50Wallet credit for successful referral
Delivery OTPEnabledRequire OTP for delivery confirmation
Auto-assign DeliveryEnabledAuto-assign nearest available partner

Branding & Customization

Update the following files to rebrand the platform:

locations
# Logo files
customer-app/public/logo.png          # Customer app favicon/logo
admin-panel/public/logo.png           # Admin panel logo
vendor-panel/public/logo.png          # Vendor panel logo

# App name (update in each app)
customer-app/public/manifest.json     # PWA manifest name
customer-app/src/constants/config.js  # APP_NAME constant

# Theme colors (CSS variables)
customer-app/src/styles/theme.css     # --primary-color: #FF6B35;
admin-panel/src/styles/theme.css
vendor-panel/src/styles/theme.css

Alternatively, use the Admin Panel β†’ Settings β†’ Branding section to upload logos and change the color scheme without touching code.

White-label Setup

For complete white-labeling with a custom domain:

1

Point domain DNS

Create A records pointing your domain/subdomains to your server IP:
app.yourdomain.com β†’ Customer App (3000)
admin.yourdomain.com β†’ Admin Panel (3001)

2

Configure Nginx reverse proxy

server {
    listen 80;
    server_name app.yourdomain.com;
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
    }
}
3

Install SSL certificate

Use Certbot (Let's Encrypt): sudo certbot --nginx -d app.yourdomain.com

FAQ & Troubleshooting

Backend fails to start β€” "ER_ACCESS_DENIED_ERROR"

Your MySQL credentials in .env are incorrect. Verify DB_USER and DB_PASSWORD match your MySQL setup. On fresh XAMPP installs, the default is root with no password.

Socket.io connection refused on delivery tracking

Ensure CLIENT_URL in .env matches the exact origin of your customer app including the port. CORS blocks socket connections if origins don't match exactly.

Google Maps not loading

Verify your Google Maps API key has the following APIs enabled: Maps JavaScript API, Geocoding API, Directions API, and Places API. Also ensure the key is not restricted to specific domains during local testing.

PWA install prompt not appearing

The install prompt requires HTTPS in production. Locally, it works on localhost but not on 192.168.x.x IP addresses. Ensure the manifest.json has all required fields and a valid 512x512 icon.

Still stuck? Email support at [email protected] with your error log, Node.js version, and OS details. Enterprise customers get a dedicated Slack channel.

Common Error Reference

ErrorLikely CauseFix
ECONNREFUSED 3306MySQL not runningStart MySQL service in XAMPP control panel
JWT malformedCorrupted/expired tokenClear localStorage and log in again
CORS policy errorWrong CLIENT_URL in .envMatch CLIENT_URL exactly to frontend origin
Cannot find modulenpm install not runRun npm install in the affected directory
Port 3000 in useAnother process on same portKill process or change port in .env
Orders not updating liveSocket.io disconnectedCheck Redis is running; verify socket connection in browser DevTools