A full-stack food delivery application built with React, Node.js, Express, and MongoDB. Quick-Dine allows customers to browse food items, place orders, make payments, and track their orders in real-time.
- Home Page - Browse food categories and items
- Shopping Cart - Add/remove items with quantity management
- User Authentication - Secure login and registration with httpOnly cookies
- Payment Integration - Stripe payment processing with webhook verification
- Order Tracking - View order history and track status
- Order Verification - Dual-path payment verification (webhook + redirect)
- Admin Dashboard - Manage orders and food items
- Add Food Items - Upload new food items with images
- Order Management - View all orders and update status
- Real-time Updates - Status changes reflect instantly
- React.js - UI library
- React Router - Client-side routing
- Vite - Build tool and dev server
- Axios - HTTP client
- CSS3 - Styling with responsive design
- React Toastify - Notifications
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - MongoDB object modeling
- JWT - Authentication
- Multer - File upload handling
- Stripe - Payment processing
- bcrypt - Password hashing
- CORS - Cross-origin resource sharing
Quick-Dine/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable components
│ │ ├── Pages/ # Page components
│ │ ├── context/ # React context for state management
│ │ ├── assets/ # Images and static files
│ │ └── App.jsx # Main app component
│ ├── public/ # Public assets
│ └── package.json # Frontend dependencies
├── admin/ # React admin panel
│ ├── src/
│ │ ├── components/ # Admin components
│ │ ├── pages/ # Admin pages
│ │ ├── assets/ # Admin assets
│ │ └── App.jsx # Admin app component
│ └── package.json # Admin dependencies
├── backend/ # Node.js backend
│ ├── config/ # Database configuration
│ ├── controllers/ # Route controllers
│ ├── middlewares/ # Custom middlewares
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── uploads/ # Uploaded images
│ ├── server.js # Main server file
│ └── package.json # Backend dependencies
└── README.md # Project documentation
- Node.js (v14 or higher)
- MongoDB (local or cloud)
- Stripe account for payments
git clone https://github.com/shreyajaiswal17/Quick-Dine.git
cd Quick-Dinecd backend
npm installCreate a .env file in the backend directory:
PORT=4000
NODE_ENV=development
JWT_SECRET=your_jwt_secret_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=whsec_test_your_webhook_secret
MONGODB_URI=mongodb://localhost:27017/quick-dine
FRONTEND_URL=http://localhost:5173Start the backend server:
npm run serverThe backend will run on http://localhost:4000
For Webhook Testing (Local):
stripe listen --forward-to localhost:4000/api/order/webhookCopy the webhook signing secret and add to .env as STRIPE_WEBHOOK_SECRET
cd frontend
npm install
npm run devThe frontend will run on http://localhost:5173
cd admin
npm install
npm run devThe admin panel will run on http://localhost:5174
- Push to GitHub: Make sure your code is pushed to GitHub
- Create Render Account: Sign up at render.com
- Create Web Service:
- Connect your GitHub repository
- Select the
backendfolder - Set build command:
npm install - Set start command:
npm start
- Environment Variables: Add these in Render dashboard:
NODE_ENV=production MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=whsec_live_your_webhook_secret FRONTEND_URL=https://your-frontend-app.vercel.app
-
Install Vercel CLI:
npm i -g vercel
-
Deploy Frontend:
cd frontend vercel --prod -
Deploy Admin Panel:
cd admin vercel --prod -
Environment Variables: Add in Vercel dashboard:
VITE_BACKEND_URL=https://your-backend-app.onrender.com
- Update CORS: Replace the placeholder URLs in
server.jswith your actual Vercel URLs - Setup Stripe Webhook:
- Go to Stripe Webhooks
- Click + Add endpoint
- Enter:
https://your-backend.onrender.com/api/order/webhook - Select events:
charge.succeeded,charge.failed,charge.refunded - Copy Signing secret and add to Render
.envasSTRIPE_WEBHOOK_SECRET
- Test All Features: Verify authentication (cookies), payments (webhook + redirect), and file uploads work in production
POST /api/user/register- User registrationPOST /api/user/login- User loginPOST /api/user/verify- Verify auth status (checks cookie)POST /api/user/logout- User logout (clears cookie)
GET /api/food/list- Get all food itemsPOST /api/food/add- Add new food item (Admin)POST /api/food/remove- Remove food item (Admin)
POST /api/cart/add- Add item to cartPOST /api/cart/remove- Remove item from cartPOST /api/cart/get- Get cart items
POST /api/order/place- Place new orderPOST /api/order/verify- Verify payment (frontend redirect)POST /api/order/webhook- Stripe webhook for payment confirmationPOST /api/order/userorders- Get user ordersGET /api/order/list- Get all orders (Admin)POST /api/order/status- Update order status (Admin)
Quick-Dine uses Stripe for secure payment processing with dual verification:
- Setup: Configure Stripe keys in environment variables
- Process: Orders create Stripe checkout sessions with orderId in metadata
- Webhook Verification (Primary):
- Stripe sends
charge.succeededevent - Backend webhook verifies signature and marks order as paid
- Reliable even if user doesn't complete redirect
- Stripe sends
- Redirect Verification (Secondary):
- User redirected to
/verifyendpoint - Checks if webhook already confirmed, or confirms now
- Result: Payment is confirmed by BOTH paths
- User redirected to
- Webhook signature verification using
STRIPE_WEBHOOK_SECRET - Raw body parser for webhook (before JSON parsing)
- Race condition prevention with double-check logic
- Order metadata prevents tampering
Quick-Dine uses secure httpOnly cookies for authentication:
- Registration/Login: User credentials sent to backend
- JWT Generation: Backend creates JWT with user ID
- Cookie Storage: JWT stored in httpOnly cookie (inaccessible to JavaScript)
- Auto-Attach: Browser automatically sends cookie with every request
- Middleware Verification: Auth middleware extracts and verifies JWT
- Access Grant: Verified user ID added to request
- httpOnly: Protects against XSS attacks
- Secure: Only sent over HTTPS in production
- sameSite: strict: Prevents CSRF attacks
- maxAge: 24-hour expiration
POST /api/user/register- Create new user accountPOST /api/user/login- Login and receive httpOnly cookiePOST /api/user/verify- Check authentication statusPOST /api/user/logout- Logout and clear cookie
- Mobile-first approach
- Adaptive layouts for all screen sizes
- Touch-friendly interfaces
- Order status changes instantly
- Cart updates without page refresh
- Admin dashboard reflects live data
- httpOnly Cookies - JWT stored in httpOnly cookies (XSS protection)
- CSRF Protection -
sameSite: strictcookie policy - Secure Transport - HTTPS-only cookies in production
- Password Hashing - bcrypt with salt rounds
- Protected Routes - Auth middleware on all protected endpoints
- Webhook Verification - Stripe signature verification
- Input Validation - Sanitization on all user inputs
PORT=4000
NODE_ENV=development
MONGODB_URI=mongodb://localhost:27017/quick-dine
JWT_SECRET=your_jwt_secret_here
STRIPE_SECRET_KEY=sk_test_your_stripe_key_here
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret_here
FRONTEND_URL=http://localhost:5173Production (.env on Render)
NODE_ENV=production
STRIPE_WEBHOOK_SECRET=whsec_live_your_live_secret- Browse food items on the home page
- Add items to cart with desired quantities
- Proceed to checkout and enter delivery address
- Make payment through Stripe
- Track order status in "My Orders" section
- Access admin panel at
http://localhost:5174 - Add new food items with images
- View and manage all orders
- Update order status (Food Processing → Out for Delivery → Delivered)
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Shreya Jaiswal
- GitHub: @shreyajaiswal17
⭐ If you like this project, please give it a star on GitHub!