# excorsite/digital_mandu_platform architecture

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

- Interactive diagram: https://gitdiagram.com/excorsite/digital_mandu_platform
- Repository: https://github.com/excorsite/digital_mandu_platform

## Overview

DigitalMandu is a food-ordering and eCommerce platform with buyer, seller, and admin experiences. Buyers browse products and recommendations, manage a cart, place orders, and pay by COD or Khalti; they can also manage profiles and reviews. Seller/admin workflows cover product, order, and user management. The graph follows the documented frontend-to-API structure and sampled controller behavior. Several route and page internals were not sampled, so those links reflect README documentation rather than inspected call sites; realtime is documented only as a Socket.IO scaffold.

Main entry points: [`Backend/app.js`](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/app.js) (Express application), [`Frontend/src/routes.jsx`](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/routes.jsx) (App routes), [`Frontend/src/api/endpoints`](https://github.com/excorsite/digital_mandu_platform/tree/main/Frontend/src/api/endpoints) (API endpoints), [`Backend/controller/user/payment/paymentController.js`](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/payment/paymentController.js) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_router["App routes<br/>[routes.jsx]"]
  node_browse["Browse products<br/>[Home.jsx]"]
  node_product_detail["Product details<br/>[ProductDetails.jsx]"]
  node_cart_page["Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders_page["Order history<br/>[MyOrders.jsx]"]
  node_auth_pages["Sign in / register<br/>[Login.jsx]"]
  node_admin_pages["Admin console<br/>[Orders.jsx]"]
  node_seller_pages["Seller console<br/>[Orders.jsx]"]
  node_payment_pages["Payment status<br/>[KhaltiSuccess.jsx]"]
  node_api_client["API client<br/>[client.js]"]
  node_api_endpoints["API endpoints"]
end

subgraph group_backend["API workflows"]
  node_app["Express application<br/>[app.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_catalog_controller["Product catalog"]
  node_recommendations["Recommendations"]
  node_cart_controller["Cart management<br/>[cartController.js]"]
  node_order_controller["Order management<br/>[orderController.js]"]
  node_payment_controller["Payment processing"]
  node_review_controller["Product reviews"]
  node_profile_controller["Profile management"]
  node_admin_product["Admin products"]
  node_admin_orders["Admin orders"]
  node_admin_users["User management<br/>[userController.js]"]
  node_recommendation_service["Recommendation logic"]
end

subgraph group_data["Persistent data"]
  node_user_model["User records<br/>[userModel.js]"]
  node_product_model["Product records<br/>[productModel.js]"]
  node_order_model["Order records<br/>[orderModel.js]"]
  node_review_model["Review records<br/>[reviewModel.js]"]
  node_mongo[("MongoDB<br/>[database.js]")]
end

subgraph group_integrations["External services"]
  node_khalti["Khalti"]
  node_email["Email service<br/>[sendEmail.js]"]
end

node_buyer(("Buyer"))
node_staff(("Seller / Admin"))

node_buyer -->|"uses"| node_router
node_staff -->|"uses"| node_router
node_router -->|"routes to"| node_browse
node_router -->|"routes to"| node_product_detail
node_router -->|"routes to"| node_cart_page
node_router -->|"routes to"| node_checkout
node_router -->|"routes to"| node_orders_page
node_router -->|"routes to"| node_auth_pages
node_router -->|"routes to"| node_admin_pages
node_router -->|"routes to"| node_seller_pages
node_router -->|"routes to"| node_payment_pages
node_browse -->|"requests catalog"| node_api_endpoints
node_product_detail -->|"requests details"| node_api_endpoints
node_cart_page -->|"requests cart"| node_api_endpoints
node_checkout -->|"places order"| node_api_endpoints
node_orders_page -->|"requests orders"| node_api_endpoints
node_auth_pages -->|"requests auth"| node_api_endpoints
node_admin_pages -->|"requests admin"| node_api_endpoints
node_seller_pages -->|"requests seller"| node_api_endpoints
node_payment_pages -->|"checks payment"| node_api_endpoints
node_api_endpoints -->|"uses"| node_api_client
node_api_client -->|"HTTP requests"| node_app
node_app -->|"dispatches"| node_auth_controller
node_app -->|"dispatches"| node_catalog_controller
node_app -->|"dispatches"| node_recommendations
node_app -->|"dispatches"| node_cart_controller
node_app -->|"dispatches"| node_order_controller
node_app -->|"dispatches"| node_payment_controller
node_app -->|"dispatches"| node_review_controller
node_app -->|"dispatches"| node_profile_controller
node_app -->|"dispatches"| node_admin_product
node_app -->|"dispatches"| node_admin_orders
node_app -->|"dispatches"| node_admin_users
node_auth_controller -->|"reads / writes"| node_user_model
node_auth_controller -->|"sends OTP"| node_email
node_catalog_controller -->|"reads"| node_product_model
node_catalog_controller -->|"reads"| node_review_model
node_recommendations -->|"gets candidates"| node_recommendation_service
node_recommendations -->|"reads products"| node_product_model
node_recommendation_service -->|"reads purchases"| node_order_model
node_cart_controller -->|"reads products"| node_product_model
node_cart_controller -->|"reads / updates cart"| node_user_model
node_order_controller -->|"reads / writes"| node_order_model
node_order_controller -->|"reads / clears cart"| node_user_model
node_payment_controller -->|"reads / updates"| node_order_model
node_payment_controller -->|"clears cart"| node_user_model
node_payment_controller -->|"initiates / verifies"| node_khalti
node_review_controller -->|"checks product"| node_product_model

click node_router "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/routes.jsx"
click node_browse "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Home.jsx"
click node_product_detail "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/ProductDetails.jsx"
click node_cart_page "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Cart.jsx"
click node_checkout "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Checkout.jsx"
click node_orders_page "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/MyOrders.jsx"
click node_auth_pages "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/auth/login/Login.jsx"
click node_admin_pages "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/admin/Orders.jsx"
click node_seller_pages "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/seller/Orders.jsx"
click node_payment_pages "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/payment/KhaltiSuccess.jsx"
click node_api_client "https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/api/client.js"
click node_api_endpoints "https://github.com/excorsite/digital_mandu_platform/tree/main/Frontend/src/api/endpoints"
click node_app "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/app.js"
click node_auth_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/auth/authController.js"
click node_catalog_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/global/globalController.js"
click node_recommendations "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/recommendation/recommendationController.js"
click node_cart_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/cart/cartController.js"
click node_order_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/order/orderController.js"
click node_payment_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/payment/paymentController.js"
click node_review_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/review/reviewController.js"
click node_profile_controller "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/customization/customizationController.js"
click node_admin_product "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/product/productController.js"
click node_admin_orders "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/order/adminOrderController.js"
click node_admin_users "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/users/userController.js"
click node_recommendation_service "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/services/recommendationService.js"
click node_user_model "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/userModel.js"
click node_product_model "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/productModel.js"
click node_order_model "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/orderModel.js"
click node_review_model "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/reviewModel.js"
click node_mongo "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/database/database.js"
click node_email "https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/services/sendEmail.js"

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_router,node_browse,node_product_detail,node_cart_page,node_checkout,node_orders_page,node_auth_pages,node_admin_pages,node_seller_pages,node_payment_pages,node_api_client,node_api_endpoints toneBlue
class node_app,node_auth_controller,node_catalog_controller,node_recommendations,node_cart_controller,node_order_controller,node_payment_controller,node_review_controller,node_profile_controller,node_admin_product,node_admin_orders,node_admin_users,node_recommendation_service toneAmber
class node_user_model,node_product_model,node_order_model,node_review_model,node_mongo toneMint
class node_khalti,node_email toneRose
class node_buyer,node_staff toneIndigo
```

## Components

### Frontend experience

- [App routes](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/routes.jsx): `Frontend/src/routes.jsx`
- [Browse products](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Home.jsx): `Frontend/src/pages/buyer/Home.jsx`
- [Product details](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/ProductDetails.jsx): `Frontend/src/pages/buyer/ProductDetails.jsx`
- [Cart](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Cart.jsx): `Frontend/src/pages/buyer/Cart.jsx`
- [Checkout](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/Checkout.jsx): `Frontend/src/pages/buyer/Checkout.jsx`
- [Order history](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/buyer/MyOrders.jsx): `Frontend/src/pages/buyer/MyOrders.jsx`
- [Sign in / register](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/auth/login/Login.jsx): `Frontend/src/pages/auth/login/Login.jsx`
- [Admin console](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/admin/Orders.jsx): `Frontend/src/pages/admin/Orders.jsx`
- [Seller console](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/seller/Orders.jsx): `Frontend/src/pages/seller/Orders.jsx`
- [Payment status](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/pages/payment/KhaltiSuccess.jsx): `Frontend/src/pages/payment/KhaltiSuccess.jsx`
- [API client](https://github.com/excorsite/digital_mandu_platform/blob/main/Frontend/src/api/client.js): `Frontend/src/api/client.js`
- [API endpoints](https://github.com/excorsite/digital_mandu_platform/tree/main/Frontend/src/api/endpoints): `Frontend/src/api/endpoints`

### API workflows

- [Express application](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/app.js): `Backend/app.js`
- [Authentication](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/auth/authController.js): `Backend/controller/auth/authController.js`
- [Product catalog](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/global/globalController.js): `Backend/controller/global/globalController.js`
- [Recommendations](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/recommendation/recommendationController.js): `Backend/controller/recommendation/recommendationController.js`
- [Cart management](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/cart/cartController.js): `Backend/controller/user/cart/cartController.js`
- [Order management](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/order/orderController.js): `Backend/controller/user/order/orderController.js`
- [Payment processing](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/payment/paymentController.js): `Backend/controller/user/payment/paymentController.js`
- [Product reviews](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/review/reviewController.js): `Backend/controller/user/review/reviewController.js`
- [Profile management](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/user/customization/customizationController.js): `Backend/controller/user/customization/customizationController.js`
- [Admin products](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/product/productController.js): `Backend/controller/admin/product/productController.js`
- [Admin orders](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/order/adminOrderController.js): `Backend/controller/admin/order/adminOrderController.js`
- [User management](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/controller/admin/users/userController.js): `Backend/controller/admin/users/userController.js`
- [Recommendation logic](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/services/recommendationService.js): `Backend/services/recommendationService.js`

### Persistent data

- [User records](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/userModel.js): `Backend/models/userModel.js`
- [Product records](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/productModel.js): `Backend/models/productModel.js`
- [Order records](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/orderModel.js): `Backend/models/orderModel.js`
- [Review records](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/models/reviewModel.js): `Backend/models/reviewModel.js`
- [MongoDB](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/database/database.js): `Backend/database/database.js`

### External services

- **Khalti**
- [Email service](https://github.com/excorsite/digital_mandu_platform/blob/main/Backend/services/sendEmail.js): `Backend/services/sendEmail.js`

### Other components

- **Buyer**
- **Seller / Admin**

## Connections

- Buyer → App routes: uses
- Seller / Admin → App routes: uses
- App routes → Browse products: routes to
- App routes → Product details: routes to
- App routes → Cart: routes to
- App routes → Checkout: routes to
- App routes → Order history: routes to
- App routes → Sign in / register: routes to
- App routes → Admin console: routes to
- App routes → Seller console: routes to
- App routes → Payment status: routes to
- Browse products → API endpoints: requests catalog
- Product details → API endpoints: requests details
- Cart → API endpoints: requests cart
- Checkout → API endpoints: places order
- Order history → API endpoints: requests orders
- Sign in / register → API endpoints: requests auth
- Admin console → API endpoints: requests admin
- Seller console → API endpoints: requests seller
- Payment status → API endpoints: checks payment
- API endpoints → API client: uses
- API client → Express application: HTTP requests
- Express application → Authentication: dispatches
- Express application → Product catalog: dispatches
- Express application → Recommendations: dispatches
- Express application → Cart management: dispatches
- Express application → Order management: dispatches
- Express application → Payment processing: dispatches
- Express application → Product reviews: dispatches
- Express application → Profile management: dispatches
- Express application → Admin products: dispatches
- Express application → Admin orders: dispatches
- Express application → User management: dispatches
- Authentication → User records: reads / writes
- Authentication → Email service: sends OTP
- Product catalog → Product records: reads
- Product catalog → Review records: reads
- Recommendations → Recommendation logic: gets candidates
- Recommendations → Product records: reads products
- Recommendation logic → Order records: reads purchases
- Cart management → Product records: reads products
- Cart management → User records: reads / updates cart
- Order management → Order records: reads / writes
- Order management → User records: reads / clears cart
- Payment processing → Order records: reads / updates
- Payment processing → User records: clears cart
- Payment processing → Khalti: initiates / verifies
- Product reviews → Product records: checks product
