# nirupanjoe/tech-store architecture

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

- Interactive diagram: https://gitdiagram.com/nirupanjoe/tech-store
- Repository: https://github.com/nirupanjoe/tech-store

## Overview

TechStore is a MERN e-commerce platform. The principal customer workflow is browsing and filtering products, managing a cart, checking out through payment, then viewing orders; users can also register or sign in, including with Google. The backend provides product, account, order, and payment APIs backed by MongoDB. Authentication and product-controller relationships are visible in excerpts; order and payment internals and most frontend wiring were not sampled, so those links are left unverified or omitted.

Main entry points: [`frontend/src`](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src) (Web Application), [`backend/app.js`](https://github.com/nirupanjoe/tech-store/blob/main/backend/app.js) (API Application), [`backend/controllers/product.js`](https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/product.js) (Product Workflows), [`backend/routes/auth.js`](https://github.com/nirupanjoe/tech-store/blob/main/backend/routes/auth.js) (Account Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_webapp["Web Application"]
  node_product_browse["Product Browse"]
  node_product_search["Search &amp; Filter"]
  node_cart["Shopping Cart"]
end

subgraph group_identity["Identity"]
  node_account_ui["Account Access"]
  node_auth_routes["Account Routes<br/>[auth.js]"]
  node_auth_controller["Account Workflows<br/>[auth.js]"]
  node_auth_helpers["Auth Helpers<br/>[auth.js]"]
  node_auth_middleware["Access Control<br/>[authentication.js]"]
end

subgraph group_commerce["Commerce"]
  node_checkout["Checkout"]
  node_order_history["Order History"]
  node_order_controller["Order Workflows<br/>[order.js]"]
  node_order_helper["Order Helpers<br/>[orders.js]"]
  node_payment_controller["Payment Processing<br/>[payment.js]"]
end

subgraph group_backend["Backend Services"]
  node_api["API Application<br/>[app.js]"]
  node_product_routes["Product Routes<br/>[product.js]"]
  node_product_controller["Product Workflows<br/>[product.js]"]
  node_product_query["Product Querying"]
  node_product_helper["Product Helpers<br/>[product.js]"]
end

subgraph group_data["Persistence"]
  node_user_model[("User Records<br/>[user.js]")]
  node_product_model[("Product Records<br/>[product.js]")]
  node_order_model[("Order Records<br/>[order.js]")]
  node_database_config["Database Connection<br/>[database.js]"]
end

node_shopper(("Shopper"))
node_stripe["Stripe"]
node_mongodb[("MongoDB")]

node_shopper -.->|"uses"| node_webapp
node_webapp -.->|"offers"| node_product_browse
node_webapp -.->|"offers"| node_product_search
node_webapp -.->|"offers"| node_cart
node_webapp -.->|"offers"| node_checkout
node_webapp -.->|"offers"| node_order_history
node_webapp -.->|"offers"| node_account_ui
node_product_browse -.->|"requests products"| node_api
node_product_search -.->|"searches products"| node_api
node_cart -.->|"continues to"| node_checkout
node_checkout -.->|"submits order"| node_api
node_checkout -.->|"requests payment"| node_payment_controller
node_payment_controller -.->|"integrates with"| node_stripe
node_order_history -.->|"requests orders"| node_api
node_account_ui -.->|"calls account API"| node_auth_routes
node_api -->|"mounts users"| node_auth_routes
node_api -->|"mounts products"| node_product_routes
node_auth_routes -->|"routes requests"| node_auth_controller
node_auth_routes -->|"protects routes"| node_auth_middleware
node_auth_controller -->|"uses"| node_auth_helpers
node_auth_controller -->|"reads and writes"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_product_routes -->|"routes requests"| node_product_controller
node_product_controller -->|"builds queries"| node_product_query
node_product_controller -->|"uses"| node_product_helper
node_product_controller -->|"reads and writes"| node_product_model
node_product_query -->|"queries"| node_product_model
node_order_helper -->|"uses"| node_order_model
node_order_helper -->|"uses"| node_product_model
node_order_controller -.->|"uses"| node_order_helper
node_order_controller -.->|"uses"| node_order_model
node_database_config -->|"connects"| node_mongodb

click node_webapp "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src"
click node_product_browse "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Products"
click node_product_search "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Header/SearchModel"
click node_cart "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Cart"
click node_checkout "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Checkout"
click node_order_history "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Orders"
click node_account_ui "https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/User"
click node_api "https://github.com/nirupanjoe/tech-store/blob/main/backend/app.js"
click node_auth_routes "https://github.com/nirupanjoe/tech-store/blob/main/backend/routes/auth.js"
click node_auth_controller "https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/auth.js"
click node_auth_helpers "https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/auth.js"
click node_auth_middleware "https://github.com/nirupanjoe/tech-store/blob/main/backend/middleware/authentication.js"
click node_user_model "https://github.com/nirupanjoe/tech-store/blob/main/backend/models/user.js"
click node_product_routes "https://github.com/nirupanjoe/tech-store/blob/main/backend/routes/product.js"
click node_product_controller "https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/product.js"
click node_product_query "https://github.com/nirupanjoe/tech-store/blob/main/backend/utils/productQueryHandler.js"
click node_product_helper "https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/product.js"
click node_product_model "https://github.com/nirupanjoe/tech-store/blob/main/backend/models/product.js"
click node_order_controller "https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/order.js"
click node_order_helper "https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/orders.js"
click node_order_model "https://github.com/nirupanjoe/tech-store/blob/main/backend/models/order.js"
click node_payment_controller "https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/payment.js"
click node_database_config "https://github.com/nirupanjoe/tech-store/blob/main/backend/config/database.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_webapp,node_product_browse,node_product_search,node_cart toneBlue
class node_account_ui,node_auth_routes,node_auth_controller,node_auth_helpers,node_auth_middleware,node_mongodb toneAmber
class node_checkout,node_order_history,node_order_controller,node_order_helper,node_payment_controller toneMint
class node_api,node_product_routes,node_product_controller,node_product_query,node_product_helper toneRose
class node_user_model,node_product_model,node_order_model,node_database_config,node_shopper,node_stripe toneIndigo
```

## Components

### Storefront

- [Web Application](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src): `frontend/src`
- [Product Browse](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Products): `frontend/src/components/Products`
- [Search & Filter](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Header/SearchModel): `frontend/src/components/Header/SearchModel`
- [Shopping Cart](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Cart): `frontend/src/components/Pages/Cart`

### Identity

- [Account Access](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/User): `frontend/src/components/Pages/User`
- [Account Routes](https://github.com/nirupanjoe/tech-store/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Account Workflows](https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/auth.js): `backend/controllers/auth.js`
- [Auth Helpers](https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/auth.js): `backend/helper/auth.js`
- [Access Control](https://github.com/nirupanjoe/tech-store/blob/main/backend/middleware/authentication.js): `backend/middleware/authentication.js`

### Commerce

- [Checkout](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Checkout): `frontend/src/components/Pages/Checkout`
- [Order History](https://github.com/nirupanjoe/tech-store/tree/main/frontend/src/components/Pages/Orders): `frontend/src/components/Pages/Orders`
- [Order Workflows](https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/order.js): `backend/controllers/order.js`
- [Order Helpers](https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/orders.js): `backend/helper/orders.js`
- [Payment Processing](https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/payment.js): `backend/controllers/payment.js`

### Backend Services

- [API Application](https://github.com/nirupanjoe/tech-store/blob/main/backend/app.js): `backend/app.js`
- [Product Routes](https://github.com/nirupanjoe/tech-store/blob/main/backend/routes/product.js): `backend/routes/product.js`
- [Product Workflows](https://github.com/nirupanjoe/tech-store/blob/main/backend/controllers/product.js): `backend/controllers/product.js`
- [Product Querying](https://github.com/nirupanjoe/tech-store/blob/main/backend/utils/productQueryHandler.js): `backend/utils/productQueryHandler.js`
- [Product Helpers](https://github.com/nirupanjoe/tech-store/blob/main/backend/helper/product.js): `backend/helper/product.js`

### Persistence

- [User Records](https://github.com/nirupanjoe/tech-store/blob/main/backend/models/user.js): `backend/models/user.js`
- [Product Records](https://github.com/nirupanjoe/tech-store/blob/main/backend/models/product.js): `backend/models/product.js`
- [Order Records](https://github.com/nirupanjoe/tech-store/blob/main/backend/models/order.js): `backend/models/order.js`
- [Database Connection](https://github.com/nirupanjoe/tech-store/blob/main/backend/config/database.js): `backend/config/database.js`

### Other components

- **Shopper**
- **Stripe**
- **MongoDB**

## Connections

- Shopper → Web Application: uses
- Web Application → Product Browse: offers
- Web Application → Search & Filter: offers (evidence: `frontend/src/components/Header/SearchModel/useSearchModelLogic.js`)
- Web Application → Shopping Cart: offers
- Web Application → Checkout: offers (evidence: `frontend/src/components/Pages/Checkout/Payment/submitHandler.js`)
- Web Application → Order History: offers
- Web Application → Account Access: offers (evidence: `frontend/src/components/Pages/User/useAuth.js`)
- Product Browse → API Application: requests products
- Search & Filter → API Application: searches products
- Shopping Cart → Checkout: continues to
- Checkout → API Application: submits order
- Checkout → Payment Processing: requests payment
- Payment Processing → Stripe: integrates with
- Order History → API Application: requests orders
- Account Access → Account Routes: calls account API
- API Application → Account Routes: mounts users (evidence: `backend/app.js`)
- API Application → Product Routes: mounts products (evidence: `backend/app.js`)
- Account Routes → Account Workflows: routes requests (evidence: `backend/routes/auth.js`)
- Account Routes → Access Control: protects routes (evidence: `backend/routes/auth.js`)
- Account Workflows → Auth Helpers: uses (evidence: `backend/controllers/auth.js`)
- Account Workflows → User Records: reads and writes (evidence: `backend/controllers/auth.js`)
- Access Control → User Records: loads user (evidence: `backend/middleware/authentication.js`)
- Product Routes → Product Workflows: routes requests (evidence: `backend/routes/product.js`)
- Product Workflows → Product Querying: builds queries (evidence: `backend/controllers/product.js`)
- Product Workflows → Product Helpers: uses (evidence: `backend/controllers/product.js`)
- Product Workflows → Product Records: reads and writes (evidence: `backend/controllers/product.js`)
- Product Querying → Product Records: queries (evidence: `backend/utils/productQueryHandler.js`)
- Order Helpers → Order Records: uses (evidence: `backend/helper/orders.js`)
- Order Helpers → Product Records: uses (evidence: `backend/helper/orders.js`)
- Order Workflows → Order Helpers: uses
- Order Workflows → Order Records: uses
- Database Connection → MongoDB: connects (evidence: `backend/config/database.js`)
