Ultra lightweight local machine metrics dashboard built with Go, HTMX, and SQLite.
Monitors CPU, memory, network traffic, and top processes in real time. Create alert rules (e.g. RAM > 90%) and automatically log historic spikes to the database
| Layer | Tech |
|---|---|
| Backend | Go 1.26, chi router, gopsutil |
| Frontend | HTMX 2, vanilla CSS/JS, html/template |
| Database | SQLite |
| Realtime | Server-Sent Events (SSE) + HTMX polling |
gofullstack/
├── cmd/server/ # Application entry point
│ └── main.go
├── internal/
│ ├── alerts/ # Alert threshold evaluation
│ │ └── evaluator.go
│ ├── collector/ # System metrics via gopsutil
│ │ └── collector.go
│ ├── config/ # Env-based configuration
│ │ └── config.go
│ ├── db/ # SQLite setup + migrations
│ │ ├── db.go
│ │ └── migrations/
│ │ └── 001_init.sql
│ ├── handler/ # HTTP handlers (pages, API, SSE)
│ │ └── handler.go
│ ├── models/ # Domain types
│ │ └── models.go
│ ├── repository/ # Alert & spike CRUD
│ │ └── repository.go
│ └── sse/ # SSE broadcast hub
│ └── hub.go
├── web/
│ ├── static/
│ │ ├── css/app.css
│ │ └── js/app.js
│ └── templates/
│ ├── layout.html
│ ├── dashboard.html
│ ├── alerts.html
│ └── partials/ # HTMX fragment templates
├── data/ # SQLite DB (gitignored ofc :D )
├── go.mod
└── Makefile
# Install dependencies
go mod tidy
# Run the server
go run ./cmd/server
| Env var | Default | Description |
|---|---|---|
ADDR |
:8080 |
HTTP listen address |
DB_PATH |
data/metrics.db |
SQLite file path |
COLLECT_INTERVAL |
2 |
Metrics poll interval (s) |
SSE_INTERVAL |
1 |
SSE push interval (s) |
| Method | Path | Description |
|---|---|---|
| GET | / |
Dashboard page |
| GET | /alerts |
Alerts management page |
| GET | /partials/metrics |
CPU/RAM/Network fragment |
| GET | /partials/processes |
Top processes fragment |
| GET | /partials/spikes |
Recent spike log fragment |
| GET | /api/metrics |
JSON metrics snapshot |
| GET | /api/stream |
SSE metrics stream |
| POST | /api/alerts |
Create alert |
| PUT | /api/alerts/{id} |
Update alert |
| DELETE | /api/alerts/{id} |
Delete alert |
Create an alert on the /alerts page:
- Name: High RAM
- Metric: Memory %
- Operator: >=
- Threshold: 90
When memory exceeds 90%, a spike event is logged to spike_events (with 30s cooldown per alert to avoid flooding)