# vukhanh2005/quanlynhahangnhom3_uneti architecture

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

- Interactive diagram: https://gitdiagram.com/vukhanh2005/quanlynhahangnhom3_uneti
- Repository: https://github.com/vukhanh2005/quanlynhahangnhom3_uneti

## Overview

This is an ASP.NET restaurant-management application. Users register or sign in, browse restaurant information, manage customer details, and submit or review table reservations; administrators manage tables, table categories, dishes, and reservation operations. The main layers are MVC controllers, service implementations, repositories, and an Entity Framework context over shared domain entities. The excerpts show table CRUD and reservation logic in detail; other documented-by-code areas are represented from the source index, so their internal behavior and some wiring are not asserted.

Main entry points: [`AppDbContext.cs`](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/AppDbContext.cs) (Application database), [`Service/Implement/AuthService.cs`](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/AuthService.cs) (Authentication), [`Controllers/BanAnController.cs`](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/BanAnController.cs) (Table management), [`Controllers/Module03/PhieuDatBanController.cs`](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module03/PhieuDatBanController.cs) (Reservation endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web workflows"]
  node_account_web["Account endpoints"]
  node_category_web["Table categories"]
  node_dashboard["Restaurant home"]
  node_table_web["Table management<br/>[BanAnController.cs]"]
  node_dish_web["Dish management"]
  node_customer_web["Customer records"]
  node_reservation_web["Reservation endpoints"]
end

subgraph group_services["Application services"]
  node_auth["Authentication<br/>[AuthService.cs]"]
  node_customer_service["Customer service"]
  node_category_service["Category service<br/>[LoaiBanService.cs]"]
  node_dish_service["Dish service<br/>[MonAnService.cs]"]
  node_reservation_service["Reservation service"]
end

subgraph group_data["Persistence"]
  node_account_repo["Account repository"]
  node_customer_repo["Customer repository"]
  node_category_repo["Category repository"]
  node_dish_repo["Dish repository<br/>[MonAnRepository.cs]"]
  node_reservation_repo["Reservation repository"]
  node_db[("Application database<br/>[AppDbContext.cs]")]
end

subgraph group_domain["Restaurant domain"]
  node_entities["Accounts and customers"]
  node_table_entities["Tables and categories"]
  node_reservation_entity["Reservation records<br/>[PhieuDatBan.cs]"]
  node_dish_entity["Dish records<br/>[MonAn.cs]"]
end

node_guest(("Customer"))
node_admin(("Administrator"))

node_guest -->|"registers or signs in"| node_account_web
node_account_web -->|"delegates auth"| node_auth
node_auth -->|"looks up and saves"| node_account_repo
node_auth -->|"creates profile"| node_customer_service
node_customer_web -->|"manages customers"| node_customer_service
node_customer_service -->|"reads and writes"| node_customer_repo
node_category_web -->|"manages categories"| node_category_service
node_dish_web -->|"manages dishes"| node_dish_service
node_dashboard -->|"loads categories"| node_category_service
node_dashboard -->|"loads dishes"| node_dish_service
node_table_web -->|"queries and saves"| node_db
node_table_web -->|"validates table forms"| node_table_entities
node_admin -->|"manages tables"| node_table_web
node_admin -->|"maintains categories"| node_category_web
node_admin -->|"maintains dishes"| node_dish_web
node_guest -->|"requests reservations"| node_reservation_web
node_admin -->|"reviews reservations"| node_reservation_web
node_reservation_web -->|"submits reservation actions"| node_reservation_service
node_reservation_service -->|"checks and updates"| node_reservation_repo
node_account_repo -->|"queries accounts"| node_db
node_customer_repo -->|"queries customers"| node_db
node_category_repo -->|"queries categories"| node_db
node_dish_repo -->|"queries dishes"| node_db
node_reservation_repo -->|"reads and writes reservations"| node_db
node_db -->|"maps entities"| node_entities
node_db -->|"maps tables"| node_table_entities
node_db -->|"maps reservations"| node_reservation_entity
node_db -->|"maps dishes"| node_dish_entity

click node_account_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/AccountController.cs"
click node_category_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/LoaiBanController.cs"
click node_dashboard "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/TrangChuController.cs"
click node_table_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/BanAnController.cs"
click node_dish_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module02/MonAnsController.cs"
click node_customer_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module03/KhachHangController.cs"
click node_reservation_web "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module03/PhieuDatBanController.cs"
click node_auth "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/AuthService.cs"
click node_customer_service "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/KhachHangService.cs"
click node_category_service "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/LoaiBanService.cs"
click node_dish_service "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/MonAnService.cs"
click node_reservation_service "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/PhieuDatBanService.cs"
click node_account_repo "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/AccountRepository.cs"
click node_customer_repo "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/KhachHangRepository.cs"
click node_category_repo "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/LoaiBanRepository.cs"
click node_dish_repo "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/MonAnRepository.cs"
click node_reservation_repo "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/PhieuDatBanRepository.cs"
click node_db "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/AppDbContext.cs"
click node_entities "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/tree/main/Models"
click node_table_entities "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/tree/main/Models"
click node_reservation_entity "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Models/PhieuDatBan.cs"
click node_dish_entity "https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Models/MonAn.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_account_web,node_category_web,node_dashboard,node_table_web,node_dish_web,node_customer_web,node_reservation_web toneBlue
class node_auth,node_customer_service,node_category_service,node_dish_service,node_reservation_service toneAmber
class node_account_repo,node_customer_repo,node_category_repo,node_dish_repo,node_reservation_repo,node_db toneMint
class node_entities,node_table_entities,node_reservation_entity,node_dish_entity toneRose
class node_guest,node_admin toneIndigo
```

## Components

### Web workflows

- [Account endpoints](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/AccountController.cs): `Controllers/Module01/AccountController.cs`
- [Table categories](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/LoaiBanController.cs): `Controllers/Module01/LoaiBanController.cs`
- [Restaurant home](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module01/TrangChuController.cs): `Controllers/Module01/TrangChuController.cs`
- [Table management](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/BanAnController.cs): `Controllers/BanAnController.cs`
- [Dish management](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module02/MonAnsController.cs): `Controllers/Module02/MonAnsController.cs`
- [Customer records](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module03/KhachHangController.cs): `Controllers/Module03/KhachHangController.cs`
- [Reservation endpoints](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Controllers/Module03/PhieuDatBanController.cs): `Controllers/Module03/PhieuDatBanController.cs`

### Application services

- [Authentication](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/AuthService.cs): `Service/Implement/AuthService.cs`
- [Customer service](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/KhachHangService.cs): `Service/Implement/KhachHangService.cs`
- [Category service](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/LoaiBanService.cs): `Service/Implement/LoaiBanService.cs`
- [Dish service](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/MonAnService.cs): `Service/Implement/MonAnService.cs`
- [Reservation service](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Service/Implement/PhieuDatBanService.cs): `Service/Implement/PhieuDatBanService.cs`

### Persistence

- [Account repository](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/AccountRepository.cs): `Repository/AccountRepository.cs`
- [Customer repository](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/KhachHangRepository.cs): `Repository/KhachHangRepository.cs`
- [Category repository](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/LoaiBanRepository.cs): `Repository/LoaiBanRepository.cs`
- [Dish repository](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/MonAnRepository.cs): `Repository/MonAnRepository.cs`
- [Reservation repository](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Repository/PhieuDatBanRepository.cs): `Repository/PhieuDatBanRepository.cs`
- [Application database](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/AppDbContext.cs): `AppDbContext.cs`

### Restaurant domain

- [Accounts and customers](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/tree/main/Models): `Models`
- [Tables and categories](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/tree/main/Models): `Models`
- [Reservation records](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Models/PhieuDatBan.cs): `Models/PhieuDatBan.cs`
- [Dish records](https://github.com/vukhanh2005/quanlynhahangnhom3_uneti/blob/main/Models/MonAn.cs): `Models/MonAn.cs`

### Other components

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

## Connections

- Customer → Account endpoints: registers or signs in (evidence: `Controllers/Module01/AccountController.cs`)
- Account endpoints → Authentication: delegates auth (evidence: `Controllers/Module01/AccountController.cs`)
- Authentication → Account repository: looks up and saves (evidence: `Service/Implement/AuthService.cs`)
- Authentication → Customer service: creates profile (evidence: `Service/Implement/AuthService.cs`)
- Customer records → Customer service: manages customers (evidence: `Controllers/Module03/KhachHangController.cs`)
- Customer service → Customer repository: reads and writes (evidence: `Service/Implement/KhachHangService.cs`)
- Table categories → Category service: manages categories (evidence: `Controllers/Module01/LoaiBanController.cs`)
- Dish management → Dish service: manages dishes (evidence: `Controllers/Module02/MonAnsController.cs`)
- Restaurant home → Category service: loads categories (evidence: `Controllers/Module01/TrangChuController.cs`)
- Restaurant home → Dish service: loads dishes (evidence: `Controllers/Module01/TrangChuController.cs`)
- Table management → Application database: queries and saves (evidence: `Controllers/BanAnController.cs`)
- Table management → Tables and categories: validates table forms (evidence: `Controllers/BanAnController.cs`)
- Administrator → Table management: manages tables (evidence: `Controllers/BanAnController.cs`)
- Administrator → Table categories: maintains categories (evidence: `Controllers/Module01/LoaiBanController.cs`)
- Administrator → Dish management: maintains dishes (evidence: `Controllers/Module02/MonAnsController.cs`)
- Customer → Reservation endpoints: requests reservations (evidence: `Controllers/Module03/PhieuDatBanController.cs`)
- Administrator → Reservation endpoints: reviews reservations (evidence: `Controllers/Module03/PhieuDatBanController.cs`)
- Reservation endpoints → Reservation service: submits reservation actions (evidence: `Controllers/Module03/PhieuDatBanController.cs`)
- Reservation service → Reservation repository: checks and updates (evidence: `Service/Implement/PhieuDatBanService.cs`)
- Account repository → Application database: queries accounts (evidence: `Repository/AccountRepository.cs`)
- Customer repository → Application database: queries customers (evidence: `Repository/KhachHangRepository.cs`)
- Category repository → Application database: queries categories (evidence: `Repository/LoaiBanRepository.cs`)
- Dish repository → Application database: queries dishes
- Reservation repository → Application database: reads and writes reservations (evidence: `Repository/PhieuDatBanRepository.cs`)
- Application database → Accounts and customers: maps entities (evidence: `AppDbContext.cs`)
- Application database → Tables and categories: maps tables (evidence: `AppDbContext.cs`)
- Application database → Reservation records: maps reservations (evidence: `AppDbContext.cs`)
- Application database → Dish records: maps dishes (evidence: `AppDbContext.cs`)
