# quick-institute/lumina-e-commerce architecture

> Architecture diagram of the GitHub repository quick-institute/lumina-e-commerce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quick-institute/lumina-e-commerce
- Repository: https://github.com/quick-institute/lumina-e-commerce

## Overview

Lumina is a multi-vendor marketplace for customers, sellers, and administrators. Customers browse products, manage a cart and delivery details, place COD orders, and track them; sellers manage listings, stock, and orders, while administrators oversee users, sellers, categories, and platform operations. The React client routes role-specific experiences through shared context and API services to an Express backend, which applies authentication and business logic over MongoDB. Email and image hosting are integrations. Some subsystem links reflect README capabilities because their implementation files were not sampled.

Main entry points: [`backend/src/routes/routes.js`](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/routes/routes.js) (REST route dispatch), [`frontend/src/routes/AppRoutes.jsx`](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/routes/AppRoutes.jsx) (Role-based routes), [`backend/src/models/User.js`](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/User.js) (User records), [`frontend/src/pages/customer`](https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/customer) (Shopping and orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_app["React app<br/>[App.jsx]"]
  node_routes["Role-based routes<br/>[AppRoutes.jsx]"]
  node_authstate["Authentication state<br/>[AuthContext.jsx]"]
  node_authclient["Auth service<br/>[authService.js]"]
  node_accountclient["Account service<br/>[accountService.js]"]
  node_apiclient["HTTP API client<br/>[api.js]"]
end

subgraph group_commerce["Customer commerce"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_productclient["Product service<br/>[productService.js]"]
  node_customerpages["Shopping and orders"]
end

subgraph group_operations["Seller and admin"]
  node_sellerpages["Seller workspace"]
  node_adminpages["Admin console"]
end

subgraph group_backend["Backend services"]
  node_backendroutes["REST route dispatch<br/>[routes.js]"]
  node_authcontroller["Authentication<br/>[auth.js]"]
  node_accountcontroller["Account management<br/>[account.js]"]
  node_catalogcontroller["Catalog and reviews<br/>[catelog.js]"]
  node_ordercontroller["Order processing<br/>[orders.js]"]
  node_admincontroller["Platform operations<br/>[admin.js]"]
  node_authmiddleware["Access control<br/>[auth.js]"]
  node_mailer["Email delivery<br/>[mailer.js]"]
end

subgraph group_data["Marketplace data"]
  node_user["User records<br/>[User.js]"]
  node_product["Product records<br/>[Product.js]"]
  node_order["Order records<br/>[Order.js]"]
  node_mongodb[("MongoDB")]
end

node_shopper(("Customer"))
node_seller(("Seller"))
node_administrator(("Administrator"))
node_smtp["SMTP service"]
node_cloudinary["Cloudinary"]

node_shopper -->|"uses"| node_routes
node_seller -->|"uses"| node_routes
node_administrator -->|"uses"| node_routes
node_app -->|"renders"| node_routes
node_app -->|"provides"| node_authstate
node_app -->|"provides"| node_cartstate
node_routes -->|"routes to"| node_customerpages
node_routes -->|"routes to"| node_sellerpages
node_routes -->|"routes to"| node_adminpages
node_authstate -->|"calls"| node_authclient
node_cartstate -->|"reads session"| node_authstate
node_customerpages -->|"requests products"| node_productclient
node_customerpages -->|"updates cart"| node_cartstate
node_customerpages -->|"requests account"| node_accountclient
node_sellerpages -->|"manages listings"| node_productclient
node_adminpages -->|"manages sellers"| node_accountclient
node_authclient -->|"uses"| node_apiclient
node_productclient -->|"uses"| node_apiclient
node_accountclient -->|"uses"| node_apiclient
node_apiclient -->|"HTTP requests"| node_backendroutes
node_backendroutes -->|"dispatches"| node_authcontroller
node_backendroutes -->|"dispatches"| node_accountcontroller
node_backendroutes -->|"dispatches"| node_catalogcontroller
node_backendroutes -->|"dispatches"| node_ordercontroller
node_backendroutes -->|"dispatches"| node_admincontroller
node_backendroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_user
node_accountcontroller -->|"reads and writes"| node_user
node_catalogcontroller -->|"reads and writes"| node_product
node_ordercontroller -->|"reads and writes"| node_order
node_ordercontroller -->|"checks stock"| node_product
node_admincontroller -->|"manages users"| node_user
node_admincontroller -->|"manages products"| node_product
node_authmiddleware -->|"validates user"| node_user
node_user -->|"persists"| node_mongodb
node_product -->|"persists"| node_mongodb
node_order -->|"persists"| node_mongodb
node_authcontroller -->|"sends messages"| node_mailer
node_mailer -->|"delivers email"| node_smtp
node_catalogcontroller -.->|"uploads images"| node_cloudinary

click node_app "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/App.jsx"
click node_routes "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_authstate "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/context/AuthContext.jsx"
click node_cartstate "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/context/CartContext.jsx"
click node_authclient "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/authService.js"
click node_productclient "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/productService.js"
click node_accountclient "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/accountService.js"
click node_apiclient "https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/api.js"
click node_customerpages "https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/customer"
click node_sellerpages "https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/seller"
click node_adminpages "https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/admin"
click node_backendroutes "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/routes/routes.js"
click node_authcontroller "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/auth.js"
click node_accountcontroller "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/account.js"
click node_catalogcontroller "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/catelog.js"
click node_ordercontroller "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/orders.js"
click node_admincontroller "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/admin.js"
click node_authmiddleware "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/middleware/auth.js"
click node_user "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/User.js"
click node_product "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/Product.js"
click node_order "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/Order.js"
click node_mailer "https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/utils/mailer.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_app,node_routes,node_authstate,node_authclient,node_accountclient,node_apiclient toneBlue
class node_cartstate,node_productclient,node_customerpages toneAmber
class node_sellerpages,node_adminpages toneMint
class node_backendroutes,node_authcontroller,node_accountcontroller,node_catalogcontroller,node_ordercontroller,node_admincontroller,node_authmiddleware,node_mailer toneRose
class node_user,node_product,node_order,node_mongodb,node_shopper,node_seller,node_administrator,node_smtp,node_cloudinary toneIndigo
```

## Components

### Marketplace client

- [React app](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Role-based routes](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Authentication state](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Auth service](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Account service](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/accountService.js): `frontend/src/services/accountService.js`
- [HTTP API client](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### Customer commerce

- [Cart state](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/context/CartContext.jsx): `frontend/src/context/CartContext.jsx`
- [Product service](https://github.com/quick-institute/lumina-e-commerce/blob/main/frontend/src/services/productService.js): `frontend/src/services/productService.js`
- [Shopping and orders](https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/customer): `frontend/src/pages/customer`

### Seller and admin

- [Seller workspace](https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/seller): `frontend/src/pages/seller`
- [Admin console](https://github.com/quick-institute/lumina-e-commerce/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`

### Backend services

- [REST route dispatch](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/routes/routes.js): `backend/src/routes/routes.js`
- [Authentication](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/auth.js): `backend/src/controllers/auth.js`
- [Account management](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/account.js): `backend/src/controllers/account.js`
- [Catalog and reviews](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/catelog.js): `backend/src/controllers/catelog.js`
- [Order processing](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/orders.js): `backend/src/controllers/orders.js`
- [Platform operations](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/controllers/admin.js): `backend/src/controllers/admin.js`
- [Access control](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Email delivery](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/utils/mailer.js): `backend/src/utils/mailer.js`

### Marketplace data

- [User records](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Product records](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/Product.js): `backend/src/models/Product.js`
- [Order records](https://github.com/quick-institute/lumina-e-commerce/blob/main/backend/src/models/Order.js): `backend/src/models/Order.js`
- **MongoDB**

### Other components

- **Customer**
- **Seller**
- **Administrator**
- **SMTP service**
- **Cloudinary**

## Connections

- Customer → Role-based routes: uses
- Seller → Role-based routes: uses
- Administrator → Role-based routes: uses
- React app → Role-based routes: renders (evidence: `frontend/src/App.jsx`)
- React app → Authentication state: provides (evidence: `frontend/src/App.jsx`)
- React app → Cart state: provides (evidence: `frontend/src/App.jsx`)
- Role-based routes → Shopping and orders: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Role-based routes → Seller workspace: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Role-based routes → Admin console: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Authentication state → Auth service: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Cart state → Authentication state: reads session (evidence: `frontend/src/context/CartContext.jsx`)
- Shopping and orders → Product service: requests products (evidence: `frontend/src/pages/customer/ProductDetails.jsx`)
- Shopping and orders → Cart state: updates cart (evidence: `frontend/src/pages/customer/ProductDetails.jsx`)
- Shopping and orders → Account service: requests account (evidence: `frontend/src/pages/customer/account/Addresses.jsx`)
- Seller workspace → Product service: manages listings (evidence: `frontend/src/pages/seller/ProductForm.jsx`)
- Admin console → Account service: manages sellers (evidence: `frontend/src/pages/admin/SellerReviewModal.jsx`)
- Auth service → HTTP API client: uses (evidence: `frontend/src/services/authService.js`)
- Product service → HTTP API client: uses (evidence: `frontend/src/services/productService.js`)
- Account service → HTTP API client: uses (evidence: `frontend/src/services/accountService.js`)
- HTTP API client → REST route dispatch: HTTP requests
- REST route dispatch → Authentication: dispatches (evidence: `backend/src/routes/routes.js`)
- REST route dispatch → Account management: dispatches (evidence: `backend/src/routes/routes.js`)
- REST route dispatch → Catalog and reviews: dispatches (evidence: `backend/src/routes/routes.js`)
- REST route dispatch → Order processing: dispatches (evidence: `backend/src/routes/routes.js`)
- REST route dispatch → Platform operations: dispatches (evidence: `backend/src/routes/routes.js`)
- REST route dispatch → Access control: protects routes (evidence: `backend/src/routes/routes.js`)
- Authentication → User records: reads and writes (evidence: `backend/src/controllers/auth.js`)
- Account management → User records: reads and writes (evidence: `backend/src/controllers/account.js`)
- Catalog and reviews → Product records: reads and writes (evidence: `backend/src/controllers/catelog.js`)
- Order processing → Order records: reads and writes (evidence: `backend/src/controllers/orders.js`)
- Order processing → Product records: checks stock (evidence: `backend/src/controllers/orders.js`)
- Platform operations → User records: manages users (evidence: `backend/src/controllers/admin.js`)
- Platform operations → Product records: manages products (evidence: `backend/src/controllers/admin.js`)
- Access control → User records: validates user (evidence: `backend/src/middleware/auth.js`)
- User records → MongoDB: persists
- Product records → MongoDB: persists
- Order records → MongoDB: persists
- Authentication → Email delivery: sends messages (evidence: `backend/src/controllers/auth.js`)
- Email delivery → SMTP service: delivers email (evidence: `backend/src/utils/mailer.js`)
- Catalog and reviews → Cloudinary: uploads images
