# monstercouch/homelab-rmm architecture

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

- Interactive diagram: https://gitdiagram.com/monstercouch/homelab-rmm
- Repository: https://github.com/monstercouch/homelab-rmm

## Overview

Homelab RMM is a self-hosted remote monitoring and management product. Technicians use the web console to enroll and manage devices, then monitor inventory and metrics or dispatch scripts, patches, and baseline policies; outbound-connected agents execute device work and report results to the server. The product also includes remote access, ticketing and a client portal, discovery, signed actions, and configurable metrics storage. The README documents the main capabilities and flows; source excerpts are partial, so some subsystem connections are documented rather than verified in implementation.

Main entry points: [`internal/server/server.go`](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/server.go) (RMM Server), [`internal/agent/agent.go`](https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/agent.go) (Device Agent), [`web/src/App.tsx`](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/App.tsx) (Web Console), [`web/src/pages/portal/ClientPortal.tsx`](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/pages/portal/ClientPortal.tsx) (Client Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Web Console"]
  node_web["Web Console<br/>[App.tsx]"]
  node_api["API Client<br/>[client.ts]"]
  node_auth["Console Auth<br/>[auth.tsx]"]
end

subgraph group_control["Server Control Plane"]
  node_server["RMM Server<br/>[server.go]"]
  node_server_entry["Server Entrypoint<br/>[main.go]"]
  node_database[("Application Database<br/>[db.go]")]
end

subgraph group_fleet["Device Management"]
  node_agent["Device Agent<br/>[agent.go]"]
  node_protocol["Agent Protocol<br/>[protocol.go]"]
  node_monitoring["Metrics and Inventory<br/>[inventory.go]"]
  node_scripts["Scripts and Tasks<br/>[runs.go]"]
  node_patching["Patch Management<br/>[patches.go]"]
  node_baselines["Baseline Compliance<br/>[baselines.go]"]
  node_remote["Remote Device Tools<br/>[desktop_start.go]"]
  node_discovery["Network Discovery<br/>[discovery.go]"]
end

subgraph group_support["Support and Access"]
  node_portal["Client Portal<br/>[ClientPortal.tsx]"]
  node_tickets["IT Ticketing<br/>[tickets.go]"]
  node_companion["Desktop Companion<br/>[main.go]"]
end

subgraph group_security["Trust and Storage"]
  node_signing["Signed Actions<br/>[verifier.go]"]
  node_signer["Action Signer<br/>[main.go]"]
  node_telemetry[("Metrics Storage<br/>[store.go]")]
end

node_technician(("Technician"))
node_smtp["SMTP Mail"]

node_technician -->|"manages fleet"| node_web
node_web -->|"checks session"| node_auth
node_web -->|"requests data"| node_api
node_api -->|"calls API"| node_server
node_server_entry -->|"starts"| node_server
node_server -.->|"reads and writes"| node_database
node_agent -->|"connects outbound"| node_server
node_agent -->|"uses protocol"| node_protocol
node_agent -->|"reports telemetry"| node_monitoring
node_server -->|"stores history"| node_monitoring
node_server -->|"dispatches runs"| node_scripts
node_server -->|"dispatches updates"| node_patching
node_agent -->|"evaluates checks"| node_baselines
node_server -->|"assigns policies"| node_baselines
node_server -->|"relays sessions"| node_remote
node_server -->|"runs discovery"| node_discovery
node_portal -->|"submits tickets"| node_tickets
node_portal -->|"requests services"| node_api
node_companion -.->|"supports self-service"| node_portal
node_signer -->|"signs actions"| node_signing
node_server -->|"verifies actions"| node_signing
node_server -->|"stores metrics"| node_telemetry
node_server -->|"sends alerts"| node_smtp

click node_web "https://github.com/monstercouch/homelab-rmm/blob/main/web/src/App.tsx"
click node_api "https://github.com/monstercouch/homelab-rmm/blob/main/web/src/api/client.ts"
click node_auth "https://github.com/monstercouch/homelab-rmm/blob/main/web/src/state/auth.tsx"
click node_server "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/server.go"
click node_server_entry "https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-server/main.go"
click node_database "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/db.go"
click node_agent "https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/agent.go"
click node_protocol "https://github.com/monstercouch/homelab-rmm/blob/main/internal/protocol/protocol.go"
click node_monitoring "https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/inventory.go"
click node_scripts "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/runs.go"
click node_patching "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/patches.go"
click node_baselines "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/baselines.go"
click node_remote "https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/desktop_start.go"
click node_discovery "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/discovery.go"
click node_portal "https://github.com/monstercouch/homelab-rmm/blob/main/web/src/pages/portal/ClientPortal.tsx"
click node_tickets "https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/tickets.go"
click node_companion "https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-desktop/main.go"
click node_signing "https://github.com/monstercouch/homelab-rmm/blob/main/internal/actionauth/verifier.go"
click node_signer "https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-signer/main.go"
click node_telemetry "https://github.com/monstercouch/homelab-rmm/blob/main/internal/telemetry/store.go"

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_web,node_api,node_auth toneBlue
class node_server,node_server_entry,node_database toneAmber
class node_agent,node_protocol,node_monitoring,node_scripts,node_patching,node_baselines,node_remote,node_discovery toneMint
class node_portal,node_tickets,node_companion toneRose
class node_signing,node_signer,node_telemetry,node_technician,node_smtp toneIndigo
```

## Components

### Web Console

- [Web Console](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [API Client](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/api/client.ts): `web/src/api/client.ts`
- [Console Auth](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/state/auth.tsx): `web/src/state/auth.tsx`

### Server Control Plane

- [RMM Server](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/server.go): `internal/server/server.go`
- [Server Entrypoint](https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-server/main.go): `cmd/rmm-server/main.go`
- [Application Database](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/db.go): `internal/server/db.go`

### Device Management

- [Device Agent](https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/agent.go): `internal/agent/agent.go`
- [Agent Protocol](https://github.com/monstercouch/homelab-rmm/blob/main/internal/protocol/protocol.go): `internal/protocol/protocol.go`
- [Metrics and Inventory](https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/inventory.go): `internal/agent/inventory.go`
- [Scripts and Tasks](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/runs.go): `internal/server/runs.go`
- [Patch Management](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/patches.go): `internal/server/patches.go`
- [Baseline Compliance](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/baselines.go): `internal/server/baselines.go`
- [Remote Device Tools](https://github.com/monstercouch/homelab-rmm/blob/main/internal/agent/desktop_start.go): `internal/agent/desktop_start.go`
- [Network Discovery](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/discovery.go): `internal/server/discovery.go`

### Support and Access

- [Client Portal](https://github.com/monstercouch/homelab-rmm/blob/main/web/src/pages/portal/ClientPortal.tsx): `web/src/pages/portal/ClientPortal.tsx`
- [IT Ticketing](https://github.com/monstercouch/homelab-rmm/blob/main/internal/server/tickets.go): `internal/server/tickets.go`
- [Desktop Companion](https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-desktop/main.go): `cmd/rmm-desktop/main.go`

### Trust and Storage

- [Signed Actions](https://github.com/monstercouch/homelab-rmm/blob/main/internal/actionauth/verifier.go): `internal/actionauth/verifier.go`
- [Action Signer](https://github.com/monstercouch/homelab-rmm/blob/main/cmd/rmm-signer/main.go): `cmd/rmm-signer/main.go`
- [Metrics Storage](https://github.com/monstercouch/homelab-rmm/blob/main/internal/telemetry/store.go): `internal/telemetry/store.go`

### Other components

- **Technician**
- **SMTP Mail**

## Connections

- Technician → Web Console: manages fleet (evidence: `README.md`)
- Web Console → Console Auth: checks session (evidence: `web/src/App.tsx`)
- Web Console → API Client: requests data (evidence: `web/src/api/client.ts`)
- API Client → RMM Server: calls API (evidence: `README.md`)
- Server Entrypoint → RMM Server: starts (evidence: `cmd/rmm-server/main.go`)
- RMM Server → Application Database: reads and writes
- Device Agent → RMM Server: connects outbound (evidence: `README.md`)
- Device Agent → Agent Protocol: uses protocol
- Device Agent → Metrics and Inventory: reports telemetry (evidence: `README.md`)
- RMM Server → Metrics and Inventory: stores history (evidence: `README.md`)
- RMM Server → Scripts and Tasks: dispatches runs (evidence: `README.md`)
- RMM Server → Patch Management: dispatches updates (evidence: `README.md`)
- Device Agent → Baseline Compliance: evaluates checks (evidence: `README.md`)
- RMM Server → Baseline Compliance: assigns policies (evidence: `README.md`)
- RMM Server → Remote Device Tools: relays sessions (evidence: `README.md`)
- RMM Server → Network Discovery: runs discovery (evidence: `README.md`)
- Client Portal → IT Ticketing: submits tickets (evidence: `README.md`)
- Client Portal → API Client: requests services (evidence: `web/src/pages/portal/ClientPortal.tsx`)
- Desktop Companion → Client Portal: supports self-service
- Action Signer → Signed Actions: signs actions (evidence: `cmd/rmm-signer/main.go`)
- RMM Server → Signed Actions: verifies actions (evidence: `internal/server/server.go`)
- RMM Server → Metrics Storage: stores metrics (evidence: `internal/server/server.go`)
- RMM Server → SMTP Mail: sends alerts (evidence: `README.md`)
