A full-stack restaurant ordering platform built on QR code technology, real-time order management, and AI-powered food recommendations.
FOOD DASH enables customers to scan table QR codes, browse menus, place orders, and receive personalized recommendations. Restaurant staff manage operations through a real-time admin dashboard covering orders, tables, menus, and payments.
- QR code table scanning to access menus and place orders
- AI-powered food recommendations based on cart contents and order history
- Real-time order tracking with TOTP verification
- Google OAuth and JWT-based authentication
- Razorpay payment gateway integration
- Responsive UI across all device sizes
- Real-time analytics dashboard
- Table creation and QR code generation
- Live order queue management and kitchen coordination
- Menu item creation and updates
- User account and session oversight
- Transaction monitoring and financial reporting
- Collaborative filtering via TensorFlow.js neural networks
- Content-based filtering on item features and categories
- Continuous model improvement from user interactions
- Popular item fallback when user history is insufficient
graph TD
A[Scan Table QR Code] --> B[Access Restaurant Menu]
B --> C[Browse Categories and Items]
C --> D[Add Items to Cart]
D --> E[View AI Recommendations]
E --> F[Review Cart and Checkout]
F --> G[Razorpay Payment]
G --> H[TOTP Order Verification]
H --> I[Order Confirmation]
I --> J[Real-time Order Tracking]
J --> K[Order Complete]
graph TD
A[Admin Login with 2FA] --> B[Dashboard Overview]
B --> C{Management Tasks}
C --> D[Table Management]
C --> E[Order Processing]
C --> F[User Management]
C --> G[Menu Management]
C --> H[Analytics and Reports]
E --> I[Kitchen Coordination]
I --> J[Order Status Updates]
J --> K[Customer Notifications via Socket.IO]
graph TD
A[User Order History] --> B[Data Preprocessing]
B --> C[Multi-hot Encoding]
C --> D[TensorFlow.js Neural Network Training]
D --> E[Item Embedding Generation]
E --> F[Co-occurrence and Similarity Analysis]
F --> G[Real-time Recommendation Inference]
G --> H[User Interaction Feedback]
H --> A
graph LR
subgraph Client
R[React + Vite]
S[Socket.IO Client]
Q[QR Scanner]
end
subgraph Server
E[Express API]
W[WebSocket Server]
AI[TensorFlow.js Engine]
end
subgraph Data
M[(MongoDB)]
RD[(Redis)]
end
subgraph External
G[Google OAuth]
RP[Razorpay]
end
R --> E
S --> W
E --> M
E --> RD
E --> G
E --> RP
AI --> M
W --> S
- Node.js with Express
- MongoDB for persistent storage
- Redis for rate limiting and session management
- Socket.IO for real-time communication
- TensorFlow.js for the recommendation engine
- Passport.js with Google OAuth
- Razorpay payment processing
- Zod input validation
- Helmet security headers
- React 18 with Hooks
- Vite build tooling
- Tailwind CSS
- Radix UI components
- Framer Motion animations
- React Router DOM with role-based guards
- Context API for auth and cart state
food-dash/
├── server/
│ ├── controllers/
│ │ ├── admin-controller.js
│ │ ├── auth-controller.js
│ │ ├── order-controller.js
│ │ ├── recommendation-controller.js
│ │ └── payment-controller.js
│ ├── database/
│ │ ├── models/
│ │ │ ├── user-model.js
│ │ │ ├── order-model.js
│ │ │ ├── recommendation-model.js
│ │ │ └── admin-model.js
│ │ └── db.js
│ ├── routes/
│ │ ├── auth-router.js
│ │ ├── order-router.js
│ │ ├── recommendation-router.js
│ │ └── admin-router.js
│ ├── middlewares/
│ │ └── error-middleware.js
│ ├── utils/
│ │ ├── recommendation-engine.js
│ │ └── logger.js
│ ├── validators/
│ └── server.js
└── client/
├── src/
│ ├── components/
│ │ ├── Layout/
│ │ ├── ui/
│ │ ├── client/
│ │ └── admin/
│ ├── pages/
│ │ ├── client/
│ │ │ ├── Home.jsx
│ │ │ ├── Qr.jsx
│ │ │ ├── Cart.jsx
│ │ │ ├── Login.jsx
│ │ │ └── Order-Success.jsx
│ │ └── admin/
│ │ ├── Admin-Home.jsx
│ │ ├── Table-Management.jsx
│ │ ├── User-Management.jsx
│ │ └── Order-Management.jsx
│ ├── store/
│ │ ├── auth.jsx
│ │ └── cart.jsx
│ ├── hooks/
│ ├── lib/
│ ├── App.jsx
│ └── main.jsx
├── index.html
├── package.json
└── vite.config.js
- Node.js v16 or higher
- MongoDB v4.4 or higher
- Redis v6 or higher
MONGODB_URI=mongodb://localhost:27017/fooddash
REDIS_URL=redis://localhost:6379
JWT_SECRET=your_jwt_secret_key
ADMIN_JWT_SECRET=your_admin_jwt_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
RAZORPAY_KEY_ID=your_razorpay_key_id
RAZORPAY_KEY_SECRET=your_razorpay_key_secret
PORT=5000
NODE_ENV=developmentVITE_API_URL=http://localhost:5000
VITE_GOOGLE_CLIENT_ID=your_google_client_id
VITE_RAZORPAY_KEY_ID=your_razorpay_key_id# Clone the repository
git clone <repository-url>
cd food-dash
# Install backend dependencies
cd server && npm install
# Install frontend dependencies
cd ../client && npm install# Terminal 1 — Backend
cd server && npm run dev
# Terminal 2 — Frontend
cd client && npm run devThe frontend is available at http://localhost:5173 and the API at http://localhost:5000.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
Register a new user |
| POST | /api/auth/login |
Login with credentials |
| POST | /api/auth/google-auth |
Google OAuth login |
| POST | /api/auth/logout |
Logout current user |
| GET | /api/auth/verify-token |
Verify JWT token |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/order/create |
Create a new order |
| GET | /api/order/user/:userId |
Get orders for a user |
| PUT | /api/order/:orderId/status |
Update order status |
| GET | /api/order/:orderId |
Get a specific order |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/recommendations/cart |
Get cart-based recommendations |
| GET | /api/recommendations/popular |
Get popular items |
| GET | /api/recommendations/user |
Get personalized recommendations |
| POST | /api/recommendations/retrain |
Retrain the AI model (admin only) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/admin/dashboard |
Dashboard analytics |
| GET | /api/admin/users |
List all users |
| GET | /api/admin/orders |
List all orders |
| POST | /api/admin/tables |
Create a table |
| PUT | /api/admin/tables/:id |
Update a table |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/payment/create-order |
Create a Razorpay order |
| POST | /api/payment/verify |
Verify a payment |
| GET | /api/payment/history |
Get payment history |
Note
Full user API documentation: user-api-documentation.md
// server/utils/recommendation-engine.js
const config = {
embeddingDimension: 32,
epochs: 50,
batchSize: 32,
learningRate: 0.001,
dropoutRate: 0.3
};// server/server.js
const rateLimiter = {
points: 100, // requests per window
duration: 30, // window in seconds
blockDuration: 15 // block duration in minutes
};Note
Full recommendation engine documentation: recommendation-engine.md
- JWT and session-based authentication with role separation (user vs admin)
- Redis-backed rate limiting for DDoS mitigation
- Zod schema validation on all inputs
- Helmet for HTTP security headers
- bcrypt password hashing
- CORS policy enforcement
- Environment-variable-based secrets management
- Set all production environment variables
- Provision a MongoDB Atlas cluster or self-hosted MongoDB instance
- Provision a managed Redis instance
- Deploy to your cloud platform of choice
- Configure SSL and a reverse proxy (e.g., Nginx)
cd client && npm run buildDeploy the dist/ directory to any static hosting provider. Set the VITE_API_URL environment variable to point to the production API.
MongoDB connection fails — Verify the service is running and MONGODB_URI is correct. Check that the database user has the required permissions.
Redis connection error — Confirm Redis is running and REDIS_URL matches. Check for network or firewall rules blocking the port.
Authentication issues — Double-check GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and JWT_SECRET. Confirm OAuth redirect URIs are registered in Google Cloud Console.
Payment gateway errors — Validate RAZORPAY_KEY_ID and RAZORPAY_KEY_SECRET. Ensure webhook endpoints are publicly accessible and correctly configured in the Razorpay dashboard.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature - Open a pull request
Follow the existing ESLint and Prettier configuration. Write tests for new functionality and use conventional commit messages.
This project is licensed under the MIT License. See the LICENSE file for details.
