# huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs architecture

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

- Interactive diagram: https://gitdiagram.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs
- Repository: https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs

## Overview

Perfume E-Commerce is a React/Redux storefront backed by an Express and Sequelize API. Shoppers discover and filter products, authenticate, manage carts and addresses, place orders using COD or ZaloPay, and review purchases; administrators manage catalog, orders, users, reviews, and reporting. The graph preserves these documented product areas, while sampled code confirms selected client, controller, service, and review paths. Many feature-specific pages and server routes were not sampled, so their internal call relationships are not asserted.

Main entry points: [`src/client/src/api`](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/api) (Client API modules), [`src/client/src/App.js`](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/App.js) (React app routes), [`src/client/src/pages/product`](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/product) (Product discovery), [`src/server/server.js`](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/server.js) (Express API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["React app routes<br/>[App.js]"]
  node_catalog["Product discovery"]
  node_productcard["Product cards<br/>[ProductCard.jsx]"]
  node_filters["Filter synchronization"]
  node_producthook["Product fetching<br/>[useProducts.js]"]
end

subgraph group_commerce["Shopping &amp; Accounts"]
  node_auth["Authentication"]
  node_account["Account &amp; orders"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_reviews["Product reviews<br/>[ReviewModal.jsx]"]
end

subgraph group_admin["Administration"]
  node_adminui["Admin dashboard"]
  node_reviewadmin["Review moderation<br/>[ReviewList.jsx]"]
end

subgraph group_backend["API &amp; Data"]
  node_clientapi["Client API modules"]
  node_httpconfig["HTTP client<br/>[axios.config.js]"]
  node_server["Express API server<br/>[server.js]"]
  node_productcontroller["Product controller"]
  node_productservice["Product service<br/>[product.js]"]
  node_reviewcontroller["Review controller"]
  node_reviewservice["Review service<br/>[review.js]"]
  node_models["Sequelize models"]
end

node_shopper(("Shopper"))
node_mysql[("MySQL database")]
node_zalopay["ZaloPay"]

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_adminui
node_catalog -.->|"presents products"| node_productcard
node_catalog -.->|"syncs filters"| node_filters
node_producthook -->|"fetches products"| node_clientapi
node_clientapi -->|"uses HTTP client"| node_httpconfig
node_shopper -->|"manages cart"| node_cart
node_shopper -->|"places order"| node_checkout
node_checkout -->|"pays with"| node_zalopay
node_shopper -->|"manages account"| node_account
node_shopper -->|"submits review"| node_reviews
node_reviews -->|"posts review"| node_clientapi
node_reviewadmin -->|"moderates reviews"| node_clientapi
node_clientapi -->|"calls API"| node_server
node_server -->|"mounts routes"| node_productcontroller
node_productcontroller -->|"calls service"| node_productservice
node_reviewcontroller -->|"calls service"| node_reviewservice
node_reviewservice -->|"queries reviews"| node_models
node_server -->|"connects database"| node_mysql

click node_app "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/App.js"
click node_catalog "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/product"
click node_productcard "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/components/product/ProductCard.jsx"
click node_filters "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/hooks/useSyncFiltersWithURL.js"
click node_producthook "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/hooks/useProducts.js"
click node_auth "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/auth"
click node_account "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/account"
click node_cart "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/Cart.jsx"
click node_checkout "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/Checkout.jsx"
click node_reviews "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/components/modal/ReviewModal.jsx"
click node_adminui "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/admin"
click node_reviewadmin "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/admin/reviews/ReviewList.jsx"
click node_clientapi "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/api"
click node_httpconfig "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/api/axios.config.js"
click node_server "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/server.js"
click node_productcontroller "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/controllers/product.controller.js"
click node_productservice "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/services/product.js"
click node_reviewcontroller "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/controllers/review.controller.js"
click node_reviewservice "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/services/review.js"
click node_models "https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/server/src/models"

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_catalog,node_productcard,node_filters,node_producthook toneBlue
class node_auth,node_account,node_cart,node_checkout,node_reviews,node_mysql toneAmber
class node_adminui,node_reviewadmin toneMint
class node_clientapi,node_httpconfig,node_server,node_productcontroller,node_productservice,node_reviewcontroller,node_reviewservice,node_models toneRose
class node_shopper,node_zalopay toneIndigo
```

## Components

### Storefront

- [React app routes](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/App.js): `src/client/src/App.js`
- [Product discovery](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/product): `src/client/src/pages/product`
- [Product cards](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/components/product/ProductCard.jsx): `src/client/src/components/product/ProductCard.jsx`
- [Filter synchronization](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/hooks/useSyncFiltersWithURL.js): `src/client/src/hooks/useSyncFiltersWithURL.js`
- [Product fetching](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/hooks/useProducts.js): `src/client/src/hooks/useProducts.js`

### Shopping & Accounts

- [Authentication](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/auth): `src/client/src/pages/auth`
- [Account & orders](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/account): `src/client/src/pages/account`
- [Cart](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/Cart.jsx): `src/client/src/pages/Cart.jsx`
- [Checkout](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/Checkout.jsx): `src/client/src/pages/Checkout.jsx`
- [Product reviews](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/components/modal/ReviewModal.jsx): `src/client/src/components/modal/ReviewModal.jsx`

### Administration

- [Admin dashboard](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/pages/admin): `src/client/src/pages/admin`
- [Review moderation](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/pages/admin/reviews/ReviewList.jsx): `src/client/src/pages/admin/reviews/ReviewList.jsx`

### API & Data

- [Client API modules](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/client/src/api): `src/client/src/api`
- [HTTP client](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/client/src/api/axios.config.js): `src/client/src/api/axios.config.js`
- [Express API server](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/server.js): `src/server/server.js`
- [Product controller](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/controllers/product.controller.js): `src/server/src/controllers/product.controller.js`
- [Product service](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/services/product.js): `src/server/src/services/product.js`
- [Review controller](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/controllers/review.controller.js): `src/server/src/controllers/review.controller.js`
- [Review service](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/blob/main/src/server/src/services/review.js): `src/server/src/services/review.js`
- [Sequelize models](https://github.com/huuluan186/cn-da22tta-phamhuuluan-perfume-nodejs/tree/main/src/server/src/models): `src/server/src/models`

### Other components

- **Shopper**
- **MySQL database**
- **ZaloPay**

## Connections

- Shopper → React app routes: uses
- React app routes → Product discovery: routes to (evidence: `src/client/src/App.js`)
- React app routes → Authentication: routes to (evidence: `src/client/src/App.js`)
- React app routes → Admin dashboard: routes to (evidence: `src/client/src/App.js`)
- Product discovery → Product cards: presents products
- Product discovery → Filter synchronization: syncs filters
- Product fetching → Client API modules: fetches products (evidence: `src/client/src/hooks/useProducts.js`)
- Client API modules → HTTP client: uses HTTP client (evidence: `src/client/src/api/product.js`)
- Shopper → Cart: manages cart
- Shopper → Checkout: places order
- Checkout → ZaloPay: pays with
- Shopper → Account & orders: manages account
- Shopper → Product reviews: submits review
- Product reviews → Client API modules: posts review (evidence: `src/client/src/components/modal/ReviewModal.jsx`)
- Review moderation → Client API modules: moderates reviews (evidence: `src/client/src/pages/admin/reviews/ReviewList.jsx`)
- Client API modules → Express API server: calls API
- Express API server → Product controller: mounts routes (evidence: `src/server/server.js`)
- Product controller → Product service: calls service (evidence: `src/server/src/controllers/product.controller.js`)
- Review controller → Review service: calls service (evidence: `src/server/src/controllers/review.controller.js`)
- Review service → Sequelize models: queries reviews (evidence: `src/server/src/services/review.js`)
- Express API server → MySQL database: connects database
