# eddijanus-lgtm/mes11 architecture

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

- Interactive diagram: https://gitdiagram.com/eddijanus-lgtm/mes11
- Repository: https://github.com/eddijanus-lgtm/mes11

## Overview

This is a manufacturing execution system (MES) with a React operations console and a NestJS backend. Users navigate dashboards and production-management pages; backend endpoints support orders and routing, machine and carrier management, alarms, notifications, shifts, traces, and materials. Shopfloor integrations exchange telemetry and control commands with OPC-UA and MQTT systems. The README documents a simulated three-station production run using the regular OPC-UA client and handshake. Several frontend-to-API links and unsampled subsystem internals are not evidenced in the excerpts, so they are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/App.jsx) (Route shell), [`src/opcua/shopfloor-gateway.controller.ts`](https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/shopfloor-gateway.controller.ts) (Gateway endpoints), [`src/orders/orders.controller.ts`](https://github.com/eddijanus-lgtm/mes11/blob/main/src/orders/orders.controller.ts) (Orders endpoints), [`src/dashboard/dashboard.controller.ts`](https://github.com/eddijanus-lgtm/mes11/blob/main/src/dashboard/dashboard.controller.ts) (Dashboard endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Operations console"]
  node_app["Route shell<br/>[App.jsx]"]
  node_dashboard_ui["Dashboard view<br/>[Dashboard.jsx]"]
  node_machines_ui["Machines view<br/>[Machines.jsx]"]
  node_orders_ui["Orders view<br/>[Orders.jsx]"]
  node_shopfloor_ui["Shopfloor view<br/>[Shopfloor.jsx]"]
  node_notifications_ui["Notifications view<br/>[Notifications.jsx]"]
  node_auth_ui["Session provider<br/>[AuthProvider.jsx]"]
end

subgraph group_production["Production operations"]
  node_orders_api["Orders endpoints"]
  node_routing["Order routing<br/>[routing.service.ts]"]
  node_machines_api["Machine endpoints"]
  node_carriers_api["Carrier endpoints"]
  node_materials_api["Materials endpoints"]
end

subgraph group_insight["Monitoring and records"]
  node_dashboard_api["Dashboard endpoints"]
  node_dashboard_calc["KPI aggregation"]
  node_alarms_api["Alarm endpoints"]
  node_notifications_api["Notification endpoints"]
  node_notifications_logic["Alert and delivery logic"]
  node_traces["Trace records<br/>[traces.service.ts]"]
  node_shifts["Shift reporting<br/>[shifts.service.ts]"]
end

subgraph group_integration["Shopfloor integration"]
  node_gateway_api["Gateway endpoints"]
  node_opcua["OPC-UA client<br/>[opcua.service.ts]"]
  node_mqtt["MQTT gateway"]
  node_handshake["stMES handshake"]
end

subgraph group_identity["Identity and access"]
  node_users[("User accounts<br/>[user.entity.ts]")]
  node_auth_api["Authentication endpoints<br/>[auth.controller.ts]"]
  node_auth_logic["Authentication service<br/>[auth.service.ts]"]
end

node_operator(("MES operator"))

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_dashboard_ui
node_app -->|"routes to"| node_machines_ui
node_app -->|"routes to"| node_orders_ui
node_app -->|"routes to"| node_shopfloor_ui
node_app -->|"routes to"| node_notifications_ui
node_app -->|"checks session"| node_auth_ui
node_operator -->|"requests"| node_orders_api
node_orders_api -->|"delegates route"| node_routing
node_operator -->|"requests"| node_machines_api
node_operator -->|"requests"| node_carriers_api
node_operator -->|"requests"| node_materials_api
node_operator -->|"requests"| node_dashboard_api
node_dashboard_api -->|"delegates metrics"| node_dashboard_calc
node_dashboard_calc -->|"reads order data"| node_orders_api
node_operator -->|"requests"| node_alarms_api
node_operator -->|"requests"| node_notifications_api
node_notifications_api -->|"delegates actions"| node_notifications_logic
node_notifications_logic -->|"uses gateway"| node_mqtt
node_operator -->|"requests"| node_traces
node_operator -->|"requests"| node_shifts
node_operator -->|"requests"| node_gateway_api
node_gateway_api -->|"reads and controls"| node_opcua
node_gateway_api -->|"publishes and reads"| node_mqtt
node_gateway_api -->|"queries handshakes"| node_handshake
node_operator -->|"authenticates"| node_auth_api
node_auth_api -->|"delegates auth"| node_auth_logic
node_auth_logic -->|"reads and updates"| node_users
node_app -->|"provides session"| node_auth_ui
node_gateway_api -->|"returns status"| node_operator
node_opcua -.->|"connects to simulator"| node_operator

click node_app "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/App.jsx"
click node_dashboard_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Dashboard.jsx"
click node_machines_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Machines.jsx"
click node_orders_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Orders.jsx"
click node_shopfloor_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Shopfloor.jsx"
click node_notifications_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Notifications.jsx"
click node_auth_ui "https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/providers/AuthProvider.jsx"
click node_orders_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/orders/orders.controller.ts"
click node_routing "https://github.com/eddijanus-lgtm/mes11/blob/main/src/orders/routing.service.ts"
click node_machines_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/machines/machines.controller.ts"
click node_carriers_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/carriers/carriers.controller.ts"
click node_materials_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/materials/materials.controller.ts"
click node_dashboard_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/dashboard/dashboard.controller.ts"
click node_dashboard_calc "https://github.com/eddijanus-lgtm/mes11/blob/main/src/dashboard/dashboard.service.ts"
click node_alarms_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/alarms/alarms.controller.ts"
click node_notifications_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/notifications/notifications.controller.ts"
click node_notifications_logic "https://github.com/eddijanus-lgtm/mes11/blob/main/src/notifications/notifications.service.ts"
click node_traces "https://github.com/eddijanus-lgtm/mes11/blob/main/src/traces/traces.service.ts"
click node_shifts "https://github.com/eddijanus-lgtm/mes11/blob/main/src/shifts/shifts.service.ts"
click node_gateway_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/shopfloor-gateway.controller.ts"
click node_opcua "https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/opcua.service.ts"
click node_mqtt "https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/mqtt-gateway.service.ts"
click node_handshake "https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/stmes-handshake.service.ts"
click node_users "https://github.com/eddijanus-lgtm/mes11/blob/main/src/users/user.entity.ts"
click node_auth_api "https://github.com/eddijanus-lgtm/mes11/blob/main/src/auth/auth.controller.ts"
click node_auth_logic "https://github.com/eddijanus-lgtm/mes11/blob/main/src/auth/auth.service.ts"

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_app,node_dashboard_ui,node_machines_ui,node_orders_ui,node_shopfloor_ui,node_notifications_ui,node_auth_ui toneBlue
class node_orders_api,node_routing,node_machines_api,node_carriers_api,node_materials_api toneAmber
class node_dashboard_api,node_dashboard_calc,node_alarms_api,node_notifications_api,node_notifications_logic,node_traces,node_shifts toneMint
class node_gateway_api,node_opcua,node_mqtt,node_handshake toneRose
class node_users,node_auth_api,node_auth_logic,node_operator toneIndigo
```

## Components

### Operations console

- [Route shell](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard view](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Machines view](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Machines.jsx): `frontend/src/pages/Machines.jsx`
- [Orders view](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Orders.jsx): `frontend/src/pages/Orders.jsx`
- [Shopfloor view](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Shopfloor.jsx): `frontend/src/pages/Shopfloor.jsx`
- [Notifications view](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/pages/Notifications.jsx): `frontend/src/pages/Notifications.jsx`
- [Session provider](https://github.com/eddijanus-lgtm/mes11/blob/main/frontend/src/providers/AuthProvider.jsx): `frontend/src/providers/AuthProvider.jsx`

### Production operations

- [Orders endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/orders/orders.controller.ts): `src/orders/orders.controller.ts`
- [Order routing](https://github.com/eddijanus-lgtm/mes11/blob/main/src/orders/routing.service.ts): `src/orders/routing.service.ts`
- [Machine endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/machines/machines.controller.ts): `src/machines/machines.controller.ts`
- [Carrier endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/carriers/carriers.controller.ts): `src/carriers/carriers.controller.ts`
- [Materials endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/materials/materials.controller.ts): `src/materials/materials.controller.ts`

### Monitoring and records

- [Dashboard endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/dashboard/dashboard.controller.ts): `src/dashboard/dashboard.controller.ts`
- [KPI aggregation](https://github.com/eddijanus-lgtm/mes11/blob/main/src/dashboard/dashboard.service.ts): `src/dashboard/dashboard.service.ts`
- [Alarm endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/alarms/alarms.controller.ts): `src/alarms/alarms.controller.ts`
- [Notification endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/notifications/notifications.controller.ts): `src/notifications/notifications.controller.ts`
- [Alert and delivery logic](https://github.com/eddijanus-lgtm/mes11/blob/main/src/notifications/notifications.service.ts): `src/notifications/notifications.service.ts`
- [Trace records](https://github.com/eddijanus-lgtm/mes11/blob/main/src/traces/traces.service.ts): `src/traces/traces.service.ts`
- [Shift reporting](https://github.com/eddijanus-lgtm/mes11/blob/main/src/shifts/shifts.service.ts): `src/shifts/shifts.service.ts`

### Shopfloor integration

- [Gateway endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/shopfloor-gateway.controller.ts): `src/opcua/shopfloor-gateway.controller.ts`
- [OPC-UA client](https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/opcua.service.ts): `src/opcua/opcua.service.ts`
- [MQTT gateway](https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/mqtt-gateway.service.ts): `src/opcua/mqtt-gateway.service.ts`
- [stMES handshake](https://github.com/eddijanus-lgtm/mes11/blob/main/src/opcua/stmes-handshake.service.ts): `src/opcua/stmes-handshake.service.ts`

### Identity and access

- [User accounts](https://github.com/eddijanus-lgtm/mes11/blob/main/src/users/user.entity.ts): `src/users/user.entity.ts`
- [Authentication endpoints](https://github.com/eddijanus-lgtm/mes11/blob/main/src/auth/auth.controller.ts): `src/auth/auth.controller.ts`
- [Authentication service](https://github.com/eddijanus-lgtm/mes11/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`

### Other components

- **MES operator**

## Connections

- MES operator → Route shell: uses (evidence: `frontend/src/App.jsx`)
- Route shell → Dashboard view: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Machines view: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Orders view: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Shopfloor view: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Notifications view: routes to (evidence: `frontend/src/App.jsx`)
- Route shell → Session provider: checks session (evidence: `frontend/src/App.jsx`)
- MES operator → Orders endpoints: requests (evidence: `src/orders/orders.controller.ts`)
- Orders endpoints → Order routing: delegates route (evidence: `src/orders/orders.controller.ts`)
- MES operator → Machine endpoints: requests (evidence: `src/machines/machines.controller.ts`)
- MES operator → Carrier endpoints: requests (evidence: `src/carriers/carriers.controller.ts`)
- MES operator → Materials endpoints: requests (evidence: `src/materials/materials.controller.ts`)
- MES operator → Dashboard endpoints: requests (evidence: `src/dashboard/dashboard.controller.ts`)
- Dashboard endpoints → KPI aggregation: delegates metrics (evidence: `src/dashboard/dashboard.controller.ts`)
- KPI aggregation → Orders endpoints: reads order data (evidence: `src/dashboard/dashboard.service.ts`)
- MES operator → Alarm endpoints: requests (evidence: `src/alarms/alarms.controller.ts`)
- MES operator → Notification endpoints: requests (evidence: `src/notifications/notifications.controller.ts`)
- Notification endpoints → Alert and delivery logic: delegates actions (evidence: `src/notifications/notifications.controller.ts`)
- Alert and delivery logic → MQTT gateway: uses gateway (evidence: `src/notifications/notifications.service.ts`)
- MES operator → Trace records: requests
- MES operator → Shift reporting: requests
- MES operator → Gateway endpoints: requests (evidence: `src/opcua/shopfloor-gateway.controller.ts`)
- Gateway endpoints → OPC-UA client: reads and controls (evidence: `src/opcua/shopfloor-gateway.controller.ts`)
- Gateway endpoints → MQTT gateway: publishes and reads (evidence: `src/opcua/shopfloor-gateway.controller.ts`)
- Gateway endpoints → stMES handshake: queries handshakes (evidence: `src/opcua/shopfloor-gateway.controller.ts`)
- MES operator → Authentication endpoints: authenticates (evidence: `src/auth/auth.controller.ts`)
- Authentication endpoints → Authentication service: delegates auth (evidence: `src/auth/auth.controller.ts`)
- Authentication service → User accounts: reads and updates (evidence: `src/auth/auth.service.ts`)
- Route shell → Session provider: provides session (evidence: `frontend/src/main.jsx`)
- Gateway endpoints → MES operator: returns status (evidence: `src/opcua/shopfloor-gateway.controller.ts`)
- OPC-UA client → MES operator: connects to simulator
