# boxthatbeat/system-health-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/boxthatbeat/system-health-dashboard
- Repository: https://github.com/boxthatbeat/system-health-dashboard

## Overview

This is a three-part system-health monitoring product: a scheduled Windows collector samples OS metrics, posts them to an API that accepts and retains measurements, and an Angular dashboard fetches and charts them. The collector uses configurable plugins for CPU, memory, and storage; the API separates controller, service, and data-access responsibilities. The README also describes adding metrics through plugins and generic metric models. Some wiring is documented rather than sampled, so uncertain details are omitted; the API store shown is in-memory.

Main entry points: [`src/OSMetricsRetriever/Services/MetricsRetrieverService.cs`](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Services/MetricsRetrieverService.cs) (Metrics retriever), [`src/OSMetricsRetriever/Providers/WMIProvider.cs`](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Providers/WMIProvider.cs) (WMI provider), [`src/SystemHealthDashboard/src/app/components/dashboard/dashboard.component.ts`](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/components/dashboard/dashboard.component.ts) (Metric charts), [`src/SystemHealthAPI/Controllers/SystemMetricsController.cs`](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Controllers/SystemMetricsController.cs) (Metrics endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collector["OS Collector"]
  node_collector_app["Collector entry<br/>[Program.cs]"]
  node_retriever["Metrics retriever"]
  node_plugin_contract["Plugin contract"]
  node_cpu_plugin["CPU plugin"]
  node_memory_plugin["Memory plugin"]
  node_storage_plugin["Storage plugin"]
  node_wmi["WMI provider<br/>[WMIProvider.cs]"]
  node_retriever_model["Metric model<br/>[OSMetric.cs]"]
  node_api_client["API sender"]
end

subgraph group_api["Metrics API"]
  node_api_endpoint["Metrics endpoint"]
  node_api_service["Metrics service"]
  node_data_access["Data access"]
  node_metric_store[("In-memory metrics")]
  node_exception_middleware["Error middleware"]
  node_api_model["Metric model<br/>[OSMetric.cs]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Dashboard app<br/>[app.component.ts]"]
  node_dashboard_view["Metric charts"]
  node_dashboard_client["API client"]
  node_chart_config["Chart configuration"]
end

node_scheduler(("Task Scheduler"))
node_os{{"Windows OS"}}
node_dashboard_user(("Dashboard user"))
node_chart_library{{"Chart renderer"}}

node_scheduler -->|"launches"| node_collector_app
node_collector_app -->|"collects via"| node_retriever
node_collector_app -->|"sends through"| node_api_client
node_retriever -->|"invokes"| node_cpu_plugin
node_retriever -->|"invokes"| node_memory_plugin
node_retriever -->|"invokes"| node_storage_plugin
node_cpu_plugin -->|"implements"| node_plugin_contract
node_memory_plugin -->|"implements"| node_plugin_contract
node_storage_plugin -->|"implements"| node_plugin_contract
node_retriever -->|"provides to plugins"| node_wmi
node_cpu_plugin -->|"queries"| node_wmi
node_memory_plugin -->|"queries"| node_wmi
node_storage_plugin -->|"queries"| node_wmi
node_wmi -->|"reads via WMI"| node_os
node_retriever -->|"returns metrics"| node_retriever_model
node_api_client -->|"POSTs metrics"| node_api_endpoint
node_dashboard_user -->|"opens"| node_dashboard_app
node_dashboard_app -->|"renders"| node_dashboard_view
node_dashboard_view -->|"requests metrics"| node_dashboard_client
node_dashboard_client -->|"GETs metrics"| node_api_endpoint
node_api_endpoint -->|"delegates"| node_api_service
node_api_service -->|"reads and writes"| node_data_access
node_data_access -->|"implemented by"| node_metric_store
node_metric_store -->|"stores"| node_api_model
node_api_endpoint -->|"errors handled by"| node_exception_middleware
node_dashboard_view -->|"uses"| node_chart_config
node_dashboard_view -.->|"renders with"| node_chart_library

click node_collector_app "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Program.cs"
click node_retriever "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Services/MetricsRetrieverService.cs"
click node_plugin_contract "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/IRetrieveMetricsPlugin.cs"
click node_cpu_plugin "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/CPUUtilizationPlugin.cs"
click node_memory_plugin "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/MemoryUsagePlugin.cs"
click node_storage_plugin "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/StorageUsagePlugin.cs"
click node_wmi "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Providers/WMIProvider.cs"
click node_retriever_model "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Models/OSMetric.cs"
click node_api_client "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Services/SystemHealthAPIService.cs"
click node_api_endpoint "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Controllers/SystemMetricsController.cs"
click node_api_service "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/SystemMetricsService.cs"
click node_data_access "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/IDataAccessService.cs"
click node_metric_store "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/InMemoryDataAccessService.cs"
click node_exception_middleware "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Middleware/ExceptionHandlingMiddleware.cs"
click node_api_model "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Models/OSMetric.cs"
click node_dashboard_app "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/app.component.ts"
click node_dashboard_view "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/components/dashboard/dashboard.component.ts"
click node_dashboard_client "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/services/system-health-api.service.ts"
click node_chart_config "https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/configuration/chart-types.config.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_collector_app,node_retriever,node_plugin_contract,node_cpu_plugin,node_memory_plugin,node_storage_plugin,node_wmi,node_retriever_model,node_api_client,node_dashboard_user toneBlue
class node_api_endpoint,node_api_service,node_data_access,node_metric_store,node_exception_middleware,node_api_model toneAmber
class node_dashboard_app,node_dashboard_view,node_dashboard_client,node_chart_config toneMint
class node_scheduler toneRose
class node_os,node_chart_library toneIndigo
```

## Components

### OS Collector

- [Collector entry](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Program.cs): `src/OSMetricsRetriever/Program.cs`
- [Metrics retriever](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Services/MetricsRetrieverService.cs): `src/OSMetricsRetriever/Services/MetricsRetrieverService.cs`
- [Plugin contract](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/IRetrieveMetricsPlugin.cs): `src/OSMetricsRetriever/MetricsPlugins/IRetrieveMetricsPlugin.cs`
- [CPU plugin](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/CPUUtilizationPlugin.cs): `src/OSMetricsRetriever/MetricsPlugins/CPUUtilizationPlugin.cs`
- [Memory plugin](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/MemoryUsagePlugin.cs): `src/OSMetricsRetriever/MetricsPlugins/MemoryUsagePlugin.cs`
- [Storage plugin](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/MetricsPlugins/StorageUsagePlugin.cs): `src/OSMetricsRetriever/MetricsPlugins/StorageUsagePlugin.cs`
- [WMI provider](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Providers/WMIProvider.cs): `src/OSMetricsRetriever/Providers/WMIProvider.cs`
- [Metric model](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Models/OSMetric.cs): `src/OSMetricsRetriever/Models/OSMetric.cs`
- [API sender](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/OSMetricsRetriever/Services/SystemHealthAPIService.cs): `src/OSMetricsRetriever/Services/SystemHealthAPIService.cs`

### Metrics API

- [Metrics endpoint](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Controllers/SystemMetricsController.cs): `src/SystemHealthAPI/Controllers/SystemMetricsController.cs`
- [Metrics service](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/SystemMetricsService.cs): `src/SystemHealthAPI/Services/SystemMetricsService.cs`
- [Data access](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/IDataAccessService.cs): `src/SystemHealthAPI/Services/IDataAccessService.cs`
- [In-memory metrics](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Services/InMemoryDataAccessService.cs): `src/SystemHealthAPI/Services/InMemoryDataAccessService.cs`
- [Error middleware](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Middleware/ExceptionHandlingMiddleware.cs): `src/SystemHealthAPI/Middleware/ExceptionHandlingMiddleware.cs`
- [Metric model](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthAPI/Models/OSMetric.cs): `src/SystemHealthAPI/Models/OSMetric.cs`

### Dashboard

- [Dashboard app](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/app.component.ts): `src/SystemHealthDashboard/src/app/app.component.ts`
- [Metric charts](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/components/dashboard/dashboard.component.ts): `src/SystemHealthDashboard/src/app/components/dashboard/dashboard.component.ts`
- [API client](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/services/system-health-api.service.ts): `src/SystemHealthDashboard/src/app/services/system-health-api.service.ts`
- [Chart configuration](https://github.com/boxthatbeat/system-health-dashboard/blob/main/src/SystemHealthDashboard/src/app/configuration/chart-types.config.ts): `src/SystemHealthDashboard/src/app/configuration/chart-types.config.ts`

### Other components

- **Task Scheduler**
- **Windows OS**
- **Dashboard user**
- **Chart renderer**

## Connections

- Task Scheduler → Collector entry: launches
- Collector entry → Metrics retriever: collects via
- Collector entry → API sender: sends through
- Metrics retriever → CPU plugin: invokes
- Metrics retriever → Memory plugin: invokes
- Metrics retriever → Storage plugin: invokes
- CPU plugin → Plugin contract: implements
- Memory plugin → Plugin contract: implements
- Storage plugin → Plugin contract: implements
- Metrics retriever → WMI provider: provides to plugins
- CPU plugin → WMI provider: queries
- Memory plugin → WMI provider: queries
- Storage plugin → WMI provider: queries
- WMI provider → Windows OS: reads via WMI
- Metrics retriever → Metric model: returns metrics
- API sender → Metrics endpoint: POSTs metrics
- Dashboard user → Dashboard app: opens
- Dashboard app → Metric charts: renders
- Metric charts → API client: requests metrics
- API client → Metrics endpoint: GETs metrics
- Metrics endpoint → Metrics service: delegates
- Metrics service → Data access: reads and writes
- Data access → In-memory metrics: implemented by
- In-memory metrics → Metric model: stores
- Metrics endpoint → Error middleware: errors handled by
- Metric charts → Chart configuration: uses
- Metric charts → Chart renderer: renders with
