# rezafaghani/industrial-energy-telemetry architecture

> Architecture diagram of the GitHub repository rezafaghani/industrial-energy-telemetry, 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/rezafaghani/industrial-energy-telemetry
- Repository: https://github.com/rezafaghani/industrial-energy-telemetry

## Overview

IETP simulates industrial energy assets as OPC UA servers, collects typed subscription data, processes and persists it through Kafka and PostgreSQL, then serves operational and historical views to a React dashboard. The graph also preserves the documented collector control plane, health/status reporting, and engineering observability. Most cross-service arrows reflect the README architecture; sampled worker excerpts confirm key implementations, while unsampled API, broadcaster, and UI details are shown only at documented capability level.

Main entry points: [`src/Telemetry.Processor/ProcessorWorker.cs`](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Processor/ProcessorWorker.cs) (Validation Processor), [`src/OpcUa.Client/OpcUaClientWorker.cs`](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Client/OpcUaClientWorker.cs) (OPC UA Collector), [`src/Telemetry.Inserter/InserterWorker.cs`](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Inserter/InserterWorker.cs) (Telemetry Inserter), [`src/Telemetry.Api/ApiEndpoints.cs`](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/ApiEndpoints.cs) (ASP.NET API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Asset Simulation"]
  node_energy_sim["Energy Simulation"]
  node_opc_server["OPC UA Server"]
  node_address_space["Energy Address Space"]
end

subgraph group_collection["OPC UA Collection"]
  node_opc_client["OPC UA Collector"]
  node_coordinator["Collector Coordinator"]
end

subgraph group_stream["Telemetry Pipeline"]
  node_raw_topic["Raw Telemetry"]
  node_processor["Validation Processor<br/>[ProcessorWorker.cs]"]
  node_validator["Telemetry Validator"]
  node_processed_topic["Processed Telemetry"]
  node_dead_letter["Dead Letters"]
  node_inserter["Telemetry Inserter<br/>[InserterWorker.cs]"]
  node_postgres[("PostgreSQL")]
end

subgraph group_operations["Operations API"]
  node_status_topic["Service Status"]
  node_api["ASP.NET API<br/>[ApiEndpoints.cs]"]
  node_live_broadcast["Live Broadcaster"]
  node_signalr["SignalR Hub<br/>[TelemetryHub.cs]"]
  node_observability["OpenTelemetry<br/>[Telemetry.cs]"]
end

subgraph group_experience["Operator Experience"]
  node_dashboard["Energy Dashboard<br/>[App.tsx]"]
end

node_operator(("Operator"))

node_energy_sim -->|"generates readings"| node_opc_server
node_opc_server -->|"hosts address space"| node_address_space
node_address_space -->|"serves measurements"| node_opc_client
node_opc_client -->|"publishes events"| node_raw_topic
node_opc_client -->|"requests assignments"| node_coordinator
node_raw_topic -->|"consumed by"| node_processor
node_processor -->|"validates events"| node_validator
node_processor -->|"publishes valid"| node_processed_topic
node_processor -->|"routes invalid"| node_dead_letter
node_processed_topic -->|"consumed by"| node_inserter
node_inserter -->|"persists idempotently"| node_postgres
node_postgres -->|"serves history"| node_api
node_api -->|"hosts coordination"| node_coordinator
node_opc_client -->|"reports health"| node_status_topic
node_processor -->|"publishes heartbeats"| node_status_topic
node_inserter -->|"publishes heartbeats"| node_status_topic
node_status_topic -->|"persists status"| node_inserter
node_api -->|"hosts broadcaster"| node_live_broadcast
node_live_broadcast -->|"broadcasts updates"| node_signalr
node_api -->|"serves HTTP data"| node_dashboard
node_signalr -->|"pushes live updates"| node_dashboard
node_operator -->|"uses"| node_dashboard
node_opc_client -->|"records telemetry"| node_observability
node_processor -->|"records metrics"| node_observability
node_inserter -->|"records metrics"| node_observability

click node_energy_sim "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Domain/Simulation/EnergySimulation.cs"
click node_opc_server "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Server/OpcUaServerWorker.cs"
click node_address_space "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Server/EnergyNodeManager.cs"
click node_opc_client "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Client/OpcUaClientWorker.cs"
click node_coordinator "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/CollectorCoordinator.cs"
click node_processor "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Processor/ProcessorWorker.cs"
click node_validator "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Domain/TelemetryValidator.cs"
click node_inserter "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Inserter/InserterWorker.cs"
click node_api "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/ApiEndpoints.cs"
click node_live_broadcast "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/LiveTelemetryBroadcaster.cs"
click node_signalr "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/TelemetryHub.cs"
click node_dashboard "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/frontend/src/App.tsx"
click node_observability "https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/BuildingBlocks/Telemetry.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_energy_sim,node_opc_server,node_address_space toneBlue
class node_opc_client,node_coordinator toneAmber
class node_raw_topic,node_processor,node_validator,node_processed_topic,node_dead_letter,node_inserter,node_postgres toneMint
class node_status_topic,node_api,node_live_broadcast,node_signalr,node_observability toneRose
class node_dashboard,node_operator toneIndigo
```

## Components

### Asset Simulation

- [Energy Simulation](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Domain/Simulation/EnergySimulation.cs): `src/Telemetry.Domain/Simulation/EnergySimulation.cs`
- [OPC UA Server](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Server/OpcUaServerWorker.cs): `src/OpcUa.Server/OpcUaServerWorker.cs`
- [Energy Address Space](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Server/EnergyNodeManager.cs): `src/OpcUa.Server/EnergyNodeManager.cs`

### OPC UA Collection

- [OPC UA Collector](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/OpcUa.Client/OpcUaClientWorker.cs): `src/OpcUa.Client/OpcUaClientWorker.cs`
- [Collector Coordinator](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/CollectorCoordinator.cs): `src/Telemetry.Api/CollectorCoordinator.cs`

### Telemetry Pipeline

- **Raw Telemetry**
- [Validation Processor](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Processor/ProcessorWorker.cs): `src/Telemetry.Processor/ProcessorWorker.cs`
- [Telemetry Validator](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Domain/TelemetryValidator.cs): `src/Telemetry.Domain/TelemetryValidator.cs`
- **Processed Telemetry**
- **Dead Letters**
- [Telemetry Inserter](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Inserter/InserterWorker.cs): `src/Telemetry.Inserter/InserterWorker.cs`
- **PostgreSQL**

### Operations API

- **Service Status**
- [ASP.NET API](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/ApiEndpoints.cs): `src/Telemetry.Api/ApiEndpoints.cs`
- [Live Broadcaster](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/LiveTelemetryBroadcaster.cs): `src/Telemetry.Api/LiveTelemetryBroadcaster.cs`
- [SignalR Hub](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/Telemetry.Api/TelemetryHub.cs): `src/Telemetry.Api/TelemetryHub.cs`
- [OpenTelemetry](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/src/BuildingBlocks/Telemetry.cs): `src/BuildingBlocks/Telemetry.cs`

### Operator Experience

- [Energy Dashboard](https://github.com/rezafaghani/industrial-energy-telemetry/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Other components

- **Operator**

## Connections

- Energy Simulation → OPC UA Server: generates readings (evidence: `src/OpcUa.Server/OpcUaServerWorker.cs`)
- OPC UA Server → Energy Address Space: hosts address space (evidence: `src/OpcUa.Server/OpcUaServerWorker.cs`)
- Energy Address Space → OPC UA Collector: serves measurements (evidence: `README.md`)
- OPC UA Collector → Raw Telemetry: publishes events (evidence: `src/OpcUa.Client/OpcUaClientWorker.cs`)
- OPC UA Collector → Collector Coordinator: requests assignments (evidence: `README.md`)
- Raw Telemetry → Validation Processor: consumed by (evidence: `README.md`)
- Validation Processor → Telemetry Validator: validates events (evidence: `src/Telemetry.Processor/ProcessorWorker.cs`)
- Validation Processor → Processed Telemetry: publishes valid (evidence: `src/Telemetry.Processor/ProcessorWorker.cs`)
- Validation Processor → Dead Letters: routes invalid (evidence: `src/Telemetry.Processor/ProcessorWorker.cs`)
- Processed Telemetry → Telemetry Inserter: consumed by (evidence: `README.md`)
- Telemetry Inserter → PostgreSQL: persists idempotently (evidence: `src/Telemetry.Inserter/InserterWorker.cs`)
- PostgreSQL → ASP.NET API: serves history (evidence: `README.md`)
- ASP.NET API → Collector Coordinator: hosts coordination (evidence: `README.md`)
- OPC UA Collector → Service Status: reports health (evidence: `README.md`)
- Validation Processor → Service Status: publishes heartbeats (evidence: `src/Telemetry.Processor/ProcessorWorker.cs`)
- Telemetry Inserter → Service Status: publishes heartbeats (evidence: `README.md`)
- Service Status → Telemetry Inserter: persists status (evidence: `README.md`)
- ASP.NET API → Live Broadcaster: hosts broadcaster (evidence: `src/Telemetry.Api/Program.cs`)
- Live Broadcaster → SignalR Hub: broadcasts updates (evidence: `README.md`)
- ASP.NET API → Energy Dashboard: serves HTTP data (evidence: `README.md`)
- SignalR Hub → Energy Dashboard: pushes live updates (evidence: `README.md`)
- Operator → Energy Dashboard: uses (evidence: `README.md`)
- OPC UA Collector → OpenTelemetry: records telemetry (evidence: `src/OpcUa.Client/OpcUaClientWorker.cs`)
- Validation Processor → OpenTelemetry: records metrics (evidence: `src/Telemetry.Processor/ProcessorWorker.cs`)
- Telemetry Inserter → OpenTelemetry: records metrics (evidence: `src/Telemetry.Inserter/InserterWorker.cs`)
