# anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1 architecture

> Architecture diagram of the GitHub repository anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1, 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/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1
- Repository: https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1

## Overview

Vinh-SHOP is a fashion storefront with customer shopping flows and separate admin and employee work areas. The visible customer workflow runs from browsing products through cart and checkout to order history; App.jsx owns shared cart and user state, while page components provide the individual stages. Login, registration and order creation/history call PHP API endpoints. Admin and employee areas are present in the tree, but their route wiring and most page behavior are not shown, so those links are left unasserted.

Main entry points: [`src/App.jsx`](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/App.jsx) (App state and routing), [`src/pages/customer/Home.jsx`](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Home.jsx) (Store home), [`src/pages/customer/Products.jsx`](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Products.jsx) (Product catalog), [`src/layouts/CustomerLayout.jsx`](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/layouts/CustomerLayout.jsx) (Customer layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer storefront"]
  node_app["App state and routing<br/>[App.jsx]"]
  node_home["Store home<br/>[Home.jsx]"]
  node_catalog["Product catalog<br/>[Products.jsx]"]
  node_detail["Product detail<br/>[ProductDetail.jsx]"]
  node_auth["Customer access"]
  node_profile["Customer profile<br/>[Profile.jsx]"]
  node_account_api["Account API"]
end

subgraph group_commerce["Shopping and orders"]
  node_cart["Shopping cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_orders["Order history<br/>[Orders.jsx]"]
  node_invoice["Invoice view<br/>[Invoice.jsx]"]
  node_order_api["Order API"]
end

subgraph group_operations["Staff operations"]
  node_admin["Admin workspace"]
  node_employee["Employee workspace"]
end

subgraph group_shared["Shared UI and data"]
  node_sidebar["Role navigation<br/>[Sidebar.jsx]"]
  node_products["Product sample data<br/>[products.js]"]
  node_product_card["Product card<br/>[ProductCard.jsx]"]
  node_customer_layout["Customer layout<br/>[CustomerLayout.jsx]"]
  node_header["Store header<br/>[Header.jsx]"]
  node_footer["Store footer<br/>[Footer.jsx]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses storefront"| node_app
node_app -->|"renders"| node_home
node_app -->|"renders"| node_catalog
node_app -->|"renders"| node_detail
node_app -->|"renders"| node_auth
node_app -->|"renders"| node_profile
node_app -->|"renders"| node_cart
node_app -->|"renders"| node_checkout
node_app -->|"renders"| node_orders
node_app -->|"renders"| node_invoice
node_app -->|"requests account"| node_account_api
node_checkout -->|"creates order"| node_order_api
node_orders -->|"fetches orders"| node_order_api
node_home -->|"reads"| node_products
node_catalog -->|"reads"| node_products
node_home -->|"renders"| node_product_card
node_catalog -->|"renders"| node_product_card
node_customer_layout -->|"renders"| node_header
node_customer_layout -->|"renders"| node_footer
node_admin -->|"uses navigation"| node_sidebar
node_employee -->|"uses navigation"| node_sidebar

click node_app "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/App.jsx"
click node_home "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Home.jsx"
click node_catalog "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Products.jsx"
click node_detail "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/ProductDetail.jsx"
click node_auth "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/customer"
click node_profile "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Profile.jsx"
click node_cart "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Cart.jsx"
click node_checkout "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Checkout.jsx"
click node_orders "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Orders.jsx"
click node_invoice "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Invoice.jsx"
click node_admin "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/admin"
click node_employee "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/employee"
click node_sidebar "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Sidebar.jsx"
click node_products "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/data/products.js"
click node_product_card "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/ProductCard.jsx"
click node_customer_layout "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/layouts/CustomerLayout.jsx"
click node_header "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Header.jsx"
click node_footer "https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Footer.jsx"

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,node_detail,node_auth,node_profile,node_account_api toneBlue
class node_cart,node_checkout,node_orders,node_invoice,node_order_api toneAmber
class node_admin,node_employee toneMint
class node_sidebar,node_products,node_product_card,node_customer_layout,node_header,node_footer toneRose
class node_shopper toneIndigo
```

## Components

### Customer storefront

- [App state and routing](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/App.jsx): `src/App.jsx`
- [Store home](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Home.jsx): `src/pages/customer/Home.jsx`
- [Product catalog](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Products.jsx): `src/pages/customer/Products.jsx`
- [Product detail](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/ProductDetail.jsx): `src/pages/customer/ProductDetail.jsx`
- [Customer access](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/customer): `src/pages/customer`
- [Customer profile](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Profile.jsx): `src/pages/customer/Profile.jsx`
- **Account API**

### Shopping and orders

- [Shopping cart](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Cart.jsx): `src/pages/customer/Cart.jsx`
- [Checkout](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Checkout.jsx): `src/pages/customer/Checkout.jsx`
- [Order history](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Orders.jsx): `src/pages/customer/Orders.jsx`
- [Invoice view](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/pages/customer/Invoice.jsx): `src/pages/customer/Invoice.jsx`
- **Order API**

### Staff operations

- [Admin workspace](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/admin): `src/pages/admin`
- [Employee workspace](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/tree/main/src/pages/employee): `src/pages/employee`

### Shared UI and data

- [Role navigation](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Sidebar.jsx): `src/components/Sidebar.jsx`
- [Product sample data](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/data/products.js): `src/data/products.js`
- [Product card](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`
- [Customer layout](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/layouts/CustomerLayout.jsx): `src/layouts/CustomerLayout.jsx`
- [Store header](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Header.jsx): `src/components/Header.jsx`
- [Store footer](https://github.com/anhtanvinh123/24ct2_phan_ho_tan_vinh_cnpm_nt1/blob/main/src/components/Footer.jsx): `src/components/Footer.jsx`

### Other components

- **Shopper**

## Connections

- Shopper → App state and routing: uses storefront
- App state and routing → Store home: renders (evidence: `src/App.jsx`)
- App state and routing → Product catalog: renders (evidence: `src/App.jsx`)
- App state and routing → Product detail: renders (evidence: `src/App.jsx`)
- App state and routing → Customer access: renders (evidence: `src/App.jsx`)
- App state and routing → Customer profile: renders (evidence: `src/App.jsx`)
- App state and routing → Shopping cart: renders (evidence: `src/App.jsx`)
- App state and routing → Checkout: renders (evidence: `src/App.jsx`)
- App state and routing → Order history: renders (evidence: `src/App.jsx`)
- App state and routing → Invoice view: renders (evidence: `src/App.jsx`)
- App state and routing → Account API: requests account (evidence: `src/App.jsx`)
- Checkout → Order API: creates order (evidence: `src/pages/customer/Checkout.jsx`)
- Order history → Order API: fetches orders (evidence: `src/pages/customer/Orders.jsx`)
- Store home → Product sample data: reads (evidence: `src/pages/customer/Home.jsx`)
- Product catalog → Product sample data: reads (evidence: `src/pages/customer/Products.jsx`)
- Store home → Product card: renders (evidence: `src/pages/customer/Home.jsx`)
- Product catalog → Product card: renders (evidence: `src/pages/customer/Products.jsx`)
- Customer layout → Store header: renders (evidence: `src/layouts/CustomerLayout.jsx`)
- Customer layout → Store footer: renders (evidence: `src/layouts/CustomerLayout.jsx`)
- Admin workspace → Role navigation: uses navigation
- Employee workspace → Role navigation: uses navigation
