IoT Dashboard technical notes
IoT Dashboard is an unreleased desktop application in active development, with no announced release date or price. These notes describe the stack and architecture of the current development build.
Desktop interface and offline tree editor
The dashboard app is written in C# on .NET 10 using Avalonia with compiled XAML bindings and CommunityToolkit.Mvvm. View models hold all state and commands without referencing Avalonia UI controls, while layout geometry, snapping, collision checks, viewport maths and screen navigation rules live in pure domain classes so they are tested independently of views alongside an Avalonia headless UI test harness.
Screens use an anchor grid of up to 1024×1024 whole cells (never stored in pixels), supporting hierarchical screen trees, view-only zoom (50% to 200%) and pan, cross-screen copy/cut/paste, reusable widget groups with configurable nesting depth (default 5) and device-scope inheritance, compatible numeric unit conversions and threshold bands, multi-range trend charts (1 hour, 24 hours, 7 days and 90 days), and a resizable tabbed Connections and Alarms bottom pane above an always-visible four-line Priority alerts strip.
A companion Avalonia desktop application edits device-tree seed files visually offline, running the same cycle, value-bound and 60 KiB wire-size validation rules the server enforces alongside a live read-only JSON preview. Applying an updated tree file currently requires restarting the server; live over-the-network server configuration is planned.
Process isolation and local storage
The solution separates responsibilities into an acyclic set of projects: wire contracts in a leaf project, pure domain entities and rules in Core (with no Avalonia or EF Core references), SQLite persistence in Data, mutual-TLS HTTP and SSE transport in Tree, and a standalone server project referencing only Contracts. Desktop applications never reference each other or the server, and never open device sockets, protocol clients or script runtimes directly.
Entity Framework Core maps dashboard workspaces to local SQLite files (defaulting to iot-dashboard.db or any local .db file chosen by the user, with single-instance file locking and refusal of network shares). Every writable connection verifies PRAGMA foreign_keys = ON and PRAGMA journal_mode = WAL on open, and startup migrations take an online SQLite backup before upgrading an existing file. Dashboard files hold only layouts, widget content and connection settings — never live readings, alarms, action outcomes, view state, bridge credentials or private keys.
Device Tree Server, alarms and 90-day history
The server is a standalone ASP.NET Core minimal API on Kestrel listening over HTTPS only (loopback https://localhost:7443 by default). It exposes nine /v1 Tree API routes — tree description, current readings, a Server-Sent Events (SSE) change feed with resume tokens and heartbeats, value writes across all five closed value types (number, boolean, enum, string and timestamp), raw and bucketed history queries, alarm listing and alarm acknowledge/unacknowledge — plus six /v1/bridge routes for external device bridges.
The server owns a separate SQLite history database (history.db in WAL mode, checked and claimed before Kestrel binds) that records every accepted reading durably before publishing it to live streams. Retained readings and resolved alarms are pruned after 90 days, while open alarms stay recorded until they are both cleared and acknowledged. Value writes are validated against canonical bounds, guarded by per-run idempotency keys and per-certificate rate limits, and blocked when a device is reported offline or timed out by the optional silence watchdog.
Mutual TLS and trust boundaries
Every Tree API and bridge call requires mutual TLS; certificate and hostname validation are never disabled and the operating-system trust store is never used as a fallback. Each saved tree connection pins the SHA-256 hash of its server root certificate’s SubjectPublicKeyInfo (SPKI), captured and confirmed out of band during pairing. If a server rotates its root certificate, Edit mode provides a two-step re-pair flow that verifies the tree identity before restarting watches on the new anchor.
Client certificates in the desktop app are selected strictly per connection object from the current Windows user’s certificate store (CurrentUser\My), failing closed if a certificate is missing, expired or malformed, and allowing two connections to the same server to present different certificates. Support for non-Windows desktop certificate stores is planned. The server derives caller roles (viewer, operator or bridge) solely from its exact SHA-256 certificate allowlist rather than client claims, and all readings, stored identifiers and embedded images are validated at every boundary.
Isolated server-side Lua derived values
Derived (interpreted) values — such as temperature differentials or latched states with hysteresis — are evaluated strictly on the server inside an isolated out-of-process .NET 10 worker running MoonSharp 2.0.0. MoonSharp is scoped exclusively to the worker process, with no compile-time or runtime assembly reference from the server or desktop applications.
At startup, the server validates every script’s input references, rejects cycles and enforces a maximum chaining depth of 8 in topological order. Runtime execution is bounded by strict quotas (100 ms wall-clock timeout, 50,000 Lua VM instructions, a 64 MiB worker memory recycle limit and a 5-failure circuit breaker) alongside per-value kill switches. Computed readings stream live over SSE and save into 90-day history like any bridged measurement.
External bridges, simulator and read-only MCP
External device bridges connect to the server over mutual TLS using a dedicated bridge certificate bound one-to-one to disjoint owned devices. Bridges fetch their assignment, push readings, device availability and multi-severity alarms, listen for write commands over SSE and report command outcomes before the server records a change. The repository includes a reusable bridge client library with a sample process and a standalone six-device plant simulator (raising four demo alarms); built-in protocol adapters for industrial messaging, fieldbus and external script bridges remain planned.
A separate headless Model Context Protocol (MCP) server runs over standard input and output with no network listener, reading from a standalone configuration file over mutual TLS. It exposes six read-only tools — listing configured trees, inspecting tree descriptions, reading current values, checking open or resolved alarms, and querying raw or bucketed history — without opening any dashboard file or sending control writes.