A full-stack food ordering system with real-time kitchen dashboard, admin panel, and secure payment processing. Built as a comprehensive portfolio project demonstrating modern web development practices.
- ๐ Browse menu with categories and search
- ๐ Shopping cart with persistent storage
- ๐จ Customizable menu items (size, toppings, spice level, etc.)
- ๐ณ Secure payment processing with Razorpay
- ๐ฆ Order tracking with real-time status updates
- ๐ค User authentication and profile management
- ๐ฑ Fully responsive design
- ๐ Real-time order notifications (Socket.io)
- ๐ Drag-and-drop order status management
- โฑ๏ธ Estimated pickup time tracking
- ๐ Order search and filtering
- ๐ Audio notifications for new orders
- ๐ Live order statistics
- โ Complete menu CRUD operations
- ๐ผ๏ธ Image upload for menu items
- ๐ท๏ธ Category management
- โก Quick availability toggle
- ๐ Advanced search and filtering
- ๐ Bulk operations (enable/disable/delete)
- ๐ Duplicate menu items
- ๐๏ธ Customization options management
- Framework: React 19.2 with Vite
- Routing: React Router v7
- Styling: Tailwind CSS
- State Management: Context API + useReducer
- Real-time: Socket.io Client
- HTTP Client: Axios
- UI Components: Lucide React Icons
- Notifications: React Hot Toast
- Runtime: Node.js
- Framework: Express.js v5
- Database: MongoDB with Mongoose
- Authentication: JWT (JSON Web Tokens)
- Password Hashing: bcryptjs
- Payment Gateway: Razorpay
- Real-time: Socket.io
- File Upload: Multer
- Security: express-rate-limit, CORS
Before running this project, make sure you have:
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local installation or MongoDB Atlas account)
- Razorpay Account (for payment processing)
git clone https://github.com/yourusername/foodhub.git
cd foodhubcd backend
npm installCreate .env file in the backend directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# MongoDB Connection
MONGO_URI=your_mongodb_connection_string
# JWT Secret
JWT_SECRET=your_super_secret_jwt_key_here
# Razorpay Keys
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
RAZORPAY_WEBHOOK_SECRET=your_razorpay_webhook_secret
# Email Configuration (Optional)
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_email_app_password
# Frontend URLs
CUSTOMER_FRONTEND_URL=http://localhost:5173
KITCHEN_DASHBOARD_URL=http://localhost:5174Seed the database:
npm run seedcd ../customer-frontend
npm installCreate .env file in the customer-frontend directory:
VITE_API_URL=http://localhost:5000/api
VITE_RAZORPAY_KEY_ID=your_razorpay_key_idcd ../kitchen-dashboard
npm installCreate .env file in the kitchen-dashboard directory:
VITE_API_URL=http://localhost:5000/apicd backend
npm run devRuns on: http://localhost:5000
cd customer-frontend
npm run devRuns on: http://localhost:5173
cd kitchen-dashboard
npm run devRuns on: http://localhost:5174
After seeding the database and starting the backend:
- Open MongoDB Compass and connect to your database
- Navigate to the
userscollection - Find your user account (by email)
- Edit the document and add:
isAdmin: true - Save changes
use your_database_name;
db.users.updateOne(
{ email: "your-email@example.com" },
{ $set: { isAdmin: true, role: "admin" } }
);- Register a new account at
/register - Use one of the above methods to set
isAdmin: true - Login and access admin panel at
/admin/dashboard
Success:
- Card:
4100 2800 0000 1007 - CVV: Any 3 digits
- Expiry: Any future date
UPI:
success@razorpay(successful payment)failure@razorpay(failed payment)
food-ordering-system/
โโโ backend/
โ โโโ config/ # Database and upload configs
โ โโโ controllers/ # Route controllers
โ โโโ middleware/ # Auth, admin, validation
โ โโโ models/ # Mongoose schemas
โ โโโ routes/ # API routes
โ โโโ scripts/ # Seed scripts
โ โโโ uploads/ # Uploaded images
โ โโโ utils/ # Helper functions
โ
โโโ customer-frontend/
โ โโโ public/ # Static assets
โ โโโ src/
โ โโโ assets/ # Static assets
โ โโโ components/ # Reusable components
โ โโโ context/ # React Context (Cart)
โ โโโ pages/ # Page components
โ โ โโโ admin/ # Admin pages
โ โโโ services/ # API services
โ
โ
โ
โโโ kitchen-dashboard/
โโโ public/ # Static assets
โโโ src/
โโโ assets/ # Static assets
โโโ components/ # Dashboard components
โโโ pages/ # Dashboard pages
โโโ services/ # API services
โโโ utils/ # Notifictions
POST /api/auth/register Register new user
POST /api/auth/login User login
GET /api/auth/me Get current user
PUT /api/auth/profile Update profile
PUT /api/auth/change-password Change password
GET /api/menu Get all menu items
GET /api/menu/:id Get single item
GET /api/menu/categories Get all categories
POST /api/menu Create menu item
PUT /api/menu/:id Update menu item
DELETE /api/menu/:id Delete menu item
PATCH /api/menu/:id/availability Toggle availability
POST /api/menu/bulk-delete Bulk delete items
POST /api/menu/bulk-toggle Bulk toggle availability
POST /api/orders/create-razorpay-order Create payment order
POST /api/orders/verify-payment Verify payment
GET /api/orders/my-orders Get user's orders
GET /api/orders/:id Get single order
GET /api/kitchen/orders Get active orders
PUT /api/kitchen/orders/:id/status Update order status
GET /api/admin/verify Verify admin access
- JWT Authentication - Secure token-based authentication
- Password Hashing - bcryptjs for secure password storage
- Protected Routes - Client and server-side route protection
- Rate Limiting - Prevent brute force attacks
- Input Validation - Express-validator for data validation
- CORS - Configured for specific origins
- Payment Verification - Server-side signature verification
- Price Validation - Server-side total recalculation
- Role-Based Access - Admin, Kitchen Staff, Customer roles
Server โ Kitchen Dashboard:
new_order- New order placedorder_updated- Order status changed
Server โ Customer:
- Auto-polling every 30 seconds on Orders page
- โ Mobile-first approach
- โ Tablet optimized
- โ Desktop layouts
- โ Touch-friendly UI
- โ Hamburger menu for mobile
- Persistent Cart - Cart saved to localStorage
- Protected Checkout - Must login to purchase
- Real-time Updates - Order status polling
- Expandable Orders - View order details inline
- Smart Search - Filter menu items
- Price Display - INR currency (โน)
- Image Upload - Drag & drop image upload
- Quick Actions - Toggle availability with one click
- Bulk Operations - Manage multiple items at once
- Duplicate Items - Clone existing items
- Category Management - Simple string-based categories
- Search & Filter - Find items quickly
- Color-coded Status - Visual order states
- Audio Alerts - Sound on new orders
- Connection Status - Real-time indicator
- Order Search - Find orders by number/customer
- Undo Actions - Revert status changes
- Set environment variables in platform dashboard
- Update
CUSTOMER_FRONTEND_URLandKITCHEN_DASHBOARD_URL - Ensure MongoDB connection string is correct
- Deploy from GitHub repository
Customer Frontend:
- Set
VITE_API_URLto your backend URL - Set
VITE_RAZORPAY_KEY_ID - Build command:
npm run build - Publish directory:
dist
Kitchen Dashboard:
- Set
VITE_API_URLto your backend URL - Build command:
npm run build - Publish directory:
dist
Important: Add _redirects file to public folder:
- Email notifications not implemented (placeholder in .env)
- No order cancellation feature
- No customer reviews/ratings system
- Kitchen dashboard requires manual login
- No analytics dashboard (marked as "Coming soon")
- Admin panel mobile responsiveness needs improvement
- Email/SMS notifications
- Push notifications for customers
- Order cancellation & refunds
- Customer reviews and ratings
- Admin analytics dashboard
- Delivery tracking with maps
- Multiple restaurant support
- Websocket contoller are there but not properly implemented since app is in development mode!
- Coupon/discount system
- Order scheduling
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
For support, you can find my email on profile or open an issue in the GitHub repository.
โญ Star this repo if you find it helpful!
Made with โค๏ธ and lots of โ