How darshan0001-top/urban-food-cart works
Urban Foodkart is a three-role food-delivery application. Customers authenticate, browse city-based shops and dishes, maintain a persistent cart, check out, and follow orders; owners manage shops, menus, and order preparation; delivery partners accept ready orders and update delivery progress. The frontend communicates with an Express API, whose controllers coordinate MongoDB-backed models and optional email/Firebase services. The README documents several frontend and backend capabilities whose individual source was not sampled, so subsystem paths use supported enclosing directories and uncertain internal wiring is omitted.
Main entry points: index.js Express API · App.jsx Web application · models Mongoose domain models · auth.controllers.js Authentication and OTP
Components 27
Customer and role apps
- Web application
frontend/src/App.jsx - Accounts UI
frontend/src/context/AuthContext.jsx - Shop and dish browsing
frontend/src/pages/Home.jsx - Shop and menu management
frontend/src/pages/CreateEditShop.jsx - Persistent cart
frontend/src/context/CartContext.jsx - Checkout
frontend/src/pages/Checkout.jsx - Customer orders
frontend/src/pages/MyOrders.jsx - Owner order dashboard
frontend/src/pages/OwnerDashboard.jsx - Delivery dashboard
frontend/src/pages/DeliveryDashboard.jsx
Backend API
- Express API
backend/index.js - Authentication and OTP
backend/controllers/auth.controllers.js - Shop and item services
backend/controllers/item.controllers.js - Cart services
backend/controllers/cart.controllers.js - Order lifecycle
backend/controllers/order.controllers.js - Auth routes
backend/routes/auth.routes.js - Item routes
backend/routes/item.routes.js - Shop routes
backend/routes/shop.routes.js - Order routes
backend/routes/order.routes.js
Domain persistence
- Database connection
backend/config/db.js - Mongoose domain models
backend/models - MongoDB
External integrations
- Firebase identity
backend/utils/firebase.js - OTP email
backend/utils/mail.js - Email service
Other components
- Customer
- Restaurant owner
- Delivery partner
Connections 38
- Customer → Web application: uses
- Restaurant owner → Web application: uses
- Delivery partner → Web application: uses
- Web application → Accounts UI: provides routes
- Web application → Shop and dish browsing: provides routes
- Web application → Shop and menu management: provides routes
- Web application → Persistent cart: provides routes
- Web application → Checkout: provides routes
- Web application → Customer orders: provides routes
- Web application → Owner order dashboard: provides routes
- Web application → Delivery dashboard: provides routes
- Accounts UI → Express API: sends requests
- Shop and dish browsing → Express API: requests catalog
- Shop and menu management → Express API: manages shop
- Persistent cart → Express API: updates cart
- Checkout → Express API: places order
- Customer orders → Express API: reads and cancels
- Owner order dashboard → Express API: updates statuses
- Delivery dashboard → Express API: accepts and updates
- Express API → Auth routes: mounts
- Express API → Item routes: mounts
- Express API → Shop routes: mounts
- Express API → Order routes: mounts
- Auth routes → Authentication and OTP: dispatches
- Item routes → Shop and item services: dispatches
- Shop routes → Shop and item services: dispatches shop actions
- Order routes → Order lifecycle: dispatches
- Order lifecycle → Cart services: loads cart
- Authentication and OTP → Mongoose domain models: reads and writes users
- Shop and item services → Mongoose domain models: reads and writes shops and items
- Cart services → Mongoose domain models: reads and writes cart and items
- Order lifecycle → Mongoose domain models: reads and writes orders
- Database connection → MongoDB: connects
- Mongoose domain models → MongoDB: persists domain data
- Authentication and OTP → Firebase identity: verifies Google tokens
- Firebase identity → MongoDB: none
- Authentication and OTP → OTP email: sends reset OTP
- OTP email → Email service: delivers email