# nguyenthetruong2396/website_ban_quan_ao architecture

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

- Interactive diagram: https://gitdiagram.com/nguyenthetruong2396/website_ban_quan_ao
- Repository: https://github.com/nguyenthetruong2396/website_ban_quan_ao

## Overview

This is an ASP.NET Core clothing-commerce site with customer shopping and account flows alongside administrative catalog, fulfillment, inventory, and reporting functions. Customers browse products, add variants to a session cart, and place and track orders; admins manage products and stock, receipts, customers, and store operations. The sampled controllers show checkout, catalog, account, and selected admin-to-repository calls. Other admin capabilities are represented from the file tree; their detailed wiring was not sampled.

Main entry points: [`Website_Ban_Quan_Ao/Repository/UnitOfWork.cs`](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Repository/UnitOfWork.cs) (Unit of work), [`Website_Ban_Quan_Ao/Controllers/GioHangController.cs`](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/GioHangController.cs) (Shopping cart), [`Website_Ban_Quan_Ao/Controllers/DonHangController.cs`](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/DonHangController.cs) (Orders and checkout), [`Website_Ban_Quan_Ao/Controllers/TaiKhoanController.cs`](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/TaiKhoanController.cs) (Account access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer storefront"]
  node_catalog["Product catalog"]
  node_cart["Shopping cart"]
  node_orders["Orders and checkout"]
  node_profile["Customer profile"]
  node_home["Storefront home<br/>[HomeController.cs]"]
  node_order_hub["Order notifications<br/>[OrderHub.cs]"]
end

subgraph group_admin["Store administration"]
  node_category_admin["Category management"]
  node_product_admin["Product management"]
  node_brand_admin["Brand management"]
  node_order_admin["Order management"]
  node_receiving["Stock receiving"]
  node_stock_admin["Inventory management"]
  node_customer_admin["Customer management"]
  node_revenue_admin["Revenue reporting"]
  node_analytics_admin["Sales statistics"]
  node_overview_admin["Admin overview"]
  node_settings_admin["Store settings"]
end

subgraph group_accounts["Accounts and messaging"]
  node_account["Account access"]
  node_email_sender["Email sender<br/>[EmailSender.cs]"]
end

subgraph group_data["Persistence and runtime"]
  node_session_extensions["Session serialization"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_repository["Generic repository<br/>[Repository.cs]"]
  node_db_context[("Commerce database")]
end

node_shopper(("Shopper"))
node_admin_user(("Administrator"))
node_email_service["Email service"]
node_session_store[("Session state")]
node_order_clients(("Connected clients"))

node_shopper -->|"browse"| node_catalog
node_shopper -->|"manage cart"| node_cart
node_shopper -->|"checkout and track"| node_orders
node_shopper -->|"sign in or register"| node_account
node_shopper -->|"manage profile"| node_profile
node_admin_user -->|"manage categories"| node_category_admin
node_admin_user -->|"manage products"| node_product_admin
node_admin_user -->|"manage brands"| node_brand_admin
node_admin_user -->|"manage orders"| node_order_admin
node_admin_user -->|"record receipts"| node_receiving
node_admin_user -->|"manage stock"| node_stock_admin
node_admin_user -->|"manage customers"| node_customer_admin
node_admin_user -->|"view revenue"| node_revenue_admin
node_admin_user -->|"view statistics"| node_analytics_admin
node_admin_user -->|"view overview"| node_overview_admin
node_admin_user -->|"configure store"| node_settings_admin
node_catalog -->|"reads catalog and reviews"| node_unit_of_work
node_cart -->|"reads variants and stock"| node_unit_of_work
node_cart -->|"loads and saves cart"| node_session_extensions
node_session_extensions -->|"serializes session data"| node_session_store
node_orders -->|"reads and saves orders"| node_unit_of_work
node_orders -->|"dispatches order notice"| node_order_hub
node_order_hub -->|"broadcasts updates"| node_order_clients
node_profile -->|"reads and updates profile"| node_unit_of_work
node_account -->|"reads and saves accounts and OTPs"| node_unit_of_work
node_account -->|"sends verification and recovery email"| node_email_sender
node_email_sender -->|"delivers email"| node_email_service
node_category_admin -->|"manages categories"| node_unit_of_work
node_product_admin -->|"manages products and variants"| node_unit_of_work
node_brand_admin -->|"manages brands"| node_unit_of_work
node_order_admin -->|"manages orders"| node_unit_of_work
node_receiving -->|"records receipts and stock"| node_unit_of_work
node_stock_admin -->|"manages inventory"| node_unit_of_work
node_customer_admin -->|"manages customers"| node_unit_of_work
node_revenue_admin -->|"reads revenue data"| node_unit_of_work
node_analytics_admin -->|"reads sales data"| node_unit_of_work
node_overview_admin -->|"reads dashboard data"| node_unit_of_work
node_settings_admin -->|"reads and saves settings"| node_unit_of_work
node_unit_of_work -->|"coordinates repositories"| node_repository
node_repository -->|"queries and changes entities"| node_db_context

click node_catalog "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/SanPhamController.cs"
click node_cart "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/GioHangController.cs"
click node_orders "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/DonHangController.cs"
click node_profile "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/NguoiDungController.cs"
click node_home "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/HomeController.cs"
click node_account "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/TaiKhoanController.cs"
click node_email_sender "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Services/EmailSender.cs"
click node_category_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDanhMucController.cs"
click node_product_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLySanPhamController.cs"
click node_brand_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyThuongHieuController.cs"
click node_order_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDonHangController.cs"
click node_receiving "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyNhapHangController.cs"
click node_stock_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyTonKhoController.cs"
click node_customer_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyKhachHangController.cs"
click node_revenue_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDoanhThuController.cs"
click node_analytics_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/ThongKeDoanhThuController.cs"
click node_overview_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/TongQuanController.cs"
click node_settings_admin "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/CaiDatWebController.cs"
click node_order_hub "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Hubs/OrderHub.cs"
click node_session_extensions "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Extensions/SessionExtensions.cs"
click node_unit_of_work "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Repository/UnitOfWork.cs"
click node_repository "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Repository/Repository.cs"
click node_db_context "https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Models/ApplicationDbContext.cs"

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_catalog,node_cart,node_orders,node_profile,node_home,node_order_hub,node_order_clients toneBlue
class node_category_admin,node_product_admin,node_brand_admin,node_order_admin,node_receiving,node_stock_admin,node_customer_admin,node_revenue_admin,node_analytics_admin,node_overview_admin,node_settings_admin,node_session_store toneAmber
class node_account,node_email_sender toneMint
class node_session_extensions,node_unit_of_work,node_repository,node_db_context toneRose
class node_shopper,node_admin_user,node_email_service toneIndigo
```

## Components

### Customer storefront

- [Product catalog](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/SanPhamController.cs): `Website_Ban_Quan_Ao/Controllers/SanPhamController.cs`
- [Shopping cart](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/GioHangController.cs): `Website_Ban_Quan_Ao/Controllers/GioHangController.cs`
- [Orders and checkout](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/DonHangController.cs): `Website_Ban_Quan_Ao/Controllers/DonHangController.cs`
- [Customer profile](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/NguoiDungController.cs): `Website_Ban_Quan_Ao/Controllers/NguoiDungController.cs`
- [Storefront home](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/HomeController.cs): `Website_Ban_Quan_Ao/Controllers/HomeController.cs`
- [Order notifications](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Hubs/OrderHub.cs): `Website_Ban_Quan_Ao/Hubs/OrderHub.cs`

### Store administration

- [Category management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDanhMucController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDanhMucController.cs`
- [Product management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLySanPhamController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLySanPhamController.cs`
- [Brand management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyThuongHieuController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyThuongHieuController.cs`
- [Order management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDonHangController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDonHangController.cs`
- [Stock receiving](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyNhapHangController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyNhapHangController.cs`
- [Inventory management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyTonKhoController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyTonKhoController.cs`
- [Customer management](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyKhachHangController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyKhachHangController.cs`
- [Revenue reporting](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDoanhThuController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/QuanLyDoanhThuController.cs`
- [Sales statistics](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/ThongKeDoanhThuController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/ThongKeDoanhThuController.cs`
- [Admin overview](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/TongQuanController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/TongQuanController.cs`
- [Store settings](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/Admin/CaiDatWebController.cs): `Website_Ban_Quan_Ao/Controllers/Admin/CaiDatWebController.cs`

### Accounts and messaging

- [Account access](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Controllers/TaiKhoanController.cs): `Website_Ban_Quan_Ao/Controllers/TaiKhoanController.cs`
- [Email sender](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Services/EmailSender.cs): `Website_Ban_Quan_Ao/Services/EmailSender.cs`

### Persistence and runtime

- [Session serialization](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Extensions/SessionExtensions.cs): `Website_Ban_Quan_Ao/Extensions/SessionExtensions.cs`
- [Unit of work](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Repository/UnitOfWork.cs): `Website_Ban_Quan_Ao/Repository/UnitOfWork.cs`
- [Generic repository](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Repository/Repository.cs): `Website_Ban_Quan_Ao/Repository/Repository.cs`
- [Commerce database](https://github.com/nguyenthetruong2396/website_ban_quan_ao/blob/master/Website_Ban_Quan_Ao/Models/ApplicationDbContext.cs): `Website_Ban_Quan_Ao/Models/ApplicationDbContext.cs`

### Other components

- **Shopper**
- **Administrator**
- **Email service**
- **Session state**
- **Connected clients**

## Connections

- Shopper → Product catalog: browse
- Shopper → Shopping cart: manage cart
- Shopper → Orders and checkout: checkout and track
- Shopper → Account access: sign in or register
- Shopper → Customer profile: manage profile
- Administrator → Category management: manage categories
- Administrator → Product management: manage products
- Administrator → Brand management: manage brands
- Administrator → Order management: manage orders
- Administrator → Stock receiving: record receipts
- Administrator → Inventory management: manage stock
- Administrator → Customer management: manage customers
- Administrator → Revenue reporting: view revenue
- Administrator → Sales statistics: view statistics
- Administrator → Admin overview: view overview
- Administrator → Store settings: configure store
- Product catalog → Unit of work: reads catalog and reviews
- Shopping cart → Unit of work: reads variants and stock
- Shopping cart → Session serialization: loads and saves cart
- Session serialization → Session state: serializes session data
- Orders and checkout → Unit of work: reads and saves orders
- Orders and checkout → Order notifications: dispatches order notice
- Order notifications → Connected clients: broadcasts updates
- Customer profile → Unit of work: reads and updates profile
- Account access → Unit of work: reads and saves accounts and OTPs
- Account access → Email sender: sends verification and recovery email
- Email sender → Email service: delivers email
- Category management → Unit of work: manages categories
- Product management → Unit of work: manages products and variants
- Brand management → Unit of work: manages brands
- Order management → Unit of work: manages orders
- Stock receiving → Unit of work: records receipts and stock
- Inventory management → Unit of work: manages inventory
- Customer management → Unit of work: manages customers
- Revenue reporting → Unit of work: reads revenue data
- Sales statistics → Unit of work: reads sales data
- Admin overview → Unit of work: reads dashboard data
- Store settings → Unit of work: reads and saves settings
- Unit of work → Generic repository: coordinates repositories
- Generic repository → Commerce database: queries and changes entities
