A complete food delivery platform with a customer-facing web app, an admin dashboard, and a Node.js/Express backend with MongoDB.
View the deployed application here
- Features
- Project Structure
- Tech Stack
- Setup & Installation
- Backend
- Frontend (User)
- Admin Dashboard
- API Overview
- Usage
- Folder Structure
- License
- User registration, login, and authentication
- Browse food menu, add to cart, and place orders
- Order history and order tracking
- Admin dashboard for managing food items and orders
- Image upload for food items
- Secure payment integration (Stripe)
- Responsive UI for both user and admin
food-del-final/
backend/ # Node.js/Express API server, MongoDB models, business logic
frontend/ # React app for customers
admin/ # React app for admins
- Backend: Node.js, Express, MongoDB, Mongoose, JWT, Multer, Stripe
- Frontend: React, Vite, Axios, React Router, React Toastify, Stripe.js
- Admin: React, Vite, Axios, React Router, React Toastify
- Node.js (v16+ recommended)
- npm or yarn
- MongoDB instance (local or cloud)
cd backend
npm install
# Create a .env file with your MongoDB URI, JWT secret, Stripe keys, etc.
npm run server
# Server runs on http://localhost:4000 by defaultMONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
STRIPE_SECRET_KEY=your_stripe_secret
cd frontend
npm install
npm run dev
# App runs on http://localhost:5173 by defaultcd admin
npm install
npm run dev
# Admin dashboard runs on http://localhost:5173 by default (change port if needed)POST /api/user/register— Register a new userPOST /api/user/login— User loginGET /api/food— List all food itemsPOST /api/cart— Add item to cartGET /api/cart— Get user cartPOST /api/order— Place an orderGET /api/order— Get user ordersPOST /api/food— (Admin) Add new food itemPUT /api/food/:id— (Admin) Update food itemDELETE /api/food/:id— (Admin) Delete food item
See backend/routes/ for full API details.
- Users can browse the menu, add items to their cart, and place orders.
- Admins can log in to the admin dashboard to manage food items and view orders.
- All images are uploaded and served from the backend
/imagesendpoint.
server.js— Express server entry pointconfig/db.js— MongoDB connection logicmodels/— Mongoose schemas (User, Food, Order)controllers/— Business logic for each resourceroutes/— API endpointsmiddleware/— Auth and other middlewareuploads/— Uploaded images
src/pages/— Main app pages (Home, Cart, Orders, etc.)src/components/— UI components (Navbar, FoodDisplay, etc.)src/Context/StoreContext.jsx— Global state managementsrc/assets/— Images and icons
src/pages/— Admin pages (Add, List, Orders)src/components/— Admin UI (Navbar, Sidebar)src/assets/— Admin images/icons
This project is licensed under the MIT License.