Skip to content

prithvikings/EatFeast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍽️ EatFeast β€” Full-Stack Food Delivery Platform

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.

React Node.js MongoDB Socket.IO TailwindCSS


✨ Features

πŸ” Authentication & Security

  • 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

πŸ‘€ Customer Panel

  • 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)

πŸͺ Shop Owner Panel

  • 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

πŸ›΅ Delivery Boy Panel

  • 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)

⚑ Real-Time Features

  • 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

πŸ› οΈ Tech Stack

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
Email Nodemailer
Maps Leaflet / React-Leaflet, OpenCage Geocoding API
Charts Recharts

πŸ“ Project Structure

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

πŸš€ Getting Started

Prerequisites

  • 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

1. Clone the Repository

git clone https://github.com/your-username/eatfeast.git
cd eatfeast

2. Backend Setup

cd backend
npm install

Create 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=development

Start the backend server:

npm run dev

3. Frontend Setup

cd frontend
npm install

Create 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_id

Start the frontend dev server:

npm run dev

The app will be available at http://localhost:5173.


πŸ—„οΈ API Endpoints

Auth (/api/auth)

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

Shop (/api/shop)

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

Item (/api/item)

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

Order (/api/order)

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

πŸ“‘ Socket.IO Events

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

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the ISC License.


Made with ❀️ by EatFeast Team

About

Full-stack food delivery app with live tracking, Razorpay payments & real-time order updates.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages