# harkit07/boutique architecture

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

- Interactive diagram: https://gitdiagram.com/harkit07/boutique
- Repository: https://github.com/harkit07/boutique

## Overview

Ravneet Boutique is a full-stack storefront for browsing suits, managing accounts and carts, and submitting reviews; administrators can manage products. The principal workflow runs from a customer through the routed React UI to the REST API, where route middleware and controllers enforce access and perform domain operations against MongoDB or Cloudinary. Authentication, account recovery, product management, cart, reviews, and skeleton loading states are distinct capabilities. Backend/frontend integration details and several route implementations were not excerpted, so uncertain UI-to-API links are marked unverified.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/harkit07/boutique/blob/main/Frontend/src/App.jsx) (React Routes), [`Backend/server.js`](https://github.com/harkit07/boutique/blob/main/Backend/server.js) (Express API), [`Backend/controllers/auth.js`](https://github.com/harkit07/boutique/blob/main/Backend/controllers/auth.js) (Auth & Recovery), [`Backend/middleware.js`](https://github.com/harkit07/boutique/blob/main/Backend/middleware.js) (JWT Access Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Storefront UI"]
  node_app["React Routes<br/>[App.jsx]"]
  node_storefront["Storefront Pages"]
  node_productview["Suit Detail UI<br/>[SuitView.jsx]"]
  node_cartui["Cart UI<br/>[Cart.jsx]"]
  node_adminui["Suit Admin UI<br/>[AddNewSuit.jsx]"]
  node_suitmedia["Suit Media Viewer<br/>[SuitImgCom.jsx]"]
  node_state["Shared UI State"]
  node_skeleton["Skeleton Registry<br/>[registry.js]"]
end

subgraph group_identity["Identity &amp; Accounts"]
  node_authroutes["Auth Routes<br/>[auth.js]"]
  node_authlogic["Auth &amp; Recovery<br/>[auth.js]"]
  node_access["JWT Access Control<br/>[middleware.js]"]
  node_users[("User Records<br/>[user.js]")]
  node_blacklist[("Revoked Tokens<br/>[blacklistToken.js]")]
end

subgraph group_commerce["Commerce &amp; Reviews"]
  node_suitroutes["Suit Routes<br/>[suit.js]"]
  node_suitlogic["Suit Management<br/>[suit.js]"]
  node_suits[("Suit Records<br/>[suit.js]")]
  node_cartapi["Cart API<br/>[cart.js]"]
  node_cartlogic["Cart Operations<br/>[cart.js]"]
  node_reviewroutes["Review Routes<br/>[review.js]"]
  node_reviewlogic["Review Operations<br/>[review.js]"]
  node_reviews[("Review Records<br/>[review.js]")]
end

subgraph group_platform["API &amp; Infrastructure"]
  node_api["Express API<br/>[server.js]"]
  node_cloud["Cloud Media Storage<br/>[cloudConfig.js]"]
  node_email["OTP Email Service<br/>[auth.js]"]
end

node_customer(("Customer / Admin"))

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_storefront
node_app -->|"routes to"| node_productview
node_app -->|"protects route"| node_cartui
node_app -->|"protects route"| node_adminui
node_productview -->|"renders"| node_suitmedia
node_storefront -->|"uses context"| node_state
node_app -->|"shows fallback"| node_skeleton
node_customer -.->|"requests"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_suitroutes
node_api -->|"mounts"| node_cartapi
node_api -->|"mounts"| node_reviewroutes
node_authroutes -->|"dispatches"| node_authlogic
node_authlogic -->|"reads / writes"| node_users
node_authlogic -->|"records logout"| node_blacklist
node_authroutes -->|"uses middleware"| node_access
node_access -->|"loads user"| node_users
node_access -->|"checks token"| node_blacklist
node_suitroutes -->|"dispatches"| node_suitlogic
node_suitlogic -->|"manages suits"| node_suits
node_suitlogic -->|"uploads media"| node_cloud
node_cartapi -->|"dispatches"| node_cartlogic
node_cartlogic -.->|"updates cart"| node_users
node_reviewroutes -->|"dispatches"| node_reviewlogic
node_reviewroutes -->|"authenticates"| node_access
node_reviewlogic -->|"updates reviews"| node_suits
node_reviewlogic -->|"creates / deletes"| node_reviews
node_authlogic -.->|"sends OTP"| node_email

click node_app "https://github.com/harkit07/boutique/blob/main/Frontend/src/App.jsx"
click node_storefront "https://github.com/harkit07/boutique/tree/main/Frontend/src/Pages"
click node_productview "https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/SuitView.jsx"
click node_cartui "https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/Cart.jsx"
click node_adminui "https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/AddNewSuit.jsx"
click node_suitmedia "https://github.com/harkit07/boutique/blob/main/Frontend/src/components/SuitImgCom.jsx"
click node_state "https://github.com/harkit07/boutique/tree/main/Frontend/src/context"
click node_skeleton "https://github.com/harkit07/boutique/blob/main/Frontend/src/bones/registry.js"
click node_authroutes "https://github.com/harkit07/boutique/blob/main/Backend/routes/auth.js"
click node_authlogic "https://github.com/harkit07/boutique/blob/main/Backend/controllers/auth.js"
click node_access "https://github.com/harkit07/boutique/blob/main/Backend/middleware.js"
click node_users "https://github.com/harkit07/boutique/blob/main/Backend/models/user.js"
click node_blacklist "https://github.com/harkit07/boutique/blob/main/Backend/models/blacklistToken.js"
click node_suitroutes "https://github.com/harkit07/boutique/blob/main/Backend/routes/suit.js"
click node_suitlogic "https://github.com/harkit07/boutique/blob/main/Backend/controllers/suit.js"
click node_suits "https://github.com/harkit07/boutique/blob/main/Backend/models/suit.js"
click node_cartapi "https://github.com/harkit07/boutique/blob/main/Backend/routes/cart.js"
click node_cartlogic "https://github.com/harkit07/boutique/blob/main/Backend/controllers/cart.js"
click node_reviewroutes "https://github.com/harkit07/boutique/blob/main/Backend/routes/review.js"
click node_reviewlogic "https://github.com/harkit07/boutique/blob/main/Backend/controllers/review.js"
click node_reviews "https://github.com/harkit07/boutique/blob/main/Backend/models/review.js"
click node_api "https://github.com/harkit07/boutique/blob/main/Backend/server.js"
click node_cloud "https://github.com/harkit07/boutique/blob/main/Backend/services/cloudConfig.js"
click node_email "https://github.com/harkit07/boutique/blob/main/Backend/controllers/auth.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_storefront,node_productview,node_cartui,node_adminui,node_suitmedia,node_state,node_skeleton toneBlue
class node_authroutes,node_authlogic,node_access,node_users,node_blacklist toneAmber
class node_suitroutes,node_suitlogic,node_suits,node_cartapi,node_cartlogic,node_reviewroutes,node_reviewlogic,node_reviews toneMint
class node_api,node_cloud,node_email toneRose
class node_customer toneIndigo
```

## Components

### Storefront UI

- [React Routes](https://github.com/harkit07/boutique/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Storefront Pages](https://github.com/harkit07/boutique/tree/main/Frontend/src/Pages): `Frontend/src/Pages`
- [Suit Detail UI](https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/SuitView.jsx): `Frontend/src/Pages/SuitView.jsx`
- [Cart UI](https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/Cart.jsx): `Frontend/src/Pages/Cart.jsx`
- [Suit Admin UI](https://github.com/harkit07/boutique/blob/main/Frontend/src/Pages/AddNewSuit.jsx): `Frontend/src/Pages/AddNewSuit.jsx`
- [Suit Media Viewer](https://github.com/harkit07/boutique/blob/main/Frontend/src/components/SuitImgCom.jsx): `Frontend/src/components/SuitImgCom.jsx`
- [Shared UI State](https://github.com/harkit07/boutique/tree/main/Frontend/src/context): `Frontend/src/context`
- [Skeleton Registry](https://github.com/harkit07/boutique/blob/main/Frontend/src/bones/registry.js): `Frontend/src/bones/registry.js`

### Identity & Accounts

- [Auth Routes](https://github.com/harkit07/boutique/blob/main/Backend/routes/auth.js): `Backend/routes/auth.js`
- [Auth & Recovery](https://github.com/harkit07/boutique/blob/main/Backend/controllers/auth.js): `Backend/controllers/auth.js`
- [JWT Access Control](https://github.com/harkit07/boutique/blob/main/Backend/middleware.js): `Backend/middleware.js`
- [User Records](https://github.com/harkit07/boutique/blob/main/Backend/models/user.js): `Backend/models/user.js`
- [Revoked Tokens](https://github.com/harkit07/boutique/blob/main/Backend/models/blacklistToken.js): `Backend/models/blacklistToken.js`

### Commerce & Reviews

- [Suit Routes](https://github.com/harkit07/boutique/blob/main/Backend/routes/suit.js): `Backend/routes/suit.js`
- [Suit Management](https://github.com/harkit07/boutique/blob/main/Backend/controllers/suit.js): `Backend/controllers/suit.js`
- [Suit Records](https://github.com/harkit07/boutique/blob/main/Backend/models/suit.js): `Backend/models/suit.js`
- [Cart API](https://github.com/harkit07/boutique/blob/main/Backend/routes/cart.js): `Backend/routes/cart.js`
- [Cart Operations](https://github.com/harkit07/boutique/blob/main/Backend/controllers/cart.js): `Backend/controllers/cart.js`
- [Review Routes](https://github.com/harkit07/boutique/blob/main/Backend/routes/review.js): `Backend/routes/review.js`
- [Review Operations](https://github.com/harkit07/boutique/blob/main/Backend/controllers/review.js): `Backend/controllers/review.js`
- [Review Records](https://github.com/harkit07/boutique/blob/main/Backend/models/review.js): `Backend/models/review.js`

### API & Infrastructure

- [Express API](https://github.com/harkit07/boutique/blob/main/Backend/server.js): `Backend/server.js`
- [Cloud Media Storage](https://github.com/harkit07/boutique/blob/main/Backend/services/cloudConfig.js): `Backend/services/cloudConfig.js`
- [OTP Email Service](https://github.com/harkit07/boutique/blob/main/Backend/controllers/auth.js): `Backend/controllers/auth.js`

### Other components

- **Customer / Admin**

## Connections

- Customer / Admin → React Routes: uses (evidence: `Frontend/src/App.jsx`)
- React Routes → Storefront Pages: routes to (evidence: `Frontend/src/App.jsx`)
- React Routes → Suit Detail UI: routes to (evidence: `Frontend/src/App.jsx`)
- React Routes → Cart UI: protects route (evidence: `Frontend/src/App.jsx`)
- React Routes → Suit Admin UI: protects route (evidence: `Frontend/src/App.jsx`)
- Suit Detail UI → Suit Media Viewer: renders (evidence: `Frontend/src/Pages/SuitView.jsx`)
- Storefront Pages → Shared UI State: uses context (evidence: `Frontend/src/Pages/Home.jsx`)
- React Routes → Skeleton Registry: shows fallback (evidence: `Frontend/src/App.jsx`)
- Customer / Admin → Express API: requests
- Express API → Auth Routes: mounts (evidence: `Backend/server.js`)
- Express API → Suit Routes: mounts (evidence: `Backend/server.js`)
- Express API → Cart API: mounts (evidence: `Backend/server.js`)
- Express API → Review Routes: mounts (evidence: `Backend/server.js`)
- Auth Routes → Auth & Recovery: dispatches (evidence: `Backend/routes/auth.js`)
- Auth & Recovery → User Records: reads / writes (evidence: `Backend/controllers/auth.js`)
- Auth & Recovery → Revoked Tokens: records logout (evidence: `Backend/controllers/auth.js`)
- Auth Routes → JWT Access Control: uses middleware (evidence: `Backend/routes/auth.js`)
- JWT Access Control → User Records: loads user (evidence: `Backend/middleware.js`)
- JWT Access Control → Revoked Tokens: checks token (evidence: `Backend/middleware.js`)
- Suit Routes → Suit Management: dispatches (evidence: `Backend/routes/suit.js`)
- Suit Management → Suit Records: manages suits (evidence: `Backend/controllers/suit.js`)
- Suit Management → Cloud Media Storage: uploads media (evidence: `Backend/controllers/suit.js`)
- Cart API → Cart Operations: dispatches (evidence: `Backend/routes/cart.js`)
- Cart Operations → User Records: updates cart
- Review Routes → Review Operations: dispatches (evidence: `Backend/routes/review.js`)
- Review Routes → JWT Access Control: authenticates (evidence: `Backend/routes/review.js`)
- Review Operations → Suit Records: updates reviews (evidence: `Backend/controllers/review.js`)
- Review Operations → Review Records: creates / deletes (evidence: `Backend/controllers/review.js`)
- Auth & Recovery → OTP Email Service: sends OTP (evidence: `Backend/controllers/auth.js`)
