A real-time, full-stack food delivery web application with three distinct user roles β Customer, Shop Owner, and Delivery Boy β featuring live order tracking, online payments, and an intuitive UI.
- Email/Password sign-up & sign-in with bcrypt hashed passwords
- Google OAuth sign-in via Firebase Authentication
- Forgot Password flow with OTP verification via email (Nodemailer)
- JWT-based session management with HTTP-only cookies
- Browse food items and shops by city (auto-detected via geolocation)
- Filter items by food categories β Snacks, Pizza, Burgers, South Indian, Chinese, and more
- Search for food items across all shops in your city
- Add items to cart with quantity management
- Checkout with interactive map (Leaflet) for delivery address selection
- Drag-to-pin or use current GPS location for delivery
- Cash on Delivery (COD) and Razorpay online payment support
- View order history and live-track delivery on a real-time map
- Rate food items (1β5 star ratings)
- Create and edit your restaurant/shop profile with image upload
- Add, edit, and delete food items with categories, pricing, and veg/non-veg tags
- Manage incoming orders β update status from Pending β Preparing β Out for Delivery β Delivered
- Auto-assign delivery boys based on proximity (GeoSpatial queries)
- View order history with delivery details
- Receive real-time delivery assignment broadcasts via Socket.IO
- Accept or view pending assignments
- Live GPS location sharing β customers track delivery boy on a live map
- OTP-based delivery verification (OTP sent to customer's email, delivery boy verifies)
- Dashboard with today's deliveries chart (Recharts bar chart)
- Socket.IO for live order status updates, delivery assignment broadcasts, and location tracking
- Real-time delivery boy location updates rendered on Leaflet maps
- Instant notification when order status changes
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 7, TailwindCSS 4 |
| State Management | Redux Toolkit |
| Routing | React Router DOM v7 |
| Backend | Node.js, Express 5 |
| Database | MongoDB Atlas (Mongoose ODM) |
| Authentication | JWT, bcrypt, Firebase Auth (Google OAuth) |
| Real-Time | Socket.IO |
| Payments | Razorpay |
| File Uploads | Multer + Cloudinary |
| Nodemailer | |
| Maps | Leaflet / React-Leaflet, OpenCage Geocoding API |
| Charts | Recharts |
eatfeast/
βββ backend/
β βββ config/
β β βββ db.js # MongoDB connection
β βββ controllers/
β β βββ auth.controllers.js # Sign up, sign in, Google Auth, OTP, reset password
β β βββ item.controllers.js # CRUD items, search, filter by city, ratings
β β βββ order.controllers.js # Place order, Razorpay, delivery assignment, OTP verify
β β βββ shop.controllers.js # Create/edit shop, get shops by city
β β βββ user.controllers.js # Get current user
β βββ middlewares/
β β βββ isAuth.js # JWT authentication middleware
β β βββ multer.js # File upload middleware
β βββ models/
β β βββ deliveryAssignment.model.js
β β βββ item.model.js
β β βββ order.model.js
β β βββ shop.model.js
β β βββ user.model.js
β βββ routes/
β β βββ auth.routes.js
β β βββ item.routes.js
β β βββ order.routes.js
β β βββ shop.routes.js
β β βββ user.routes.js
β βββ utils/
β β βββ cloudinary.js # Cloudinary image upload helper
β β βββ mail.js # Nodemailer OTP & delivery OTP emails
β β βββ token.js # JWT token generation
β βββ socket.js # Socket.IO event handlers
β βββ index.js # Express server entry point
β βββ package.json
β
βββ frontend/
β βββ src/
β β βββ assets/ # Food category images & illustrations
β β βββ components/
β β β βββ Nav.jsx # Navigation bar with search & cart
β β β βββ UserDashboard.jsx # Customer home β categories, shops, food cards
β β β βββ OwnerDashboard.jsx # Shop owner home β manage shop & items
β β β βββ DeliveryBoy.jsx # Delivery boy dashboard β assignments & chart
β β β βββ DeliveryBoyTracking.jsx # Live map tracking component
β β β βββ FoodCard.jsx # Food item display card
β β β βββ CategoryCard.jsx # Category carousel card
β β β βββ CartItemCard.jsx # Cart item with quantity controls
β β β βββ OwnerItemCard.jsx # Owner's item management card
β β β βββ OwnerOrderCard.jsx # Owner's order management card
β β β βββ UserOrderCard.jsx # Customer's order history card
β β βββ hooks/
β β β βββ useGetCurrentUser.jsx
β β β βββ useGetCity.jsx # Auto-detect city via geolocation
β β β βββ useGetMyShop.jsx
β β β βββ useGetShopByCity.jsx
β β β βββ useGetItemsByCity.jsx
β β β βββ useGetMyOrders.jsx
β β β βββ useUpdateLocation.jsx # Live GPS updates for delivery boys
β β βββ pages/
β β β βββ Home.jsx # Role-based dashboard routing
β β β βββ SignUp.jsx
β β β βββ SignIn.jsx
β β β βββ ForgotPassword.jsx
β β β βββ CreateEditShop.jsx
β β β βββ AddItem.jsx
β β β βββ EditItem.jsx
β β β βββ Shop.jsx # Individual shop page
β β β βββ CartPage.jsx
β β β βββ CheckOut.jsx # Map-based checkout with payments
β β β βββ OrderPlaced.jsx
β β β βββ MyOrders.jsx
β β β βββ TrackOrderPage.jsx # Live delivery tracking
β β βββ redux/
β β β βββ store.js
β β β βββ userSlice.js # User, cart, orders, search state
β β β βββ ownerSlice.js # Shop owner state
β β β βββ mapSlice.js # Map/location state
β β βββ category.js # Food category definitions
β β βββ App.jsx # Routes & Socket.IO setup
β β βββ main.jsx # React entry point
β βββ firebase.js # Firebase config for Google Auth
β βββ vite.config.js
β βββ package.json
β
βββ readme.md
- Node.js (v18 or higher)
- MongoDB Atlas account (or local MongoDB instance)
- Cloudinary account for image uploads
- Razorpay account for payment processing
- Firebase project for Google OAuth
git clone https://github.com/your-username/eatfeast.git
cd eatfeastcd backend
npm installCreate a .env file in the backend/ directory:
PORT=8000
MONGODB_URL=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
EMAIL=your_email@gmail.com
PASS=your_email_app_password
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
NODE_ENV=developmentStart the backend server:
npm run devcd frontend
npm installCreate a .env file in the frontend/ directory:
VITE_FIREBASE_APIKEY=your_firebase_api_key
VITE_GEOAPIKEY=your_opencage_geocoding_api_key
VITE_RAZORPAY_KEY_ID=your_razorpay_key_idStart the frontend dev server:
npm run devThe app will be available at http://localhost:5173.
| Method | Endpoint | Description |
|---|---|---|
| POST | /signup |
Register a new user |
| POST | /signin |
Login with email & password |
| GET | /signout |
Logout |
| POST | /send-otp |
Send OTP for password reset |
| POST | /verify-otp |
Verify OTP |
| POST | /reset-password |
Reset password |
| POST | /google |
Google OAuth sign-in |
| Method | Endpoint | Description |
|---|---|---|
| POST | /create-edit |
Create or update a shop |
| GET | /my-shop |
Get current owner's shop |
| GET | /city/:city |
Get all shops in a city |
| Method | Endpoint | Description |
|---|---|---|
| POST | /add |
Add a new food item |
| PUT | /edit/:itemId |
Edit a food item |
| DELETE | /delete/:itemId |
Delete a food item |
| GET | /city/:city |
Get items by city |
| GET | /shop/:shopId |
Get items by shop |
| GET | /search-items |
Search items by name/category |
| POST | /rating |
Rate a food item |
| Method | Endpoint | Description |
|---|---|---|
| POST | /place-order |
Place a new order |
| POST | /verify-payment |
Verify Razorpay payment |
| GET | /my-orders |
Get user's order history |
| PUT | /update-status |
Update order status (owner) |
| GET | /assignments |
Get delivery assignments |
| POST | /accept-order |
Accept a delivery assignment |
| GET | /current-order |
Get delivery boy's current order |
| GET | /get-order-by-id/:orderId |
Get order details |
| POST | /send-delivery-otp |
Send delivery verification OTP |
| POST | /verify-delivery-otp |
Verify delivery OTP & mark delivered |
| GET | /today-deliveries |
Get today's delivery stats |
| Event | Direction | Description |
|---|---|---|
identity |
Client β Server | Register user's socket ID |
updateLocation |
Client β Server | Delivery boy sends GPS coordinates |
updateDeliveryLocation |
Server β Client | Broadcast delivery boy's live location |
orderStatusUpdate |
Server β Client | Notify order status changes |
newAssignment |
Server β Client | Broadcast new delivery assignment |
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
Made with β€οΈ by EatFeast Team