Skip to content
wasim0028Public

About

Full-stack MERN food delivery platform built as three services on one shared API. Customer storefront, admin dashboard with revenue charts, and a Node/Express API. Razorpay UPI and Cash on Delivery, JWT auth, order tracking, dark mode.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

FoodEX — order food online

FoodEX

A full-stack food delivery application — customer storefront, admin dashboard, and REST API.

React Node.js Express MongoDB Vite Stripe


Overview

FoodEX is a MERN food delivery platform built as three services that run side by side.

Service Folder Port What it is
API backend/ 4000 Express + MongoDB — auth, menu, orders, payments
Storefront frontend/ 5173 What customers browse and order from
Admin admin/ 5174 Dashboard for menu, orders, restaurants, complaints

Features

For customers

  • Browse dishes by category, search, and sort by rating or price
  • Add to cart with live quantity controls, saved server-side per account
  • Checkout via Stripe, Razorpay (UPI), or Cash on Delivery
  • Order history with live status — Food Processing → Out for delivery → Delivered
  • Contact form for complaints, with a reference code
  • Light / dark theme that follows your operating system
  • Responsive down to small phones

For the restaurant owner

  • Dashboard with revenue, order volume, and a 7-day chart
  • Add, edit and remove dishes — including replacing photos
  • Set discounts with a live preview of what the customer sees
  • Manage restaurants and their Popular / Nearby placement
  • Track and resolve customer complaints
  • Update order status as food moves through the kitchen

Tech stack

Frontend React 18 · React Router · Vite · Axios · Context API · plain CSS with custom properties Backend Node.js · Express · MongoDB · Mongoose · JWT · bcrypt · Multer Payments Stripe Checkout · Razorpay (HMAC signature verification)


Quick start

Prerequisites: Node.js 18+, a MongoDB database (Atlas or local), a Stripe test key.

git clone https://github.com/<your-username>/<your-repo>.git
cd <your-repo>

Create the environment files:

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
cp admin/.env.example admin/.env

Fill in backend/.env — at minimum MONGO_URI, JWT_SECRET, ADMIN_EMAIL, ADMIN_PASSWORD and STRIPE_SECRET_KEY. See backend/README.md for a walkthrough of getting a MongoDB Atlas connection string.

Then run each service in its own terminal:

cd backend  && npm install && npm run server   # http://localhost:4000
cd frontend && npm install && npm run dev      # http://localhost:5173
cd admin    && npm install && npm run dev      # http://localhost:5174

Load the sample menu

A fresh database is empty, so the storefront will look bare. Seed it:

cd backend && npm run seed

That inserts 32 dishes across 8 categories and copies their images into backend/uploads. Re-running is safe — it skips anything already there.

Or with Docker

docker compose up --build

Documentation

Doc Covers
backend/README.md MongoDB Atlas setup, env vars, full API reference, auth model
frontend/README.md Component map and storefront notes
admin/README.md Admin pages, discounts, image replacement
CHANGES.md Full development history and known limitations

API reference

Auth is a JWT sent in a token header. Admin routes return 401 without a token and 403 for a customer token.

Method Endpoint Auth Purpose
POST /api/user/register · /api/user/login — Customer accounts
POST /api/admin/login — Admin login
GET /api/food/list — List menu items
POST /api/food/add · /update · /remove admin Manage menu (multipart for images)
GET /api/restaurant/list — Restaurants with item counts
POST /api/restaurant/add · /remove admin Manage restaurants
POST /api/cart/add · /remove · /get customer Cart operations
POST /api/order/place · /razorpay · /cod customer Checkout
GET /api/order/list admin All orders
POST /api/order/status admin Update order status
POST /api/complaint/submit — Contact form

Project structure

.
├── backend/          Express API, MongoDB models, payment controllers
│   ├── controllers/  admin · user · food · cart · order · restaurant · complaint
│   ├── middleware/   auth.js (customer) · adminAuth.js (admin, role-checked)
│   ├── models/       user · food · order · restaurant · complaint · newsletter
│   ├── routes/       one router per resource
│   ├── uploads/      uploaded images, served at /images
│   └── seed.js       loads the 32-item sample menu
├── frontend/         customer storefront (React + Vite)
├── admin/            admin dashboard (React + Vite)
└── docker-compose.yaml

Known limitations

Being upfront about what looks finished but isn't:

  • Ratings are entered by the admin, not earned from customers — there's no review flow yet
  • Wishlist hearts are stored in localStorage and don't sync across devices
  • Saved addresses aren't implemented — customers enter delivery details at each checkout
  • Order tracking shows a status, not live courier location
  • Blog cards on the homepage are placeholder content

License

Released under the MIT License. See LICENSE for details.

About

Full-stack MERN food delivery platform built as three services on one shared API. Customer storefront, admin dashboard with revenue charts, and a Node/Express API. Razorpay UPI and Cash on Delivery, JWT auth, order tracking, dark mode.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages