# sonalpal/softprotechmart architecture

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

- Interactive diagram: https://gitdiagram.com/sonalpal/softprotechmart
- Repository: https://github.com/sonalpal/softprotechmart

## Overview

SoftproTechMart is an electronics storefront with customer shopping/account flows and an administrative catalog and order console. Customers browse products, manage a cart and addresses, and place and track orders; admins manage catalog, inventory, users, complaints, and order status. The backend exposes these domains through Express routes backed by MongoDB models. The README is a template, so capabilities and relationships below are based on the tree and shown source/index references; unsampled routes and pages are grouped conservatively.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/App.jsx) (Route Application), [`backend/index.js`](https://github.com/sonalpal/softprotechmart/blob/main/backend/index.js) (HTTP API Server), [`backend/routes/orderRoute.js`](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/orderRoute.js) (Order Processing), [`backend/routes/paymentRoute.js`](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/paymentRoute.js) (Payment Processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront"]
  node_app["Route Application<br/>[App.jsx]"]
  node_home["Store Home<br/>[Home.jsx]"]
  node_catalog_ui["Product Browsing<br/>[Products.jsx]"]
  node_product_detail["Product Details<br/>[ProductDetails.jsx]"]
  node_navigation["Site Navigation<br/>[Navbar.jsx]"]
  node_footer["Site Footer<br/>[Footer.jsx]"]
end

subgraph group_identity["Accounts"]
  node_customer_auth["Registration and Login"]
  node_customer_account["Customer Account"]
  node_user_api["User API<br/>[userRoute.js]"]
  node_user_model[("User Records<br/>[User.js]")]
  node_verification_model[("Email Verification")]
end

subgraph group_commerce["Commerce"]
  node_cart_ui["Cart and Checkout<br/>[Cart.jsx]"]
  node_address_ui["Address Management<br/>[Address.jsx]"]
  node_orders_ui["Order History<br/>[MyOrders.jsx]"]
  node_order_api["Order Processing<br/>[orderRoute.js]"]
  node_payment_api["Payment Processing<br/>[paymentRoute.js]"]
  node_cart_model[("Cart Records<br/>[Cart.js]")]
  node_order_model[("Order Records<br/>[Order.js]")]
  node_order_item_model[("Order Items<br/>[OrderItem.js]")]
  node_stock_helper["Stock Adjustment<br/>[stockHelper.js]"]
  node_product_model[("Product Records<br/>[Product.js]")]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin Console"]
  node_admin_api["Admin API<br/>[adminRoute.js]"]
  node_catalog_admin_api["Catalog APIs<br/>[productRoute.js]"]
  node_category_api["Category API<br/>[categoryRoute.js]"]
  node_complaint_api["Complaint API<br/>[complaintRoute.js]"]
end

subgraph group_platform["Backend Platform"]
  node_api_server["HTTP API Server<br/>[index.js]"]
  node_database_config["MongoDB Connection<br/>[db.js]"]
  node_address_api["Address API<br/>[addressRoute.js]"]
  node_cart_api["Cart API<br/>[cartRoute.js]"]
end

node_shopper(("Shopper"))
node_admin_actor(("Administrator"))

node_shopper -->|"uses storefront"| node_app
node_admin_actor -->|"opens console"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalog_ui
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_customer_auth
node_app -->|"routes to"| node_customer_account
node_app -->|"routes to"| node_cart_ui
node_app -->|"routes to"| node_address_ui
node_app -->|"routes to"| node_orders_ui
node_app -->|"routes to"| node_admin_ui
node_shopper -.->|"views item"| node_product_detail
node_product_detail -->|"fetches product"| node_catalog_admin_api
node_admin_ui -.->|"uses API"| node_admin_api
node_admin_ui -.->|"manages catalog"| node_catalog_admin_api
node_admin_ui -.->|"manages categories"| node_category_api
node_admin_ui -.->|"handles complaints"| node_complaint_api
node_api_server -->|"connects MongoDB"| node_database_config
node_api_server -->|"mounts routes"| node_admin_api
node_api_server -->|"mounts routes"| node_category_api
node_api_server -->|"mounts routes"| node_catalog_admin_api
node_api_server -->|"mounts routes"| node_user_api
node_api_server -->|"mounts routes"| node_cart_api
node_api_server -->|"mounts routes"| node_order_api
node_api_server -->|"mounts routes"| node_address_api
node_api_server -->|"mounts routes"| node_complaint_api
node_api_server -->|"mounts routes"| node_payment_api
node_user_api -->|"reads and writes"| node_user_model
node_user_api -->|"verifies email"| node_verification_model
node_order_api -->|"reads and clears"| node_cart_model
node_order_api -->|"reads product"| node_product_model
node_order_api -->|"creates and queries"| node_order_model
node_order_api -->|"creates items"| node_order_item_model
node_order_api -->|"decrements stock"| node_stock_helper
node_stock_helper -->|"updates stock"| node_product_model
node_payment_api -->|"uses cart"| node_cart_model
node_payment_api -->|"uses orders"| node_order_model
node_payment_api -->|"uses order items"| node_order_item_model
node_payment_api -->|"adjusts stock"| node_stock_helper

click node_app "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/Home.jsx"
click node_catalog_ui "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/Products.jsx"
click node_product_detail "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/ProductDetails.jsx"
click node_navigation "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/components/Navbar.jsx"
click node_footer "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/components/Footer.jsx"
click node_customer_auth "https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/user"
click node_customer_account "https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/user"
click node_user_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/userRoute.js"
click node_user_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/User.js"
click node_verification_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/EmailVerification.js"
click node_cart_ui "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/Cart.jsx"
click node_address_ui "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/Address.jsx"
click node_orders_ui "https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/MyOrders.jsx"
click node_order_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/orderRoute.js"
click node_payment_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/paymentRoute.js"
click node_cart_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Cart.js"
click node_order_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Order.js"
click node_order_item_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/OrderItem.js"
click node_stock_helper "https://github.com/sonalpal/softprotechmart/blob/main/backend/utils/stockHelper.js"
click node_product_model "https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Product.js"
click node_admin_ui "https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/admin"
click node_admin_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/adminRoute.js"
click node_catalog_admin_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/productRoute.js"
click node_category_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/categoryRoute.js"
click node_complaint_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/complaintRoute.js"
click node_api_server "https://github.com/sonalpal/softprotechmart/blob/main/backend/index.js"
click node_database_config "https://github.com/sonalpal/softprotechmart/blob/main/backend/config/db.js"
click node_address_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/addressRoute.js"
click node_cart_api "https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/cartRoute.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_home,node_catalog_ui,node_product_detail,node_navigation,node_footer toneBlue
class node_customer_auth,node_customer_account,node_user_api,node_user_model,node_verification_model toneAmber
class node_cart_ui,node_address_ui,node_orders_ui,node_order_api,node_payment_api,node_cart_model,node_order_model,node_order_item_model,node_stock_helper,node_product_model toneMint
class node_admin_ui,node_admin_api,node_catalog_admin_api,node_category_api,node_complaint_api toneRose
class node_api_server,node_database_config,node_address_api,node_cart_api,node_shopper,node_admin_actor toneIndigo
```

## Components

### Storefront

- [Route Application](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Store Home](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Product Browsing](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/Products.jsx): `frontend/src/pages/Products.jsx`
- [Product Details](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/ProductDetails.jsx): `frontend/src/pages/ProductDetails.jsx`
- [Site Navigation](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/components/Navbar.jsx): `frontend/src/components/Navbar.jsx`
- [Site Footer](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/components/Footer.jsx): `frontend/src/components/Footer.jsx`

### Accounts

- [Registration and Login](https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/user): `frontend/src/pages/user`
- [Customer Account](https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/user): `frontend/src/pages/user`
- [User API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/userRoute.js): `backend/routes/userRoute.js`
- [User Records](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/User.js): `backend/models/User.js`
- [Email Verification](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/EmailVerification.js): `backend/models/EmailVerification.js`

### Commerce

- [Cart and Checkout](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/Cart.jsx): `frontend/src/pages/user/Cart.jsx`
- [Address Management](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/Address.jsx): `frontend/src/pages/user/Address.jsx`
- [Order History](https://github.com/sonalpal/softprotechmart/blob/main/frontend/src/pages/user/MyOrders.jsx): `frontend/src/pages/user/MyOrders.jsx`
- [Order Processing](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/orderRoute.js): `backend/routes/orderRoute.js`
- [Payment Processing](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/paymentRoute.js): `backend/routes/paymentRoute.js`
- [Cart Records](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Cart.js): `backend/models/Cart.js`
- [Order Records](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Order.js): `backend/models/Order.js`
- [Order Items](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/OrderItem.js): `backend/models/OrderItem.js`
- [Stock Adjustment](https://github.com/sonalpal/softprotechmart/blob/main/backend/utils/stockHelper.js): `backend/utils/stockHelper.js`
- [Product Records](https://github.com/sonalpal/softprotechmart/blob/main/backend/models/Product.js): `backend/models/Product.js`

### Administration

- [Admin Console](https://github.com/sonalpal/softprotechmart/tree/main/frontend/src/pages/admin): `frontend/src/pages/admin`
- [Admin API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/adminRoute.js): `backend/routes/adminRoute.js`
- [Catalog APIs](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/productRoute.js): `backend/routes/productRoute.js`
- [Category API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/categoryRoute.js): `backend/routes/categoryRoute.js`
- [Complaint API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/complaintRoute.js): `backend/routes/complaintRoute.js`

### Backend Platform

- [HTTP API Server](https://github.com/sonalpal/softprotechmart/blob/main/backend/index.js): `backend/index.js`
- [MongoDB Connection](https://github.com/sonalpal/softprotechmart/blob/main/backend/config/db.js): `backend/config/db.js`
- [Address API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/addressRoute.js): `backend/routes/addressRoute.js`
- [Cart API](https://github.com/sonalpal/softprotechmart/blob/main/backend/routes/cartRoute.js): `backend/routes/cartRoute.js`

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Route Application: uses storefront (evidence: `frontend/src/App.jsx`)
- Administrator → Route Application: opens console (evidence: `frontend/src/App.jsx`)
- Route Application → Store Home: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Product Browsing: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Product Details: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Registration and Login: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Customer Account: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Cart and Checkout: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Address Management: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Order History: routes to (evidence: `frontend/src/App.jsx`)
- Route Application → Admin Console: routes to (evidence: `frontend/src/App.jsx`)
- Shopper → Product Details: views item
- Product Details → Catalog APIs: fetches product (evidence: `frontend/src/pages/ProductDetails.jsx`)
- Admin Console → Admin API: uses API
- Admin Console → Catalog APIs: manages catalog
- Admin Console → Category API: manages categories
- Admin Console → Complaint API: handles complaints
- HTTP API Server → MongoDB Connection: connects MongoDB (evidence: `backend/index.js`)
- HTTP API Server → Admin API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Category API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Catalog APIs: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → User API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Cart API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Order Processing: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Address API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Complaint API: mounts routes (evidence: `backend/index.js`)
- HTTP API Server → Payment Processing: mounts routes (evidence: `backend/index.js`)
- User API → User Records: reads and writes (evidence: `backend/routes/userRoute.js`)
- User API → Email Verification: verifies email (evidence: `backend/routes/userRoute.js`)
- Order Processing → Cart Records: reads and clears (evidence: `backend/routes/orderRoute.js`)
- Order Processing → Product Records: reads product (evidence: `backend/routes/orderRoute.js`)
- Order Processing → Order Records: creates and queries (evidence: `backend/routes/orderRoute.js`)
- Order Processing → Order Items: creates items (evidence: `backend/routes/orderRoute.js`)
- Order Processing → Stock Adjustment: decrements stock (evidence: `backend/routes/orderRoute.js`)
- Stock Adjustment → Product Records: updates stock (evidence: `backend/utils/stockHelper.js`)
- Payment Processing → Cart Records: uses cart (evidence: `backend/routes/paymentRoute.js`)
- Payment Processing → Order Records: uses orders (evidence: `backend/routes/paymentRoute.js`)
- Payment Processing → Order Items: uses order items (evidence: `backend/routes/paymentRoute.js`)
- Payment Processing → Stock Adjustment: adjusts stock (evidence: `backend/routes/paymentRoute.js`)
