# aldo123/eesoftware architecture

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

- Interactive diagram: https://gitdiagram.com/aldo123/eesoftware
- Repository: https://github.com/aldo123/eesoftware

## Overview

WIK Interlock & Traceability is a manufacturing application for operator access, configurable production pages, traceability, PLC/device interaction, inspection, and process-capability analysis. The main user workflow is login into the operator workspace, where configured pages and tools interact with backend APIs and production data. Automation and inspection form separate runtime branches. The README describes a FastAPI login/configuration app, while the supplied tree and source show a broader Flask application; this map follows the available tree and sampled source, so some unsampled route wiring is intentionally omitted.

Main entry points: [`backend/main.py`](https://github.com/aldo123/eesoftware/blob/main/backend/main.py) (Flask application), [`backend/routes/specification_engine.py`](https://github.com/aldo123/eesoftware/blob/main/backend/routes/specification_engine.py) (Specification runtime), [`backend/vision/routes.py`](https://github.com/aldo123/eesoftware/blob/main/backend/vision/routes.py) (Vision endpoints), [`frontend-updated/frontend/src/App.jsx`](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/App.jsx) (React app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Operator interface"]
  node_app["React app<br/>[App.jsx]"]
  node_login["Login screen<br/>[LoginPage.jsx]"]
  node_workspace["Main workspace<br/>[MainPage.jsx]"]
  node_page["Dynamic pages<br/>[DynamicCPPage.jsx]"]
  node_widgets["Production widgets<br/>[index.js]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Application API"]
  node_backend["Flask application<br/>[main.py]"]
  node_interlock["Interlock settings<br/>[interlock.py]"]
  node_page_config["Page configuration<br/>[page_config.py]"]
  node_internal_vars["Internal variables"]
  node_spec_routes["Specifications<br/>[specification.py]"]
  node_logic_config["Logic configuration<br/>[logic_config.py]"]
  node_cpk["Capability analysis<br/>[cpk_engine.py]"]
end

subgraph group_automation["Production runtime"]
  node_spec_engine["Specification runtime"]
  node_logic_engine["Logic execution<br/>[logic_engine.py]"]
end

subgraph group_data["Data and devices"]
  node_db_manager["DB manager<br/>[db_manager.py]"]
  node_database["MySQL access<br/>[database.py]"]
  node_tcp["TCP PLC<br/>[tcp_ip.py]"]
  node_serial["RS232 devices<br/>[rs232.py]"]
end

subgraph group_vision["Vision inspection"]
  node_vision_routes["Vision endpoints<br/>[routes.py]"]
  node_capture["Camera workers<br/>[capture_worker.py]"]
  node_camera["Camera handling<br/>[camera_engine.py]"]
  node_inspection["Inspection methods"]
  node_live_status["Count status<br/>[live_status.py]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_app
node_app -->|"shows"| node_login
node_app -->|"shows after login"| node_workspace
node_workspace -->|"opens"| node_page
node_page -->|"renders"| node_widgets
node_login -->|"requests login"| node_api_client
node_workspace -->|"requests data"| node_api_client
node_api_client -->|"HTTP requests"| node_backend
node_backend -->|"uses"| node_db_manager
node_db_manager -->|"delegates queries"| node_database
node_backend -->|"registers routes"| node_interlock
node_backend -->|"registers routes"| node_page_config
node_backend -->|"registers routes"| node_internal_vars
node_backend -->|"registers routes"| node_spec_routes
node_spec_routes -->|"runs specifications"| node_spec_engine
node_spec_engine -->|"reads PLC"| node_tcp
node_spec_engine -->|"reads serial data"| node_serial
node_spec_engine -->|"reads variables"| node_internal_vars
node_backend -->|"registers routes"| node_logic_config
node_logic_config -->|"configures runtime"| node_logic_engine
node_logic_engine -->|"reads variables"| node_internal_vars
node_backend -->|"exposes analysis"| node_cpk
node_backend -->|"registers routes"| node_vision_routes
node_vision_routes -->|"starts and streams"| node_capture
node_capture -->|"opens camera"| node_camera
node_vision_routes -->|"reads raw frames"| node_camera
node_vision_routes -->|"reads status"| node_live_status
node_capture -.->|"inspection support"| node_inspection

click node_app "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/App.jsx"
click node_login "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/LoginPage.jsx"
click node_workspace "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/MainPage.jsx"
click node_page "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/pages/DynamicCPPage.jsx"
click node_widgets "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/widgets/index.js"
click node_api_client "https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/service/api.js"
click node_backend "https://github.com/aldo123/eesoftware/blob/main/backend/main.py"
click node_db_manager "https://github.com/aldo123/eesoftware/blob/main/backend/db_manager.py"
click node_database "https://github.com/aldo123/eesoftware/blob/main/backend/database.py"
click node_interlock "https://github.com/aldo123/eesoftware/blob/main/backend/routes/interlock.py"
click node_page_config "https://github.com/aldo123/eesoftware/blob/main/backend/routes/page_config.py"
click node_internal_vars "https://github.com/aldo123/eesoftware/blob/main/backend/routes/internal_variable.py"
click node_spec_routes "https://github.com/aldo123/eesoftware/blob/main/backend/routes/specification.py"
click node_spec_engine "https://github.com/aldo123/eesoftware/blob/main/backend/routes/specification_engine.py"
click node_logic_config "https://github.com/aldo123/eesoftware/blob/main/backend/logic_builder/logic_config.py"
click node_logic_engine "https://github.com/aldo123/eesoftware/blob/main/backend/logic_builder/logic_engine.py"
click node_tcp "https://github.com/aldo123/eesoftware/blob/main/backend/tcp_ip.py"
click node_serial "https://github.com/aldo123/eesoftware/blob/main/backend/rs232.py"
click node_cpk "https://github.com/aldo123/eesoftware/blob/main/backend/cpk_engine.py"
click node_vision_routes "https://github.com/aldo123/eesoftware/blob/main/backend/vision/routes.py"
click node_capture "https://github.com/aldo123/eesoftware/blob/main/backend/vision/capture_worker.py"
click node_camera "https://github.com/aldo123/eesoftware/blob/main/backend/vision/camera_engine.py"
click node_inspection "https://github.com/aldo123/eesoftware/blob/main/backend/vision/inspection_methods.py"
click node_live_status "https://github.com/aldo123/eesoftware/blob/main/backend/vision/live_status.py"

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_login,node_workspace,node_page,node_widgets,node_api_client toneBlue
class node_backend,node_interlock,node_page_config,node_internal_vars,node_spec_routes,node_logic_config,node_cpk toneAmber
class node_spec_engine,node_logic_engine toneMint
class node_db_manager,node_database,node_tcp,node_serial toneRose
class node_vision_routes,node_capture,node_camera,node_inspection,node_live_status,node_operator toneIndigo
```

## Components

### Operator interface

- [React app](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/App.jsx): `frontend-updated/frontend/src/App.jsx`
- [Login screen](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/LoginPage.jsx): `frontend-updated/frontend/src/LoginPage.jsx`
- [Main workspace](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/MainPage.jsx): `frontend-updated/frontend/src/MainPage.jsx`
- [Dynamic pages](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/pages/DynamicCPPage.jsx): `frontend-updated/frontend/src/pages/DynamicCPPage.jsx`
- [Production widgets](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/widgets/index.js): `frontend-updated/frontend/src/widgets/index.js`
- [API client](https://github.com/aldo123/eesoftware/blob/main/frontend-updated/frontend/src/service/api.js): `frontend-updated/frontend/src/service/api.js`

### Application API

- [Flask application](https://github.com/aldo123/eesoftware/blob/main/backend/main.py): `backend/main.py`
- [Interlock settings](https://github.com/aldo123/eesoftware/blob/main/backend/routes/interlock.py): `backend/routes/interlock.py`
- [Page configuration](https://github.com/aldo123/eesoftware/blob/main/backend/routes/page_config.py): `backend/routes/page_config.py`
- [Internal variables](https://github.com/aldo123/eesoftware/blob/main/backend/routes/internal_variable.py): `backend/routes/internal_variable.py`
- [Specifications](https://github.com/aldo123/eesoftware/blob/main/backend/routes/specification.py): `backend/routes/specification.py`
- [Logic configuration](https://github.com/aldo123/eesoftware/blob/main/backend/logic_builder/logic_config.py): `backend/logic_builder/logic_config.py`
- [Capability analysis](https://github.com/aldo123/eesoftware/blob/main/backend/cpk_engine.py): `backend/cpk_engine.py`

### Production runtime

- [Specification runtime](https://github.com/aldo123/eesoftware/blob/main/backend/routes/specification_engine.py): `backend/routes/specification_engine.py`
- [Logic execution](https://github.com/aldo123/eesoftware/blob/main/backend/logic_builder/logic_engine.py): `backend/logic_builder/logic_engine.py`

### Data and devices

- [DB manager](https://github.com/aldo123/eesoftware/blob/main/backend/db_manager.py): `backend/db_manager.py`
- [MySQL access](https://github.com/aldo123/eesoftware/blob/main/backend/database.py): `backend/database.py`
- [TCP PLC](https://github.com/aldo123/eesoftware/blob/main/backend/tcp_ip.py): `backend/tcp_ip.py`
- [RS232 devices](https://github.com/aldo123/eesoftware/blob/main/backend/rs232.py): `backend/rs232.py`

### Vision inspection

- [Vision endpoints](https://github.com/aldo123/eesoftware/blob/main/backend/vision/routes.py): `backend/vision/routes.py`
- [Camera workers](https://github.com/aldo123/eesoftware/blob/main/backend/vision/capture_worker.py): `backend/vision/capture_worker.py`
- [Camera handling](https://github.com/aldo123/eesoftware/blob/main/backend/vision/camera_engine.py): `backend/vision/camera_engine.py`
- [Inspection methods](https://github.com/aldo123/eesoftware/blob/main/backend/vision/inspection_methods.py): `backend/vision/inspection_methods.py`
- [Count status](https://github.com/aldo123/eesoftware/blob/main/backend/vision/live_status.py): `backend/vision/live_status.py`

### Other components

- **Operator**

## Connections

- Operator → React app: uses
- React app → Login screen: shows
- React app → Main workspace: shows after login
- Main workspace → Dynamic pages: opens
- Dynamic pages → Production widgets: renders
- Login screen → API client: requests login
- Main workspace → API client: requests data
- API client → Flask application: HTTP requests
- Flask application → DB manager: uses
- DB manager → MySQL access: delegates queries
- Flask application → Interlock settings: registers routes
- Flask application → Page configuration: registers routes
- Flask application → Internal variables: registers routes
- Flask application → Specifications: registers routes
- Specifications → Specification runtime: runs specifications
- Specification runtime → TCP PLC: reads PLC
- Specification runtime → RS232 devices: reads serial data
- Specification runtime → Internal variables: reads variables
- Flask application → Logic configuration: registers routes
- Logic configuration → Logic execution: configures runtime
- Logic execution → Internal variables: reads variables
- Flask application → Capability analysis: exposes analysis
- Flask application → Vision endpoints: registers routes
- Vision endpoints → Camera workers: starts and streams
- Camera workers → Camera handling: opens camera
- Vision endpoints → Camera handling: reads raw frames
- Vision endpoints → Count status: reads status
- Camera workers → Inspection methods: inspection support
