Fresh โข Fast โข Delivered โ A full-stack food delivery platform built with microservices architecture
FoodMesh is a modern food delivery web application that connects customers with nearby restaurants. It supports three user roles โ Customer, Seller (Restaurant Owner), and Rider โ each with their own dedicated dashboard and features.
- Google OAuth login
- Browse nearby restaurants using geolocation
- Search restaurants by name or cuisine
- View restaurant menus
- Add items to cart (single restaurant at a time)
- Checkout with delivery address selection
- Pay securely via Razorpay
- Download PDF receipt after payment
- Manage saved delivery addresses (with interactive map)
- Cart counter in navbar updates in real time
- Create and manage restaurant profile
- Upload restaurant images via Cloudinary
- Toggle restaurant open/closed status
- Add, edit, delete menu items
- Toggle menu item availability
- Restaurant verification system
- JWT-based authentication with role-based access control
- Automatic token refresh on API calls
- Location detection using browser Geolocation API + Nominatim reverse geocoding
- Responsive UI built with TailwindCSS
| Technology | Purpose |
|---|---|
| React + TypeScript | UI framework |
| Vite | Build tool |
| TailwindCSS | Styling |
| ShadCN UI | Component library |
| React Router v6 | Client-side routing |
| Axios | HTTP client |
| React Leaflet | Interactive maps |
| jsPDF | PDF receipt generation |
| React Hot Toast | Notifications |
| Lucide React | Icons |
| Service | Port | Responsibility |
|---|---|---|
| Auth Service | 8080 | Google OAuth, JWT, user management |
| Restaurant Service | 8001 | Restaurants, menus, cart, orders, addresses |
| Utils Service | 8002 | File uploads (Cloudinary), Razorpay payments |
| Technology | Purpose |
|---|---|
| MongoDB + Mongoose | Database |
| RabbitMQ | Message queue (payment events) |
| Cloudinary | Image storage |
| Razorpay | Payment gateway |
| Docker | RabbitMQ container |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Frontend (React) โ
โ localhost:5173 โ
โโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Auth Service โ โ Restaurant โ โ Utils โ
โ Port 8080 โ โ Service โ โ Service โ
โ โ โ Port 8001 โ โ Port 8002 โ
โ - Google โ โ โ โ โ
โ OAuth โ โ - Restaurantsโ โ - Cloudinary โ
โ - JWT tokens โ โ - Menus โ โ uploads โ
โ - User mgmt โ โ - Cart โ โ - Razorpay โ
โโโโโโโโโโโโโโโโ โ - Orders โ โ payments โ
โ - Addresses โ โโโโโโโโฌโโโโโโโโ
โโโโโโโโฌโโโโโโโโ โ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ RabbitMQ โ
โ Payment Event Queue โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโ
โ MongoDB โ
โโโโโโโโโโโโโโโโ
- Node.js v18+
- MongoDB (local or Atlas)
- Docker Desktop (for RabbitMQ)
- Razorpay account (test mode)
- Google Cloud Console project (OAuth credentials)
- Cloudinary account
git clone https://github.com/Alphasf9/Food-Mesh.git
cd foodmeshdocker run -d --name rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-managementRabbitMQ dashboard โ http://localhost:15672 (guest/guest)
PORT=8080
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secretPORT1=8001
MONGODB_URI=your_mongodb_uri
JWT_SECRET=your_jwt_secret
RABBITMQ_URL=amqp://guest:guest@localhost:5672
PAYMENT_QUEUE=payment_event
INTERNAL_SERVICE_KEY=your_internal_key
UPLOAD_SERVICE_URL=http://localhost:8002/api/v1/mediaPORT2=8002
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxx
RAZORPAY_KEY_SECRET=your_razorpay_secret
RABBITMQ_URL=amqp://guest:guest@localhost:5672
PAYMENT_QUEUE=payment_event
ORDER_API_URL=http://localhost:8001/api/v1/orders
INTERNAL_SERVICE_KEY=your_internal_keyVITE_API_URL=http://localhost:8080/api/v1/auth
VITE_RESTAURANT_API_URL=http://localhost:8001/api/v1/restaurants
VITE_MENU_API_URL=http://localhost:8001/api/v1/menu
VITE_CART_API_URL=http://localhost:8001/api/v1/cart
VITE_ADDRESS_API_URL=http://localhost:8001/api/v1/address
VITE_ORDER_API_URL=http://localhost:8001/api/v1/orders
VITE_PAYMENT_API_URL=http://localhost:8002/api/v1/paymentcd services/auth
npm install
npm run devcd services/restaurant
npm install
npm run devcd services/utils
npm install
npm run devcd frontend
npm install
npm run devFoodMesh/
โโโ frontend/ # React + TypeScript frontend
โ โโโ src/
โ โ โโโ components/ # Reusable components
โ โ โโโ context/ # AppContext (auth, cart, location)
โ โ โโโ pages/ # Page components
โ โ โโโ types/ # TypeScript interfaces
โ โโโ package.json
โ
โโโ services/
โโโ auth/ # Auth microservice
โ โโโ src/
โ โ โโโ controllers/
โ โ โโโ middlewares/
โ โ โโโ model/
โ โ โโโ routes/
โ โโโ package.json
โ
โโโ restaurant/ # Restaurant microservice
โ โโโ src/
โ โ โโโ controllers/
โ โ โโโ middlewares/
โ โ โโโ models/
โ โ โโโ routes/
โ โโโ package.json
โ
โโโ utils/ # Utils microservice
โโโ src/
โ โโโ controllers/
โ โโโ config/
โ โโโ routes/
โโโ package.json
User clicks "Login with Google"
โ Google OAuth popup opens
โ User grants permission
โ Auth code sent to backend
โ Backend exchanges code for tokens
โ JWT issued with { id, name, email, role, restaurantId }
โ Token stored in localStorage
โ User redirected based on role
Customer clicks "Pay"
โ Order created in DB (status: pending)
โ Utils service creates Razorpay order
โ Razorpay modal opens
โ Customer pays
โ Backend verifies payment signature
โ Message published to RabbitMQ queue
โ Restaurant service consumes message
โ Order updated (status: placed, paymentStatus: paid)
โ Customer redirected to receipt page
โ PDF receipt available for download
| Role | Access |
|---|---|
| Customer | Browse restaurants, order food, manage cart, checkout, view orders |
| Seller | Manage restaurant, menu items, toggle availability, view dashboard |
| Rider | (Coming soon) Accept deliveries, track orders |
| Method | Route | Description |
|---|---|---|
| POST | /api/v1/auth/login |
Google OAuth login |
| POST | /api/v1/auth/logout |
Logout |
| GET | /api/v1/auth/my-user |
Get current user |
| PUT | /api/v1/auth/add-role |
Set user role |
| Method | Route | Description |
|---|---|---|
| GET | /api/v1/restaurants/nearby-restaurants |
Get nearby restaurants |
| GET | /api/v1/restaurants/my-restaurant |
Get seller's restaurant |
| POST | /api/v1/restaurants/add-restaurant |
Create restaurant |
| PUT | /api/v1/restaurants/update-restaurant |
Update restaurant |
| PATCH | /api/v1/restaurants/update-status |
Toggle open/closed |
| DELETE | /api/v1/restaurants/delete-restaurant |
Delete restaurant |
| GET | /api/v1/menu/get-all-menu-items/:id |
Get menu items |
| POST | /api/v1/menu/add-menu-item |
Add menu item |
| PATCH | /api/v1/menu/edit-menu-item/:id |
Edit menu item |
| DELETE | /api/v1/menu/delete-menu-item/:id |
Delete menu item |
| PATCH | /api/v1/menu/toggle-availability/:id |
Toggle availability |
| GET | /api/v1/cart/my-cart |
Get cart |
| POST | /api/v1/cart/add-to-cart |
Add to cart |
| PUT | /api/v1/cart/increment-cart-item |
Increase quantity |
| PUT | /api/v1/cart/decrement-cart-item |
Decrease quantity |
| DELETE | /api/v1/cart/remove-cart-item/:itemId |
Remove item |
| DELETE | /api/v1/cart/clear-cart |
Clear cart |
| POST | /api/v1/orders/create-order |
Create order |
| GET | /api/v1/orders/order-by-payment/:paymentId |
Get order by payment |
| Method | Route | Description |
|---|---|---|
| POST | /api/v1/media/upload |
Upload image to Cloudinary |
| POST | /api/v1/payment/create-razorpay-order |
Create Razorpay order |
| POST | /api/v1/payment/verify-payment |
Verify payment signature |
Use Razorpay test credentials:
Card Number : 5267 3181 8797 5449
Expiry : 02/26
CVV : 123
OTP : 1234
Or use Net Banking:
Username : success
Password : success
- Rider service (delivery tracking)
- Real-time order tracking with Socket.io
- Push notifications
- Admin panel (restaurant verification)
- Reviews and ratings system
- Order history page
- Loyalty points system
- Mobile app (React Native)
Haseeb
- Building FoodMesh as a full-stack microservices project
This project is licensed under the ISC License.
Built with โค๏ธ using React, Node.js, MongoDB, RabbitMQ, and Razorpay