# baitianbt/mes architecture

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

- Interactive diagram: https://gitdiagram.com/baitianbt/mes
- Repository: https://github.com/baitianbt/mes

## Overview

This is a Vue/.NET MES for manufacturing administration and shop-floor execution. The principal workflow is a user managing product and process definitions, planning work orders, recording barcode/operation execution, and viewing production status. Identity, organization, BOM/material, scheduling, traceability, monitoring, dashboard, and notifications are distinct capabilities. The sampled controllers and services establish several calls; the README documents the broader REST/WebSocket product design. Many domain-specific service and UI connections are unsampled, so those relationships are not asserted.

Main entry points: [`MES_WEB/src/App.vue`](https://github.com/baitianbt/mes/blob/master/MES_WEB/src/App.vue) (Vue application), [`MES.API/MES.API/Controllers/Process`](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Process) (Production API), [`MES.API/MES.Infrastructure.Data/Repositories`](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Infrastructure.Data/Repositories) (Repositories), [`MES.API/MES.API/Controllers/Identity`](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Identity) (Identity API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_vue["Vue application<br/>[App.vue]"]
end

subgraph group_api["API surface"]
  node_identity_api["Identity API<br/>[Identity]"]
  node_org_api["Organization API<br/>[Organization]"]
  node_product_api["Product API<br/>[Product]"]
  node_process_api["Production API<br/>[Process]"]
end

subgraph group_domain["Manufacturing domains"]
  node_identity["Identity and access<br/>[Identity]"]
  node_organization["Factory structure<br/>[Organization]"]
  node_product["Products and BOM<br/>[Product]"]
  node_process["Process routes<br/>[Process.cs]"]
  node_planning["Plans and work orders"]
  node_execution["Shop-floor execution<br/>[Process]"]
  node_monitoring["Trace and monitoring<br/>[Process]"]
end

subgraph group_application["Application services"]
  node_auth_service["Authentication service<br/>[AuthService.cs]"]
  node_workstation_service["Workstation service"]
  node_route_service["Route service"]
  node_production_services["Production services<br/>[Process]"]
  node_bom_service["BOM service<br/>[BOMService.cs]"]
end

subgraph group_data["Persistence and realtime"]
  node_repositories["Repositories<br/>[Repositories]"]
  node_mes_db[("MES database<br/>[MESDbContext.cs]")]
  node_notification["SignalR notifications"]
end

node_operator(("MES user"))
node_erp_wms{{"ERP / WMS / PLM"}}

node_operator -->|"uses"| node_vue
node_vue -->|"REST requests"| node_identity_api
node_vue -->|"REST requests"| node_org_api
node_vue -->|"REST requests"| node_product_api
node_vue -->|"REST requests"| node_process_api
node_identity_api -.->|"invokes"| node_auth_service
node_auth_service -->|"loads roles"| node_identity
node_org_api -->|"invokes"| node_workstation_service
node_workstation_service -->|"uses repositories"| node_repositories
node_product_api -.->|"invokes"| node_bom_service
node_bom_service -->|"uses repositories"| node_repositories
node_process_api -.->|"invokes"| node_route_service
node_route_service -->|"uses repositories"| node_repositories
node_process_api -->|"invokes"| node_production_services
node_repositories -->|"queries and persists"| node_mes_db
node_process_api -.->|"serves status"| node_monitoring
node_vue -.->|"realtime updates"| node_notification
node_erp_wms -.->|"integration"| node_process_api

click node_vue "https://github.com/baitianbt/mes/blob/master/MES_WEB/src/App.vue"
click node_identity_api "https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Identity"
click node_org_api "https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Organization"
click node_product_api "https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Product"
click node_process_api "https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Process"
click node_identity "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Identity"
click node_organization "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Organization"
click node_product "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Product"
click node_process "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Domain/Entities/Process/Process.cs"
click node_planning "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Domain/Entities/Process/WorkOrderRouting.cs"
click node_execution "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Process"
click node_monitoring "https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Process"
click node_auth_service "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Identity/AuthService.cs"
click node_workstation_service "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Organization/WorkStationService.cs"
click node_route_service "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Process/ProcessRouteService.cs"
click node_production_services "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Application/Services/Process"
click node_bom_service "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Product/BOMService.cs"
click node_repositories "https://github.com/baitianbt/mes/tree/master/MES.API/MES.Infrastructure.Data/Repositories"
click node_mes_db "https://github.com/baitianbt/mes/blob/master/MES.API/MES.Infrastructure.Data/Context/MESDbContext.cs"
click node_notification "https://github.com/baitianbt/mes/blob/master/MES.API/MES.API/Services/SignalRNotificationService.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_vue,node_operator toneBlue
class node_identity_api,node_org_api,node_product_api,node_process_api toneAmber
class node_identity,node_organization,node_product,node_process,node_planning,node_execution,node_monitoring toneMint
class node_auth_service,node_workstation_service,node_route_service,node_production_services,node_bom_service toneRose
class node_repositories,node_mes_db,node_notification,node_erp_wms toneIndigo
```

## Components

### Web client

- [Vue application](https://github.com/baitianbt/mes/blob/master/MES_WEB/src/App.vue): `MES_WEB/src/App.vue`

### API surface

- [Identity API](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Identity): `MES.API/MES.API/Controllers/Identity`
- [Organization API](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Organization): `MES.API/MES.API/Controllers/Organization`
- [Product API](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Product): `MES.API/MES.API/Controllers/Product`
- [Production API](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Process): `MES.API/MES.API/Controllers/Process`

### Manufacturing domains

- [Identity and access](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Identity): `MES.API/MES.Domain/Entities/Identity`
- [Factory structure](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Organization): `MES.API/MES.Domain/Entities/Organization`
- [Products and BOM](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Product): `MES.API/MES.Domain/Entities/Product`
- [Process routes](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Domain/Entities/Process/Process.cs): `MES.API/MES.Domain/Entities/Process/Process.cs`
- [Plans and work orders](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Domain/Entities/Process/WorkOrderRouting.cs): `MES.API/MES.Domain/Entities/Process/WorkOrderRouting.cs`
- [Shop-floor execution](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Domain/Entities/Process): `MES.API/MES.Domain/Entities/Process`
- [Trace and monitoring](https://github.com/baitianbt/mes/tree/master/MES.API/MES.API/Controllers/Process): `MES.API/MES.API/Controllers/Process`

### Application services

- [Authentication service](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Identity/AuthService.cs): `MES.API/MES.Application/Services/Identity/AuthService.cs`
- [Workstation service](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Organization/WorkStationService.cs): `MES.API/MES.Application/Services/Organization/WorkStationService.cs`
- [Route service](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Process/ProcessRouteService.cs): `MES.API/MES.Application/Services/Process/ProcessRouteService.cs`
- [Production services](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Application/Services/Process): `MES.API/MES.Application/Services/Process`
- [BOM service](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Application/Services/Product/BOMService.cs): `MES.API/MES.Application/Services/Product/BOMService.cs`

### Persistence and realtime

- [Repositories](https://github.com/baitianbt/mes/tree/master/MES.API/MES.Infrastructure.Data/Repositories): `MES.API/MES.Infrastructure.Data/Repositories`
- [MES database](https://github.com/baitianbt/mes/blob/master/MES.API/MES.Infrastructure.Data/Context/MESDbContext.cs): `MES.API/MES.Infrastructure.Data/Context/MESDbContext.cs`
- [SignalR notifications](https://github.com/baitianbt/mes/blob/master/MES.API/MES.API/Services/SignalRNotificationService.cs): `MES.API/MES.API/Services/SignalRNotificationService.cs`

### Other components

- **MES user**
- **ERP / WMS / PLM**

## Connections

- MES user → Vue application: uses
- Vue application → Identity API: REST requests
- Vue application → Organization API: REST requests
- Vue application → Product API: REST requests
- Vue application → Production API: REST requests
- Identity API → Authentication service: invokes
- Authentication service → Identity and access: loads roles (evidence: `MES.API/MES.Application/Services/Identity/AuthService.cs`)
- Organization API → Workstation service: invokes (evidence: `MES.API/MES.API/Controllers/Organization/WorkStationController.cs`)
- Workstation service → Repositories: uses repositories (evidence: `MES.API/MES.Application/Services/Organization/WorkStationService.cs`)
- Product API → BOM service: invokes
- BOM service → Repositories: uses repositories (evidence: `MES.API/MES.Application/Services/Product/BOMService.cs`)
- Production API → Route service: invokes
- Route service → Repositories: uses repositories (evidence: `MES.API/MES.Application/Services/Process/ProcessRouteService.cs`)
- Production API → Production services: invokes (evidence: `MES.API/MES.API/Controllers/Process/ProductionExecutionController.cs`)
- Repositories → MES database: queries and persists (evidence: `MES.API/MES.Infrastructure.Data/Repositories/Organization/WorkStationRepository.cs`)
- Production API → Trace and monitoring: serves status
- Vue application → SignalR notifications: realtime updates
- ERP / WMS / PLM → Production API: integration
