Skip to content

dhruvsahu611/finalCravings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Cravings - Food Delivery Platform

A full-stack food delivery application built with React, Express, and MongoDB. The platform connects customers, restaurants, riders, and admins in a seamless food ordering ecosystem.


πŸ“‹ Table of Contents

  1. Project Overview
  2. Available Features
  3. Tech Stack
  4. Missing/Required Features
  5. Installation & Setup
  6. API Endpoints

🎯 Project Overview

Cravings is a comprehensive food delivery platform with role-based access and multi-user functionality:

  • Customer: Browse restaurants, view menus, place orders, track delivery, manage profile
  • Restaurant Manager: Manage menu items, view orders, track earnings, manage restaurant profile
  • Rider: Accept delivery orders, track deliveries (structure in place)
  • Admin: Manage the platform, view analytics, manage users (structure in place)

Base URL: http://localhost:5000 (Backend) | http://localhost:5173 (Frontend)


✨ Available Features

πŸ” Authentication & Authorization

Feature Details Status
User Registration Register as Customer, Restaurant Manager, Rider, or Admin with email/password βœ… Working
User Login Secure login with JWT token generation, cookies stored βœ… Working
User Logout Clear authentication token and session data βœ… Working
Forgot Password OTP-based password reset via email βœ… Working
OTP Generation Generate OTP and send via email for verification βœ… Working
OTP Verification Verify OTP before password reset βœ… Working
JWT Token Management Secure token generation and validation βœ… Working
Role-Based Access Control Middleware-based access control for user roles βœ… Working

Endpoints:

  • POST /auth/register - User registration
  • POST /auth/login - User login
  • GET /auth/logout - Logout
  • POST /auth/genOtp - Generate OTP
  • POST /auth/verifyOtp - Verify OTP
  • POST /auth/forgetPasword - Reset password

πŸ‘€ User/Customer Features

Feature Details Status
Profile Management Update personal information (name, email, phone, DOB, gender, address, city, PIN) βœ… Working
Profile Photo Upload Upload and change profile picture with Cloudinary integration βœ… Working
Password Reset Change password after login βœ… Working
Geolocation Store latitude/longitude for delivery tracking βœ… Working
Payment Details Store UPI, bank account, IFSC code βœ… Working
Document Management Support for PAN, GST, FSSAI, RC, DL, UIDAI documents βœ… Working
User Dashboard View profile, orders, transactions βœ… UI Ready
User Overview Quick stats and summary βœ… UI Ready
Order History View all past orders βœ… UI Ready
Transaction History View payment transactions βœ… UI Ready
Help/Support Desk Contact support via help desk interface βœ… UI Ready

Endpoints:

  • PUT /user/update - Update user profile
  • PATCH /user/changePhoto - Upload profile photo
  • PATCH /user/resetPassword - Change password

🍽️ Restaurant Manager Features

Feature Details Status
Menu Management Add, edit, view, and manage menu items βœ… Working
Menu Item Creation Add new menu items with images, price, type (veg/non-veg), details βœ… Working
Menu Item Editing Update existing menu items with new images and details βœ… Working
Menu Item View Browse all menu items for the restaurant βœ… Working
Item Availability Mark items as available/unavailable/removed βœ… Working
Multiple Food Types Support: Veg, Non-Veg, Vegan, Egg, Jain, Gluten-Free, Contains-Nuts, Dairy βœ… Working
Image Upload Upload up to 5 images per menu item via Cloudinary βœ… Working
Restaurant Profile Manage restaurant details (name, cuisine, opening hours, location) βœ… Working
Password Reset Change restaurant manager password βœ… Working
Profile Photo Upload restaurant profile picture βœ… Working
Restaurant Dashboard View all dashboard components βœ… UI Ready
Orders Management View and manage incoming orders βœ… UI Ready
Earnings Tracking Track daily/weekly/monthly earnings βœ… UI Ready
Help Desk Customer support interface βœ… UI Ready

Endpoints:

  • POST /restaurant/addMenuItem - Add new menu item
  • GET /restaurant/menuItems - Get all menu items
  • PUT /restaurant/updateMenuItem/:id - Update menu item
  • PUT /restaurant/update - Update restaurant profile
  • PATCH /restaurant/changePhoto - Upload restaurant photo
  • PATCH /restaurant/resetPassword - Change password

🌐 Public/Guest Features

Feature Details Status
Browse Restaurants View all available restaurants without login βœ… Working
View Restaurant Menu Browse menu items with pagination (2 items per page) βœ… Working
Contact Support Submit contact form with name, email, phone, message βœ… Working
Restaurant Display View restaurant details and menu items βœ… UI Ready
Search Restaurants Filter by cuisine or restaurant name βœ… UI Ready

Endpoints:

  • GET /public/allRestaurants - Get all restaurants
  • GET /public/restaurant-menu/:id/:page - Get restaurant menu with pagination
  • POST /public/new-contact - Submit contact form

πŸ›£οΈ Rider Features (Structure in Place)

Feature Details Status
Rider Dashboard View assigned deliveries βœ… UI Ready
Delivery Tracking Track delivery orders in real-time ⏳ Backend Incomplete
Order Acceptance Accept/reject delivery orders ⏳ Backend Incomplete

πŸ‘¨β€πŸ’Ό Admin Features (Structure in Place)

Feature Details Status
Admin Dashboard Overview of platform statistics βœ… UI Ready
User Management View and manage all users ⏳ Backend Incomplete
Order Management View all orders on platform ⏳ Backend Incomplete
Analytics View platform analytics and reports ⏳ Backend Incomplete

🎨 Frontend Pages

Page Purpose Status
Home Landing page with featured restaurants and popular dishes βœ… Ready
About About the platform βœ… Ready
Contact Contact form βœ… Ready
Login User login page βœ… Ready
Register User registration page βœ… Ready
OrderNow Browse and filter restaurants/menus βœ… Ready
RestaurantDisplayMenu View restaurant menu in detail βœ… Ready
UserDashboard Customer dashboard with multiple tabs βœ… Ready
RestaurantDashboard Restaurant manager dashboard βœ… Ready
RiderDashboard Rider dashboard (UI only) βœ… Ready
AdminDashboard Admin panel (UI only) βœ… Ready
NotFound 404 error page βœ… Ready

πŸ› οΈ Technical Features

Feature Details Status
Database MongoDB with Mongoose ORM βœ… Working
Authentication JWT-based with HTTP-only cookies βœ… Working
Password Security BCrypt hashing with salt rounds (10) βœ… Working
Email Service Nodemailer integration for OTP and notifications βœ… Working
Image Upload Cloudinary integration for image storage βœ… Working
Form Validation Server-side validation for all inputs βœ… Working
Error Handling Centralized error handling middleware βœ… Working
CORS Cross-origin request handling βœ… Working
Request Logging Morgan HTTP request logging βœ… Working
State Management React Context API for auth state βœ… Working
Routing React Router v7 for frontend navigation βœ… Working
Notifications React Hot Toast for user feedback βœ… Working
Styling Tailwind CSS framework βœ… Working
Icons React Icons library βœ… Working

πŸ“¦ Tech Stack

Frontend

  • React 19.2.0 - UI framework
  • Vite 7.2.4 - Build tool
  • React Router DOM 7.12.0 - Routing
  • Tailwind CSS 4.1.18 - Styling
  • Axios 1.13.2 - HTTP client
  • React Hot Toast 2.6.0 - Notifications
  • React Icons 5.5.0 - Icon library
  • ESLint - Code linting

Backend

  • Express 5.2.1 - Web framework
  • MongoDB with Mongoose 9.1.2 - Database
  • JWT - Authentication
  • BCrypt 6.0.0 - Password hashing
  • Cloudinary 2.9.0 - Image storage
  • Nodemailer 7.0.13 - Email service
  • Multer 2.0.2 - File upload
  • Morgan 1.10.1 - HTTP logging
  • Cookie Parser 1.4.7 - Cookie handling
  • CORS 2.8.5 - Cross-origin handling
  • Dotenv 17.2.3 - Environment variables
  • Nodemon 3.1.11 (Dev) - Auto-reload

⚠️ Missing/Required Features

The following features are essential for a complete food delivery platform but are currently NOT implemented:

πŸ›’ Order Management System (CRITICAL)

  • Order Model: Schema for storing order details (items, quantity, total, status)
  • Create Order: API to create new orders from cart
  • Order Tracking: View order status (placed, confirmed, preparing, on-way, delivered)
  • Order History: Retrieve user's past orders with details
  • Order Updates: Update order status at different stages
  • Order Cancellation: Allow cancellation with refund logic
  • Order Notifications: Notify users of status changes
  • Restaurant Order Queue: View incoming orders for restaurants

πŸ’³ Payment Processing (CRITICAL)

  • Payment Gateway Integration: Stripe, Razorpay, or PayPal integration
  • Payment Methods: Support multiple payment types (card, UPI, wallet)
  • Transaction Recording: Store all transaction records
  • Refund Process: Handle refunds for cancelled orders
  • Invoice Generation: Generate invoices for orders

🚚 Rider/Delivery Management (CRITICAL)

  • Rider Onboarding: Complete rider registration workflow
  • Order Assignment: Auto-assign orders to nearby riders
  • Real-time Tracking: Live GPS tracking of deliveries
  • Delivery Status: Update delivery status (assigned, picked-up, delivered)
  • Rider Rating: Rate riders on delivery quality
  • Delivery Analytics: Track delivery performance metrics

⭐ Ratings & Reviews (HIGH PRIORITY)

  • Restaurant Rating: Rate restaurants (1-5 stars)
  • Food Reviews: Write reviews for menu items
  • Rider Rating: Rate rider performance
  • Review Display: Show ratings and reviews on restaurant/menu pages
  • Average Rating Calculation: Display avg rating for restaurants

πŸ” Search & Filter (HIGH PRIORITY)

  • Restaurant Search: Search by name, cuisine, location
  • Menu Search: Search menu items by name
  • Filters: Filter by rating, delivery time, price range, cuisine type
  • Sorting: Sort by rating, price, delivery time
  • Pagination: Implement proper pagination for results

❀️ Wishlist/Favorites (MEDIUM PRIORITY)

  • Save Favorites: Save favorite restaurants/dishes
  • View Wishlist: Display saved items with quick access
  • Remove from Wishlist: Remove items from saved list

πŸ“ Address Management (HIGH PRIORITY)

  • Multiple Addresses: Save multiple delivery addresses
  • Primary Address: Set default delivery address
  • Address Validation: Verify delivery address for coverage area
  • Location Suggestions: Auto-complete address suggestions

πŸ’° Promo Codes & Discounts (MEDIUM PRIORITY)

  • Promo Code System: Create and manage promotional codes
  • Discount Application: Apply discounts to orders
  • Coupon Management: Track coupon usage and validity
  • Restaurant Discounts: Special offers from restaurants

πŸ”” Notifications (HIGH PRIORITY)

  • Real-time Notifications: WebSocket for instant updates
  • Email Notifications: Send order updates via email
  • SMS Notifications: Send updates via SMS (Twilio/AWS)
  • In-app Notifications: Display notifications in app

πŸ“Š Analytics & Reporting (MEDIUM PRIORITY)

  • Admin Dashboard Stats: Total orders, revenue, users, restaurants
  • Restaurant Analytics: Daily/weekly/monthly earnings, top items
  • User Behavior Analytics: Tracking popular restaurants/dishes
  • Reports Generation: Download reports in PDF/CSV

πŸ‘¨β€πŸ’Ό Admin Panel (MEDIUM PRIORITY)

  • User Management: View, edit, suspend users
  • Restaurant Verification: Approve/reject new restaurants
  • Order Monitoring: Monitor all orders on platform
  • Support Tickets: Manage customer support requests
  • System Settings: Configure platform settings

🎯 Cart System (CRITICAL)

  • Add to Cart: Add items with quantity
  • Update Cart: Modify item quantities
  • Remove from Cart: Delete items from cart
  • Cart Persistence: Save cart across sessions
  • Cart Summary: Display total items and price

πŸ“± Push Notifications (LOW PRIORITY)

  • Browser Push: Browser push notifications
  • Mobile Push: Mobile app push notifications (if mobile app exists)

πŸ” Two-Factor Authentication (LOW PRIORITY)

  • 2FA Setup: Enable two-factor authentication
  • TOTP Support: Time-based one-time password
  • Backup Codes: Generate backup codes

πŸ“² SMS Integration (LOW PRIORITY)

  • OTP via SMS: Send OTP through SMS instead of email
  • Order Updates via SMS: Send order status via SMS

πŸš€ Installation & Setup

Prerequisites

  • Node.js v16+
  • MongoDB instance running
  • Cloudinary account (for image upload)
  • Email service credentials (Nodemailer)

Backend Setup

cd server
npm install

# Create .env file with:
PORT=5000
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
EMAIL_USER=your_email@gmail.com
EMAIL_PASSWORD=your_email_password

npm run dev

Frontend Setup

cd client
npm install
npm run dev

Frontend will be available at http://localhost:5173 Backend will be available at http://localhost:5000


πŸ“‘ API Endpoints

Authentication Routes (/auth)

POST   /auth/register          - Register new user
POST   /auth/login             - Login user
GET    /auth/logout            - Logout user
POST   /auth/genOtp            - Generate OTP
POST   /auth/verifyOtp         - Verify OTP
POST   /auth/forgetPasword     - Reset password

Public Routes (/public)

GET    /public/allRestaurants              - Get all restaurants
GET    /public/restaurant-menu/:id/:page   - Get restaurant menu
POST   /public/new-contact                 - Submit contact form

User Routes (/user)

PUT    /user/update                    - Update user profile
PATCH  /user/changePhoto               - Upload profile photo
PATCH  /user/resetPassword             - Change password

Restaurant Routes (/restaurant)

POST   /restaurant/addMenuItem              - Add menu item
GET    /restaurant/menuItems                - Get all menu items
PUT    /restaurant/updateMenuItem/:id       - Update menu item
PUT    /restaurant/update                   - Update restaurant profile
PATCH  /restaurant/changePhoto              - Upload restaurant photo
PATCH  /restaurant/resetPassword            - Change password

πŸ“‹ Database Models

User Model

  • fullName, email, mobileNumber, password, role
  • dob, gender, address, city, pin, photo
  • geoLocation (lat, lon)
  • restaurantName, cuisine (for restaurant managers)
  • paymentDetails (upi, account_number, ifs_Code)
  • documents (gst, fssai, rc, dl, uidai, pan)

Menu Model

  • resturantID, itemName, cuisine
  • type (veg/non-veg/vegan/egg/jain/gluten-free/contains-nuts/dairy)
  • servingSize, preparationTime, description, price
  • availability (available/unavailable/removed)
  • images (url, publicID)

Contact Model

  • fullName, email, mobileNumber, message
  • timestamps

OTP Model

  • For OTP generation and verification during password reset

🎨 Project Structure

Cravings/
β”œβ”€β”€ client/                          # React Frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/              # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ userDashboard/       # User dashboard components
β”‚   β”‚   β”‚   β”œβ”€β”€ restaurantDashboard/ # Restaurant dashboard components
β”‚   β”‚   β”‚   β”œβ”€β”€ publicModals/        # Public modals
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx
β”‚   β”‚   β”‚   └── Loading.jsx
β”‚   β”‚   β”œβ”€β”€ pages/                   # Page components
β”‚   β”‚   β”‚   β”œβ”€β”€ dashboards/          # Dashboard pages
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Register.jsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ config/                  # Configuration
β”‚   β”‚   β”œβ”€β”€ context/                 # React Context
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
β”œβ”€β”€ server/                          # Express Backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/                  # Configuration files
β”‚   β”‚   β”‚   β”œβ”€β”€ db.js                # MongoDB connection
β”‚   β”‚   β”‚   β”œβ”€β”€ cloudinary.js        # Cloudinary setup
β”‚   β”‚   β”‚   └── email.js             # Email configuration
β”‚   β”‚   β”œβ”€β”€ controllers/             # Route handlers
β”‚   β”‚   β”œβ”€β”€ middlewares/             # Custom middlewares
β”‚   β”‚   β”œβ”€β”€ models/                  # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ routers/                 # API routes
β”‚   β”‚   β”œβ”€β”€ utils/                   # Utility functions
β”‚   β”‚   └── seeders/                 # Database seeders
β”‚   β”œβ”€β”€ index.js                     # Entry point
β”‚   └── package.json
β”‚
└── README.md                        # This file

🀝 Contributing

To implement missing features, follow these steps:

  1. Create a new branch for your feature
  2. Implement the feature with proper validation
  3. Add comprehensive error handling
  4. Test thoroughly before submitting
  5. Update this README with new features

πŸ“ License

ISC License - Free to use


πŸ‘¨β€πŸ’» Author

Created by Raj Vardhan


πŸ“ž Support

For issues, questions, or feature requests, please contact through the platform's help desk or contact form.


Last Updated: February 12, 2026 Version: 1.0.0 (Features Documented)


Summary of Implementation Status

Category Total Features Implemented Missing Status
Authentication 8 8 0 βœ… Complete
User Management 10 10 0 βœ… Complete
Restaurant Management 13 13 0 βœ… Complete
Public Features 5 5 0 βœ… Complete
Order Management 8 0 8 ⏳ NOT STARTED
Payment Processing 5 0 5 ⏳ NOT STARTED
Delivery/Rider 6 0 6 ⏳ NOT STARTED
Ratings & Reviews 5 0 5 ⏳ NOT STARTED
Search & Filter 4 0 4 ⏳ NOT STARTED
Cart System 5 0 5 ⏳ NOT STARTED
69 42 27 61% Complete

About

food delivery app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages