# unnebell/infra-watch architecture

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

- Interactive diagram: https://gitdiagram.com/unnebell/infra-watch
- Repository: https://github.com/unnebell/infra-watch

## Overview

InfraWatch is a local Windows-server monitoring dashboard. Its main workflow collects host and network telemetry in a PowerShell/C# agent, sends it to a local HTTP server, and presents it in a browser; backup notifications are handled as a separate persisted history. The README documents this architecture and the dashboard’s major capability areas. Agent and server implementation files were not sampled, so their internal calls and finer-grained data paths are not inferred.

Main entry points: [`public/app.js`](https://github.com/unnebell/infra-watch/blob/main/public/app.js) (Dashboard UI), [`server/local-server.ps1`](https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1) (HTTP API server), [`agent/server-agent.ps1`](https://github.com/unnebell/infra-watch/blob/main/agent/server-agent.ps1) (Telemetry agent), [`public/index.html`](https://github.com/unnebell/infra-watch/blob/main/public/index.html) (Web app shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Collection"]
  node_agent["Telemetry agent<br/>[server-agent.ps1]"]
end

subgraph group_server["Local server"]
  node_server["HTTP API server<br/>[local-server.ps1]"]
  node_telemetry[("Telemetry window<br/>[local-server.ps1]")]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Dashboard UI<br/>[app.js]"]
  node_hostmetrics["Host metrics<br/>[app.js]"]
  node_storage["Storage view<br/>[app.js]"]
  node_network["Network view<br/>[app.js]"]
  node_users["Users and SMB<br/>[app.js]"]
  node_services["Services and processes<br/>[app.js]"]
  node_backups["Backup dashboard<br/>[app.js]"]
  node_demo["Demo data mode<br/>[app.js]"]
  node_pwa["Web app shell<br/>[index.html]"]
end

subgraph group_backup["Backup tracking"]
  node_backuphistory[("Backup history<br/>[local-server.ps1]")]
end

node_windows(("Windows / Win32"))
node_backupsource(("Backup routines"))
node_browser(("Browser user"))

node_windows -->|"provides metrics"| node_agent
node_agent -->|"posts metrics"| node_server
node_backupsource -->|"posts backups"| node_server
node_server -->|"stores in RAM"| node_telemetry
node_server -->|"persists history"| node_backuphistory
node_server -->|"serves interface"| node_dashboard
node_browser -->|"opens dashboard"| node_dashboard
node_dashboard -->|"polls API"| node_server
node_dashboard -->|"renders metrics"| node_hostmetrics
node_dashboard -->|"renders volumes"| node_storage
node_dashboard -->|"renders traffic"| node_network
node_dashboard -->|"renders sessions"| node_users
node_dashboard -->|"renders status"| node_services
node_dashboard -->|"renders history"| node_backups
node_dashboard -->|"generates demo"| node_demo
node_pwa -.->|"loads script"| node_dashboard

click node_agent "https://github.com/unnebell/infra-watch/blob/main/agent/server-agent.ps1"
click node_server "https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1"
click node_telemetry "https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1"
click node_backuphistory "https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1"
click node_dashboard "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_hostmetrics "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_storage "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_network "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_users "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_services "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_backups "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_demo "https://github.com/unnebell/infra-watch/blob/main/public/app.js"
click node_pwa "https://github.com/unnebell/infra-watch/blob/main/public/index.html"

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_agent,node_browser toneBlue
class node_server,node_telemetry toneAmber
class node_dashboard,node_hostmetrics,node_storage,node_network,node_users,node_services,node_backups,node_demo,node_pwa toneMint
class node_backuphistory toneRose
class node_windows,node_backupsource toneIndigo
```

## Components

### Collection

- [Telemetry agent](https://github.com/unnebell/infra-watch/blob/main/agent/server-agent.ps1): `agent/server-agent.ps1`

### Local server

- [HTTP API server](https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1): `server/local-server.ps1`
- [Telemetry window](https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1): `server/local-server.ps1`

### Dashboard

- [Dashboard UI](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Host metrics](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Storage view](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Network view](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Users and SMB](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Services and processes](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Backup dashboard](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Demo data mode](https://github.com/unnebell/infra-watch/blob/main/public/app.js): `public/app.js`
- [Web app shell](https://github.com/unnebell/infra-watch/blob/main/public/index.html): `public/index.html`

### Backup tracking

- [Backup history](https://github.com/unnebell/infra-watch/blob/main/server/local-server.ps1): `server/local-server.ps1`

### Other components

- **Windows / Win32**
- **Backup routines**
- **Browser user**

## Connections

- Windows / Win32 → Telemetry agent: provides metrics (evidence: `README.md`)
- Telemetry agent → HTTP API server: posts metrics (evidence: `README.md`)
- Backup routines → HTTP API server: posts backups (evidence: `README.md`)
- HTTP API server → Telemetry window: stores in RAM (evidence: `README.md`)
- HTTP API server → Backup history: persists history (evidence: `README.md`)
- HTTP API server → Dashboard UI: serves interface (evidence: `README.md`)
- Browser user → Dashboard UI: opens dashboard (evidence: `README.md`)
- Dashboard UI → HTTP API server: polls API (evidence: `README.md`)
- Dashboard UI → Host metrics: renders metrics (evidence: `README.md`)
- Dashboard UI → Storage view: renders volumes (evidence: `README.md`)
- Dashboard UI → Network view: renders traffic (evidence: `README.md`)
- Dashboard UI → Users and SMB: renders sessions (evidence: `README.md`)
- Dashboard UI → Services and processes: renders status (evidence: `README.md`)
- Dashboard UI → Backup dashboard: renders history (evidence: `README.md`)
- Dashboard UI → Demo data mode: generates demo (evidence: `public/app.js`)
- Web app shell → Dashboard UI: loads script
