# shunnet/daq architecture

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

- Interactive diagram: https://gitdiagram.com/shunnet/daq
- Repository: https://github.com/shunnet/daq

## Overview

Snet.Iot.Daq is a plugin-based industrial data-acquisition application with WPF desktop and Blazor Server web front ends sharing a cross-platform Core. The principal workflow is configuring projects, devices, and addresses; loading DAQ/MQ plugins; then starting collection and forwarding data through services such as OPC UA and MQTT. The README documents these capabilities, while sampled source confirms key Core, persistence, and Web runtime relationships. Many UI routes and protocol internals were not sampled, so undocumented links are omitted.

Main entry points: [`Snet.Iot.Daq.Web/Program.cs`](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Program.cs) (Blazor Server), [`Snet.Iot.Daq/App.xaml.cs`](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/App.xaml.cs) (WPF Desktop), [`Snet.Iot.Daq.Web/Services/AppStateService.cs`](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/AppStateService.cs) (Web App State), [`Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs`](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs) (Plugin Lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_desktop["WPF Desktop<br/>[App.xaml.cs]"]
  node_web["Blazor Server<br/>[Program.cs]"]
end

subgraph group_configuration["Configuration"]
  node_core["Shared Core<br/>[Core.cs]"]
  node_projects["Project Trees"]
  node_addresses[("Address Store<br/>[AddressStore.cs]")]
  node_addressmodel["Address Models<br/>[IAddressModel.cs]"]
  node_globalconfig[("Desktop Config")]
  node_appstate["Web App State<br/>[AppStateService.cs]"]
end

subgraph group_collection["Collection Runtime"]
  node_device_runtime["Device Runtime<br/>[DeviceRuntime.cs]"]
  node_runtime_manager["Runtime Manager"]
  node_daq["DAQ Operations<br/>[DqaHandler.cs]"]
  node_mq["MQ Operations<br/>[MqHandler.cs]"]
  node_ua["OPC UA Forwarding<br/>[UaForwarding.cs]"]
end

subgraph group_plugins["Plugin Management"]
  node_plugin_core["Plugin Lifecycle"]
  node_plugin_browse["Plugin Browser"]
  node_plugin_download["Plugin Downloads"]
  node_download_jobs["Download Jobs"]
end

subgraph group_webops["Web Operations"]
  node_auth["Web Authentication<br/>[AuthService.cs]"]
  node_web_paths["Web Data Paths<br/>[WebPaths.cs]"]
  node_logs[("Operation Logs<br/>[OperateLog.cs]")]
  node_monitor["System Monitor"]
end

node_operator(("Operator"))
node_browser(("Browser User"))
node_snet_services["Snet Protocol Services"]

node_operator -->|"configures and starts"| node_desktop
node_browser -->|"accesses"| node_web
node_desktop -->|"uses shared logic"| node_core
node_web -->|"uses shared logic"| node_core
node_web -->|"authenticates through"| node_auth
node_web -->|"registers"| node_appstate
node_web -->|"registers"| node_runtime_manager
node_web -->|"registers"| node_download_jobs
node_appstate -->|"loads and saves"| node_projects
node_appstate -->|"loads"| node_addresses
node_appstate -->|"uses paths"| node_web_paths
node_runtime_manager -->|"syncs projects"| node_appstate
node_runtime_manager -->|"creates and configures"| node_device_runtime
node_device_runtime -.->|"runs collection"| node_daq
node_device_runtime -.->|"forwards messages"| node_mq
node_device_runtime -.->|"uses forwarding"| node_ua
node_desktop -->|"loads configuration"| node_globalconfig
node_desktop -->|"manages plugins"| node_plugin_core
node_desktop -->|"manages projects"| node_projects
node_plugin_core -->|"creates plugin instances"| node_snet_services
node_plugin_browse -.->|"offers downloads"| node_plugin_download
node_download_jobs -->|"downloads packages"| node_plugin_download
node_download_jobs -->|"probes and registers"| node_plugin_core
node_plugin_core -->|"supports DAQ plugins"| node_daq
node_plugin_core -->|"supports MQ plugins"| node_mq
node_daq -->|"communicates with devices"| node_snet_services
node_mq -->|"provides MQTT broker"| node_snet_services
node_ua -->|"provides OPC UA"| node_snet_services
node_desktop -->|"shows system metrics"| node_monitor
node_web -->|"audits operations"| node_logs
node_addressmodel -.->|"models stored addresses"| node_addresses

click node_desktop "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/App.xaml.cs"
click node_web "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Program.cs"
click node_core "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/Core.cs"
click node_projects "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/ProjectHandlerCore.cs"
click node_addresses "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/AddressStore.cs"
click node_addressmodel "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/interface/IAddressModel.cs"
click node_globalconfig "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/data/GlobalConfigModel.cs"
click node_appstate "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/AppStateService.cs"
click node_device_runtime "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DeviceRuntime.cs"
click node_runtime_manager "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DeviceRuntimeManager.cs"
click node_daq "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/DqaHandler.cs"
click node_mq "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/MqHandler.cs"
click node_ua "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/UaForwarding.cs"
click node_plugin_core "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs"
click node_plugin_browse "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginBrowseHandler.cs"
click node_plugin_download "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginDownloadHandler.cs"
click node_download_jobs "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DownloadTaskManager.cs"
click node_auth "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/AuthService.cs"
click node_web_paths "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/WebPaths.cs"
click node_logs "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/OperateLog.cs"
click node_monitor "https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/utility/SystemMonitoring.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_desktop,node_web,node_browser toneBlue
class node_core,node_projects,node_addresses,node_addressmodel,node_globalconfig,node_appstate toneAmber
class node_device_runtime,node_runtime_manager,node_daq,node_mq,node_ua toneMint
class node_plugin_core,node_plugin_browse,node_plugin_download,node_download_jobs toneRose
class node_auth,node_web_paths,node_logs,node_monitor,node_operator,node_snet_services toneIndigo
```

## Components

### User Interfaces

- [WPF Desktop](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/App.xaml.cs): `Snet.Iot.Daq/App.xaml.cs`
- [Blazor Server](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Program.cs): `Snet.Iot.Daq.Web/Program.cs`

### Configuration

- [Shared Core](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/Core.cs): `Snet.Iot.Daq.Core/Core.cs`
- [Project Trees](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/ProjectHandlerCore.cs): `Snet.Iot.Daq.Core/handler/ProjectHandlerCore.cs`
- [Address Store](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/AddressStore.cs): `Snet.Iot.Daq.Core/handler/AddressStore.cs`
- [Address Models](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/interface/IAddressModel.cs): `Snet.Iot.Daq.Core/interface/IAddressModel.cs`
- [Desktop Config](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/data/GlobalConfigModel.cs): `Snet.Iot.Daq/data/GlobalConfigModel.cs`
- [Web App State](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/AppStateService.cs): `Snet.Iot.Daq.Web/Services/AppStateService.cs`

### Collection Runtime

- [Device Runtime](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DeviceRuntime.cs): `Snet.Iot.Daq.Web/Services/DeviceRuntime.cs`
- [Runtime Manager](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DeviceRuntimeManager.cs): `Snet.Iot.Daq.Web/Services/DeviceRuntimeManager.cs`
- [DAQ Operations](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/DqaHandler.cs): `Snet.Iot.Daq.Core/handler/DqaHandler.cs`
- [MQ Operations](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/MqHandler.cs): `Snet.Iot.Daq.Core/handler/MqHandler.cs`
- [OPC UA Forwarding](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/UaForwarding.cs): `Snet.Iot.Daq.Core/handler/UaForwarding.cs`

### Plugin Management

- [Plugin Lifecycle](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs): `Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs`
- [Plugin Browser](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginBrowseHandler.cs): `Snet.Iot.Daq.Core/handler/PluginBrowseHandler.cs`
- [Plugin Downloads](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Core/handler/PluginDownloadHandler.cs): `Snet.Iot.Daq.Core/handler/PluginDownloadHandler.cs`
- [Download Jobs](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/DownloadTaskManager.cs): `Snet.Iot.Daq.Web/Services/DownloadTaskManager.cs`

### Web Operations

- [Web Authentication](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/AuthService.cs): `Snet.Iot.Daq.Web/Services/AuthService.cs`
- [Web Data Paths](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/WebPaths.cs): `Snet.Iot.Daq.Web/Services/WebPaths.cs`
- [Operation Logs](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq.Web/Services/OperateLog.cs): `Snet.Iot.Daq.Web/Services/OperateLog.cs`
- [System Monitor](https://github.com/shunnet/daq/blob/main/Snet.Iot.Daq/utility/SystemMonitoring.cs): `Snet.Iot.Daq/utility/SystemMonitoring.cs`

### Other components

- **Operator**
- **Browser User**
- **Snet Protocol Services**

## Connections

- Operator → WPF Desktop: configures and starts (evidence: `README.md`)
- Browser User → Blazor Server: accesses (evidence: `README.md`)
- WPF Desktop → Shared Core: uses shared logic (evidence: `README.md`)
- Blazor Server → Shared Core: uses shared logic (evidence: `README.md`)
- Blazor Server → Web Authentication: authenticates through (evidence: `Snet.Iot.Daq.Web/Program.cs`)
- Blazor Server → Web App State: registers (evidence: `Snet.Iot.Daq.Web/Program.cs`)
- Blazor Server → Runtime Manager: registers (evidence: `Snet.Iot.Daq.Web/Program.cs`)
- Blazor Server → Download Jobs: registers (evidence: `Snet.Iot.Daq.Web/Program.cs`)
- Web App State → Project Trees: loads and saves (evidence: `Snet.Iot.Daq.Web/Services/AppStateService.cs`)
- Web App State → Address Store: loads (evidence: `Snet.Iot.Daq.Web/Services/AppStateService.cs`)
- Web App State → Web Data Paths: uses paths (evidence: `Snet.Iot.Daq.Web/Services/AppStateService.cs`)
- Runtime Manager → Web App State: syncs projects (evidence: `Snet.Iot.Daq.Web/Services/DeviceRuntimeManager.cs`)
- Runtime Manager → Device Runtime: creates and configures (evidence: `Snet.Iot.Daq.Web/Services/DeviceRuntimeManager.cs`)
- Device Runtime → DAQ Operations: runs collection (evidence: `Snet.Iot.Daq.Web/Services/DeviceRuntime.cs`)
- Device Runtime → MQ Operations: forwards messages (evidence: `Snet.Iot.Daq.Web/Services/DeviceRuntime.cs`)
- Device Runtime → OPC UA Forwarding: uses forwarding (evidence: `Snet.Iot.Daq.Web/Services/DeviceRuntime.cs`)
- WPF Desktop → Desktop Config: loads configuration (evidence: `Snet.Iot.Daq/App.xaml.cs`)
- WPF Desktop → Plugin Lifecycle: manages plugins (evidence: `Snet.Iot.Daq/App.xaml.cs`)
- WPF Desktop → Project Trees: manages projects
- Plugin Lifecycle → Snet Protocol Services: creates plugin instances (evidence: `Snet.Iot.Daq.Core/handler/PluginHandlerCore.cs`)
- Plugin Browser → Plugin Downloads: offers downloads
- Download Jobs → Plugin Downloads: downloads packages (evidence: `Snet.Iot.Daq.Web/Services/DownloadTaskManager.cs`)
- Download Jobs → Plugin Lifecycle: probes and registers (evidence: `Snet.Iot.Daq.Web/Services/DownloadTaskManager.cs`)
- Plugin Lifecycle → DAQ Operations: supports DAQ plugins (evidence: `README.md`)
- Plugin Lifecycle → MQ Operations: supports MQ plugins (evidence: `README.md`)
- DAQ Operations → Snet Protocol Services: communicates with devices (evidence: `README.md`)
- MQ Operations → Snet Protocol Services: provides MQTT broker (evidence: `README.md`)
- OPC UA Forwarding → Snet Protocol Services: provides OPC UA (evidence: `README.md`)
- WPF Desktop → System Monitor: shows system metrics (evidence: `README.md`)
- Blazor Server → Operation Logs: audits operations (evidence: `README.md`)
- Address Models → Address Store: models stored addresses (evidence: `Snet.Iot.Daq.Core/handler/AddressStore.cs`)
