# trongnguyenit01/tmdt_final_npkl architecture

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

## Overview

This is a multi-vendor e-commerce website: customers browse products, manage carts, and place orders; sellers manage shops and products; administrators govern users, listings, and system activity. Controllers implement these domain workflows over a shared Entity Framework context, with product/order/user entities representing persisted state. The README documents the broader capabilities; sampled controller excerpts confirm cart and order handling, product operations, and administrative actions. Other controller behavior is represented by its tree-supported module path, but its internal calls were not sampled.

Main entry points: [`TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs`](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs) (SQL data context), [`TMDT_FINAL_NPKL/Controllers/DonHangController.cs`](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DonHangController.cs) (Order and checkout), [`TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangNhapController.cs) (Sign-in and recovery), [`TMDT_FINAL_NPKL/Controllers/SanPhamController.cs`](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/SanPhamController.cs) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity"]
  node_registration["Registration"]
  node_authentication["Sign-in and recovery"]
  node_profile["Account profile"]
  node_password_hashing["Password hashing<br/>[HassPass.cs]"]
end

subgraph group_marketplace["Marketplace"]
  node_catalog["Product catalog"]
  node_seller_products["Seller products"]
  node_shops["Shop management<br/>[ShopController.cs]"]
  node_categories["Categories"]
end

subgraph group_commerce["Commerce"]
  node_cart["Shopping cart"]
  node_orders["Order and checkout"]
  node_complaints["Appeals"]
end

subgraph group_operations["Administration and data"]
  node_admin_ops["Admin operations<br/>[AdminController.cs]"]
  node_product_review["Product review"]
  node_account_admin["Account administration"]
  node_dashboard["System dashboard"]
  node_seller_metrics["Seller statistics"]
  node_entities["Domain entities"]
  node_database[("SQL data context<br/>[WebTmdtContext.cs]")]
  node_id_generation["ID generation<br/>[GenID.cs]"]
end

node_customer(("Customer"))
node_seller(("Seller"))
node_admin(("Administrator"))

node_customer -->|"registers"| node_registration
node_customer -->|"signs in"| node_authentication
node_customer -->|"browses products"| node_catalog
node_customer -->|"manages cart"| node_cart
node_customer -->|"places orders"| node_orders
node_seller -->|"manages shop"| node_shops
node_seller -->|"manages listings"| node_seller_products
node_seller -->|"handles orders"| node_orders
node_admin -->|"governs platform"| node_admin_ops
node_admin -->|"reviews products"| node_product_review
node_admin -->|"manages accounts"| node_account_admin
node_admin -->|"views statistics"| node_dashboard
node_admin -->|"manages categories"| node_categories
node_registration -.->|"persists accounts"| node_database
node_authentication -->|"reads accounts"| node_database
node_authentication -->|"checks passwords"| node_password_hashing
node_profile -->|"updates profile"| node_database
node_catalog -->|"reads products"| node_database
node_catalog -->|"uses product data"| node_entities
node_seller_products -->|"reads seller data"| node_database
node_shops -->|"reads shop data"| node_database
node_cart -->|"reads and writes"| node_database
node_cart -->|"generates cart IDs"| node_id_generation
node_orders -->|"creates and queries"| node_database
node_orders -->|"generates detail IDs"| node_id_generation
node_admin_ops -->|"updates admin state"| node_database
node_admin_ops -->|"uses user and appeal data"| node_entities
node_product_review -.->|"reviews listings"| node_database
node_account_admin -.->|"manages accounts"| node_database
node_dashboard -.->|"reads metrics"| node_database
node_seller_metrics -.->|"reads seller metrics"| node_database
node_categories -.->|"manages categories"| node_database
node_complaints -.->|"handles appeals"| node_database
node_database -->|"maps domain data"| node_entities

click node_registration "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangKyController.cs"
click node_authentication "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangNhapController.cs"
click node_profile "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangNhapController.cs"
click node_catalog "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/SanPhamController.cs"
click node_seller_products "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/LaySPSellerController.cs"
click node_shops "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/ShopController.cs"
click node_categories "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DoanhMucController.cs"
click node_cart "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/GioHangController.cs"
click node_orders "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DonHangController.cs"
click node_complaints "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/KhieuNaiController.cs"
click node_admin_ops "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/AdminController.cs"
click node_product_review "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/AdminDuyetSPController.cs"
click node_account_admin "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/CapTaiKhoanController.cs"
click node_dashboard "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DashboardController.cs"
click node_seller_metrics "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/ThkeSellerController.cs"
click node_entities "https://github.com/trongnguyenit01/tmdt_final_npkl/tree/master/TMDT_FINAL_NPKL/Entities"
click node_database "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs"
click node_id_generation "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Models/GenID.cs"
click node_password_hashing "https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Models/HassPass.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_registration,node_authentication,node_profile,node_password_hashing toneBlue
class node_catalog,node_seller_products,node_shops,node_categories toneAmber
class node_cart,node_orders,node_complaints toneMint
class node_admin_ops,node_product_review,node_account_admin,node_dashboard,node_seller_metrics,node_entities,node_database,node_id_generation toneRose
class node_customer,node_seller,node_admin toneIndigo
```

## Components

### Identity

- [Registration](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangKyController.cs): `TMDT_FINAL_NPKL/Controllers/DangKyController.cs`
- [Sign-in and recovery](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangNhapController.cs): `TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`
- [Account profile](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DangNhapController.cs): `TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`
- [Password hashing](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Models/HassPass.cs): `TMDT_FINAL_NPKL/Models/HassPass.cs`

### Marketplace

- [Product catalog](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/SanPhamController.cs): `TMDT_FINAL_NPKL/Controllers/SanPhamController.cs`
- [Seller products](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/LaySPSellerController.cs): `TMDT_FINAL_NPKL/Controllers/LaySPSellerController.cs`
- [Shop management](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/ShopController.cs): `TMDT_FINAL_NPKL/Controllers/ShopController.cs`
- [Categories](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DoanhMucController.cs): `TMDT_FINAL_NPKL/Controllers/DoanhMucController.cs`

### Commerce

- [Shopping cart](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/GioHangController.cs): `TMDT_FINAL_NPKL/Controllers/GioHangController.cs`
- [Order and checkout](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DonHangController.cs): `TMDT_FINAL_NPKL/Controllers/DonHangController.cs`
- [Appeals](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/KhieuNaiController.cs): `TMDT_FINAL_NPKL/Controllers/KhieuNaiController.cs`

### Administration and data

- [Admin operations](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/AdminController.cs): `TMDT_FINAL_NPKL/Controllers/AdminController.cs`
- [Product review](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/AdminDuyetSPController.cs): `TMDT_FINAL_NPKL/Controllers/AdminDuyetSPController.cs`
- [Account administration](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/CapTaiKhoanController.cs): `TMDT_FINAL_NPKL/Controllers/CapTaiKhoanController.cs`
- [System dashboard](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/DashboardController.cs): `TMDT_FINAL_NPKL/Controllers/DashboardController.cs`
- [Seller statistics](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Controllers/ThkeSellerController.cs): `TMDT_FINAL_NPKL/Controllers/ThkeSellerController.cs`
- [Domain entities](https://github.com/trongnguyenit01/tmdt_final_npkl/tree/master/TMDT_FINAL_NPKL/Entities): `TMDT_FINAL_NPKL/Entities`
- [SQL data context](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs): `TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs`
- [ID generation](https://github.com/trongnguyenit01/tmdt_final_npkl/blob/master/TMDT_FINAL_NPKL/Models/GenID.cs): `TMDT_FINAL_NPKL/Models/GenID.cs`

### Other components

- **Customer**
- **Seller**
- **Administrator**

## Connections

- Customer → Registration: registers
- Customer → Sign-in and recovery: signs in
- Customer → Product catalog: browses products
- Customer → Shopping cart: manages cart
- Customer → Order and checkout: places orders
- Seller → Shop management: manages shop
- Seller → Seller products: manages listings
- Seller → Order and checkout: handles orders
- Administrator → Admin operations: governs platform
- Administrator → Product review: reviews products
- Administrator → Account administration: manages accounts
- Administrator → System dashboard: views statistics
- Administrator → Categories: manages categories
- Registration → SQL data context: persists accounts
- Sign-in and recovery → SQL data context: reads accounts (evidence: `TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`)
- Sign-in and recovery → Password hashing: checks passwords (evidence: `TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`)
- Account profile → SQL data context: updates profile (evidence: `TMDT_FINAL_NPKL/Controllers/DangNhapController.cs`)
- Product catalog → SQL data context: reads products (evidence: `TMDT_FINAL_NPKL/Controllers/SanPhamController.cs`)
- Product catalog → Domain entities: uses product data (evidence: `TMDT_FINAL_NPKL/Controllers/SanPhamController.cs`)
- Seller products → SQL data context: reads seller data (evidence: `TMDT_FINAL_NPKL/Controllers/LaySPSellerController.cs`)
- Shop management → SQL data context: reads shop data (evidence: `TMDT_FINAL_NPKL/Controllers/ShopController.cs`)
- Shopping cart → SQL data context: reads and writes (evidence: `TMDT_FINAL_NPKL/Controllers/GioHangController.cs`)
- Shopping cart → ID generation: generates cart IDs (evidence: `TMDT_FINAL_NPKL/Controllers/GioHangController.cs`)
- Order and checkout → SQL data context: creates and queries (evidence: `TMDT_FINAL_NPKL/Controllers/DonHangController.cs`)
- Order and checkout → ID generation: generates detail IDs (evidence: `TMDT_FINAL_NPKL/Controllers/DonHangController.cs`)
- Admin operations → SQL data context: updates admin state (evidence: `TMDT_FINAL_NPKL/Controllers/AdminController.cs`)
- Admin operations → Domain entities: uses user and appeal data (evidence: `TMDT_FINAL_NPKL/Controllers/AdminController.cs`)
- Product review → SQL data context: reviews listings
- Account administration → SQL data context: manages accounts
- System dashboard → SQL data context: reads metrics
- Seller statistics → SQL data context: reads seller metrics
- Categories → SQL data context: manages categories
- Appeals → SQL data context: handles appeals
- SQL data context → Domain entities: maps domain data (evidence: `TMDT_FINAL_NPKL/Entities/WebTmdtContext.cs`)
