# hai21225/restaurantfoodmanagersystem architecture

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

## Overview

Restaurant Food Manager is a browser-based restaurant operations system with an ASP.NET Core API and SQL Server persistence. Staff use the frontend to sign in and operate POS orders, kitchen tickets, cashier payments, inventory and purchasing, reports, catalog/recipes, tables, and staff administration. Those workflows pass through API controllers into application services and shared business rules, with operational state persisted in the database; MoMo is documented as mock-only. The graph follows documented capabilities and indexed controller/service references; unsampled frontend and backend links are shown only where the README supports them.

Main entry points: [`RestaurantFoodManagerSystem/Api/Controllers`](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Api/Controllers) (API controllers), [`RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs) (POS orders), [`RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.cs`](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.cs) (SQL Server data), [`RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs`](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs) (Kitchen tickets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Staff interface"]
  node_frontend["Operations screens"]
end

subgraph group_api["API and identity"]
  node_controllers["API controllers"]
  node_auth["Authentication<br/>[AuthService.cs]"]
end

subgraph group_service["Restaurant operations"]
  node_users["Staff and roles<br/>[UserService.cs]"]
  node_catalog["Food catalog"]
  node_orders["POS orders<br/>[OrderService.cs]"]
  node_kitchen["Kitchen tickets<br/>[KitchenService.cs]"]
  node_payments["Payments<br/>[PaymentService.cs]"]
  node_inventory["Inventory"]
  node_purchasing["Purchasing"]
  node_recipes["Recipes<br/>[RecipeService.cs]"]
  node_promotions["Promotions"]
  node_tables["Tables and areas"]
  node_settings["Restaurant settings"]
  node_reports["Reports<br/>[ReportService.cs]"]
end

subgraph group_domain["Business rules"]
  node_common_rules["Shared workflow rules"]
  node_order_entities["Order records"]
  node_stock_entities["Stock records"]
end

subgraph group_storage["Persistence"]
  node_database[("SQL Server data<br/>[AppDbContext.cs]")]
end

node_staff(("Restaurant staff"))
node_payment_provider["Mock MoMo"]

node_staff -->|"uses"| node_frontend
node_frontend -->|"calls API"| node_controllers
node_controllers -->|"delegates to"| node_auth
node_controllers -->|"delegates to"| node_users
node_controllers -->|"delegates to"| node_catalog
node_controllers -->|"delegates to"| node_orders
node_controllers -->|"delegates to"| node_payments
node_controllers -->|"delegates to"| node_inventory
node_controllers -->|"delegates to"| node_purchasing
node_controllers -->|"delegates to"| node_settings
node_controllers -->|"delegates to"| node_promotions
node_orders -->|"uses rules"| node_common_rules
node_orders -->|"reads settings"| node_settings
node_orders -->|"updates"| node_order_entities
node_kitchen -->|"uses rules"| node_common_rules
node_kitchen -->|"updates"| node_order_entities
node_payments -.->|"uses mock"| node_payment_provider
node_orders -->|"refreshes status"| node_tables
node_auth -->|"looks up account"| node_users
node_orders -->|"reads and writes"| node_database
node_kitchen -->|"reads and writes"| node_database
node_auth -->|"reads and writes"| node_database
node_users -->|"reads and writes"| node_database
node_database -->|"maps records"| node_stock_entities

click node_frontend "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/frontend/js/pages"
click node_controllers "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Api/Controllers"
click node_auth "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Auth/AuthService.cs"
click node_users "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/User/UserService.cs"
click node_catalog "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Food"
click node_orders "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs"
click node_kitchen "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs"
click node_payments "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Payment/PaymentService.cs"
click node_inventory "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Inventory"
click node_purchasing "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Suplier"
click node_recipes "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Recipe/RecipeService.cs"
click node_promotions "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Promotion/PromotionService.cs"
click node_tables "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Restaurant/RestaurantTableService.cs"
click node_settings "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Settings/RestaurantSettingsService.cs"
click node_reports "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Report/ReportService.cs"
click node_common_rules "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Common"
click node_order_entities "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Domain/Entity/Order"
click node_stock_entities "https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Domain/Entity/Recipe_Inventory"
click node_database "https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.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_frontend toneBlue
class node_controllers,node_auth toneAmber
class node_users,node_catalog,node_orders,node_kitchen,node_payments,node_inventory,node_purchasing,node_recipes,node_promotions,node_tables,node_settings,node_reports toneMint
class node_common_rules,node_order_entities,node_stock_entities toneRose
class node_database,node_staff,node_payment_provider toneIndigo
```

## Components

### Staff interface

- [Operations screens](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/frontend/js/pages): `frontend/js/pages`

### API and identity

- [API controllers](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Api/Controllers): `RestaurantFoodManagerSystem/Api/Controllers`
- [Authentication](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Auth/AuthService.cs): `RestaurantFoodManagerSystem/Application/Services/Auth/AuthService.cs`

### Restaurant operations

- [Staff and roles](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/User/UserService.cs): `RestaurantFoodManagerSystem/Application/Services/User/UserService.cs`
- [Food catalog](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Food): `RestaurantFoodManagerSystem/Application/Services/Food`
- [POS orders](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs): `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`
- [Kitchen tickets](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs): `RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs`
- [Payments](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Payment/PaymentService.cs): `RestaurantFoodManagerSystem/Application/Services/Payment/PaymentService.cs`
- [Inventory](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Inventory): `RestaurantFoodManagerSystem/Application/Services/Inventory`
- [Purchasing](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Services/Suplier): `RestaurantFoodManagerSystem/Application/Services/Suplier`
- [Recipes](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Recipe/RecipeService.cs): `RestaurantFoodManagerSystem/Application/Services/Recipe/RecipeService.cs`
- [Promotions](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Promotion/PromotionService.cs): `RestaurantFoodManagerSystem/Application/Services/Promotion/PromotionService.cs`
- [Tables and areas](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Restaurant/RestaurantTableService.cs): `RestaurantFoodManagerSystem/Application/Services/Restaurant/RestaurantTableService.cs`
- [Restaurant settings](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Settings/RestaurantSettingsService.cs): `RestaurantFoodManagerSystem/Application/Services/Settings/RestaurantSettingsService.cs`
- [Reports](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Application/Services/Report/ReportService.cs): `RestaurantFoodManagerSystem/Application/Services/Report/ReportService.cs`

### Business rules

- [Shared workflow rules](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Application/Common): `RestaurantFoodManagerSystem/Application/Common`
- [Order records](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Domain/Entity/Order): `RestaurantFoodManagerSystem/Domain/Entity/Order`
- [Stock records](https://github.com/hai21225/restaurantfoodmanagersystem/tree/main/RestaurantFoodManagerSystem/Domain/Entity/Recipe_Inventory): `RestaurantFoodManagerSystem/Domain/Entity/Recipe_Inventory`

### Persistence

- [SQL Server data](https://github.com/hai21225/restaurantfoodmanagersystem/blob/main/RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.cs): `RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.cs`

### Other components

- **Restaurant staff**
- **Mock MoMo**

## Connections

- Restaurant staff → Operations screens: uses (evidence: `README.md`)
- Operations screens → API controllers: calls API (evidence: `README.md`)
- API controllers → Authentication: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Users/UsersController.cs`)
- API controllers → Staff and roles: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Users/UsersController.cs`)
- API controllers → Food catalog: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Food/FoodsController.cs`)
- API controllers → POS orders: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Order/OrdersController.cs`)
- API controllers → Payments: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Payment/PaymentsController.cs`)
- API controllers → Inventory: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Management/ManagementController.cs`)
- API controllers → Purchasing: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Management/ManagementController.cs`)
- API controllers → Restaurant settings: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Management/ManagementController.cs`)
- API controllers → Promotions: delegates to (evidence: `RestaurantFoodManagerSystem/Api/Controllers/Management/ManagementController.cs`)
- POS orders → Shared workflow rules: uses rules (evidence: `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`)
- POS orders → Restaurant settings: reads settings (evidence: `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`)
- POS orders → Order records: updates (evidence: `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`)
- Kitchen tickets → Shared workflow rules: uses rules (evidence: `RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs`)
- Kitchen tickets → Order records: updates (evidence: `RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs`)
- Payments → Mock MoMo: uses mock (evidence: `README.md`)
- POS orders → Tables and areas: refreshes status (evidence: `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`)
- Authentication → Staff and roles: looks up account (evidence: `RestaurantFoodManagerSystem/Application/Services/Auth/AuthService.cs`)
- POS orders → SQL Server data: reads and writes (evidence: `RestaurantFoodManagerSystem/Application/Services/Order/OrderService.cs`)
- Kitchen tickets → SQL Server data: reads and writes (evidence: `RestaurantFoodManagerSystem/Application/Services/Kitchen/KitchenService.cs`)
- Authentication → SQL Server data: reads and writes (evidence: `RestaurantFoodManagerSystem/Application/Services/Auth/AuthService.cs`)
- Staff and roles → SQL Server data: reads and writes (evidence: `RestaurantFoodManagerSystem/Application/Services/User/UserService.cs`)
- SQL Server data → Stock records: maps records (evidence: `RestaurantFoodManagerSystem/Infrastructure/Persistence/AppDbContext.cs`)
