# dineshkadel/multi_vendor_food_delivery-_ec architecture

> Architecture diagram of the GitHub repository dineshkadel/multi_vendor_food_delivery-_ec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dineshkadel/multi_vendor_food_delivery-_ec
- Repository: https://github.com/dineshkadel/multi_vendor_food_delivery-_ec

## Overview

This is a multi-vendor food delivery platform for customers, restaurant vendors, delivery workers, and administrators. Customers browse restaurants and menus, build a cart, place and pay for orders, then track delivery and review completed orders; vendors manage restaurants, menus, and orders, while delivery workers update delivery tasks and admins oversee the platform. The graph reflects documented capabilities and sampled wiring; several feature-specific controller and page links are represented at their existing directory level because their source was not sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/App.jsx) (Web Router), [`backend/index.js`](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/index.js) (API Server), [`frontend/src/pages`](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages) (Browse Checkout Track), [`backend/controllers`](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/controllers) (Commerce Controllers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web Application"]
  node_webapp["Web Router<br/>[App.jsx]"]
  node_identity["Auth Context<br/>[AuthContext.jsx]"]
  node_cartcontext["Cart Context<br/>[CartContext.jsx]"]
end

subgraph group_commerce["Customer Commerce"]
  node_customerpages["Browse Checkout Track"]
  node_customerservices["Commerce Services"]
  node_payments["Payment Gateways"]
end

subgraph group_operations["Platform Operations"]
  node_vendorpages["Vendor Console"]
  node_deliverypages["Delivery Console"]
  node_adminpages["Admin Console"]
  node_adminservice["Admin Service<br/>[adminService.js]"]
  node_socketclient["Realtime Client<br/>[socket.js]"]
end

subgraph group_api["API Services"]
  node_server["API Server<br/>[index.js]"]
  node_commerce_routes["Commerce Routes"]
  node_commerce_controllers["Commerce Controllers"]
  node_operations_routes["Role Routes"]
  node_operations_controllers["Role Controllers"]
  node_notifications["Notifications<br/>[notifications.js]"]
  node_socketserver["Realtime Server<br/>[socket.js]"]
end

subgraph group_state["Persistent State"]
  node_database[("MongoDB Models")]
end

node_customer(("Customer"))
node_vendor(("Vendor"))
node_courier(("Delivery Worker"))
node_administrator(("Administrator"))
node_gateway{{"eSewa / Stripe"}}

node_customer -->|"uses"| node_webapp
node_vendor -->|"uses"| node_webapp
node_courier -->|"uses"| node_webapp
node_administrator -->|"uses"| node_webapp
node_webapp -->|"provides auth"| node_identity
node_webapp -->|"provides cart"| node_cartcontext
node_webapp -->|"routes to"| node_customerpages
node_webapp -->|"routes to"| node_vendorpages
node_webapp -->|"routes to"| node_deliverypages
node_webapp -->|"routes to"| node_adminpages
node_customerpages -->|"requests data"| node_customerservices
node_adminpages -->|"requests data"| node_adminservice
node_customerservices -->|"HTTP API"| node_server
node_adminservice -->|"HTTP API"| node_server
node_server -->|"mounts"| node_commerce_routes
node_server -->|"mounts"| node_operations_routes
node_commerce_routes -->|"dispatches"| node_commerce_controllers
node_operations_routes -->|"dispatches"| node_operations_controllers
node_commerce_controllers -->|"reads / writes"| node_database
node_operations_controllers -->|"reads / writes"| node_database
node_commerce_controllers -->|"creates alerts"| node_notifications
node_payments -->|"updates payment"| node_database
node_payments -.->|"creates / verifies"| node_gateway
node_customerpages -.->|"tracks updates"| node_socketclient
node_socketclient -.->|"socket events"| node_socketserver
node_server -->|"initializes"| node_socketserver

click node_webapp "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/App.jsx"
click node_identity "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/context/AuthContext.jsx"
click node_cartcontext "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/context/CartContext.jsx"
click node_customerpages "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages"
click node_customerservices "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/services"
click node_vendorpages "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages"
click node_deliverypages "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages/delivery"
click node_adminpages "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages/admin"
click node_adminservice "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/services/adminService.js"
click node_socketclient "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/utils/socket.js"
click node_payments "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/controllers/paymentController.js"
click node_server "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/index.js"
click node_commerce_routes "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/routes"
click node_commerce_controllers "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/controllers"
click node_operations_routes "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/routes"
click node_operations_controllers "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/controllers"
click node_notifications "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/utils/notifications.js"
click node_socketserver "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/config/socket.js"
click node_database "https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/models"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_identity,node_cartcontext toneBlue
class node_customerpages,node_customerservices,node_payments toneAmber
class node_vendorpages,node_deliverypages,node_adminpages,node_adminservice,node_socketclient toneMint
class node_server,node_commerce_routes,node_commerce_controllers,node_operations_routes,node_operations_controllers,node_notifications,node_socketserver,node_courier toneRose
class node_database,node_customer,node_vendor,node_administrator,node_gateway toneIndigo
```

## Components

### Web Application

- [Web Router](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth Context](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Cart Context](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`

### Customer Commerce

- [Browse Checkout Track](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages): `frontend/src/pages`
- [Commerce Services](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/services): `frontend/src/services`
- [Payment Gateways](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/controllers/paymentController.js): `backend/controllers/paymentController.js`

### Platform Operations

- [Vendor Console](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages): `frontend/src/pages`
- [Delivery Console](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages/delivery): `frontend/src/pages/delivery`
- [Admin Console](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Admin Service](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/services/adminService.js): `frontend/src/services/adminService.js`
- [Realtime Client](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/frontend/src/utils/socket.js): `frontend/src/utils/socket.js`

### API Services

- [API Server](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/index.js): `backend/index.js`
- [Commerce Routes](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/routes): `backend/routes`
- [Commerce Controllers](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/controllers): `backend/controllers`
- [Role Routes](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/routes): `backend/routes`
- [Role Controllers](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/controllers): `backend/controllers`
- [Notifications](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/utils/notifications.js): `backend/utils/notifications.js`
- [Realtime Server](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/blob/main/backend/config/socket.js): `backend/config/socket.js`

### Persistent State

- [MongoDB Models](https://github.com/dineshkadel/multi_vendor_food_delivery-_ec/tree/main/backend/models): `backend/models`

### Other components

- **Customer**
- **Vendor**
- **Delivery Worker**
- **Administrator**
- **eSewa / Stripe**

## Connections

- Customer → Web Router: uses
- Vendor → Web Router: uses
- Delivery Worker → Web Router: uses
- Administrator → Web Router: uses
- Web Router → Auth Context: provides auth
- Web Router → Cart Context: provides cart
- Web Router → Browse Checkout Track: routes to
- Web Router → Vendor Console: routes to
- Web Router → Delivery Console: routes to
- Web Router → Admin Console: routes to
- Browse Checkout Track → Commerce Services: requests data
- Admin Console → Admin Service: requests data
- Commerce Services → API Server: HTTP API
- Admin Service → API Server: HTTP API
- API Server → Commerce Routes: mounts
- API Server → Role Routes: mounts
- Commerce Routes → Commerce Controllers: dispatches
- Role Routes → Role Controllers: dispatches
- Commerce Controllers → MongoDB Models: reads / writes
- Role Controllers → MongoDB Models: reads / writes
- Commerce Controllers → Notifications: creates alerts
- Payment Gateways → MongoDB Models: updates payment
- Payment Gateways → eSewa / Stripe: creates / verifies
- Browse Checkout Track → Realtime Client: tracks updates
- Realtime Client → Realtime Server: socket events
- API Server → Realtime Server: initializes
