Skip to content

epicentre/net-pulse

Repository files navigation

Net Pulse

Internet connectivity monitor inspired by UptimeLog. Periodically probes configured HTTP endpoints (Google, Cloudflare, and any custom ones you add), records online/offline transitions in SQLite, and serves a small dashboard showing current status, uptime percentages, and outage history.

net-pulse dashboard

  • Backend: Go + Fiber, SQLite (pure-Go driver), embedded React frontend
  • Frontend: React + TypeScript + Vite + Tailwind v4
  • Live updates: WebSocket
  • Distribution: single static binary or a 17 MB Docker image

Download

Pre-built binaries for macOS, Windows, and Linux are on the Releases page.

Run with Docker

The fastest way to run net-pulse. No Go or Node toolchain required.

docker build -t net-pulse .
docker run -p 8080:8080 -v net-pulse-data:/data net-pulse

Open http://localhost:8080.

Prefer a host directory you can inspect? Use -v "$(pwd)/data":/data instead.

Build the binary

Produces a single self-contained binary at ./bin/net-pulse with the frontend embedded via go:embed — no separate web server needed.

Requires Go 1.26+ and Node 24.16.0 (only for the one-time frontend build).

make build
./bin/net-pulse

Open http://localhost:8080.

Configuration

All settings are environment variables (loaded from .env if present):

Variable Default Description
BACKEND_PORT 8080 HTTP/WS port
FRONTEND_PORT 5173 Vite dev server port (dev only)
PING_INTERVAL 15s How often to probe endpoints
CHECK_TIMEOUT 5s Per-request HTTP timeout
SUCCESS_THRESHOLD 0.5 Majority rule: minimum fraction of endpoints that must succeed for the aggregate status to be considered online. With 3 endpoints and 0.5, 2 of 3 must respond. A single endpoint failing does not mark the connection offline.
DB_PATH ./net-pulse.db SQLite database location
RETENTION_DAYS 90 Per-endpoint result rows older than this are purged daily. Aggregated status_ticks are kept forever (they are tiny).
LOG_LEVEL info debug | info | warn | error
APP_ENV development development enables CORS for the Vite proxy

Endpoints

Default monitored endpoints (Google, Cloudflare) are seeded on first run. You can add/remove/disable endpoints through the dashboard UI; the change takes effect on the next check tick.

API

Method Path Description
GET /healthz Liveness probe
GET /ws WebSocket (events: hello, check_result, status_changed, endpoints_changed)
GET /api/status Current online/offline + since when
GET /api/stats?range=24h|7d|30d Uptime %, downtime, outage count
GET /api/outages?range=24h List of outages in the range
GET /api/history?from=<ms>&to=<ms>&endpoint=<id> Per-endpoint result history
GET /api/config Read-only view of the current env settings
GET /api/endpoints List monitored endpoints
POST /api/endpoints Body {name, url} — add an endpoint
PUT /api/endpoints/:id Body {name, url, enabled} — update
DELETE /api/endpoints/:id Remove

Development

Requirements: Go 1.26+, Node 24.16.0 (see .nvmrc), and air for backend hot-reload (make install-tools).

cp .env.example .env       # optional — defaults are fine
make install-tools         # one-time: installs air
cd web && npm install      # install frontend deps
cd ..
make dev                   # runs backend (air) + frontend (vite) in parallel

Open http://localhost:5173. The Vite dev server proxies /api and /ws to the backend, so the experience is the same as production.

Edit any .go file → air rebuilds & restarts the backend. Edit any .tsx/.css file → Vite HMR updates the page instantly.

Tests

make test            # go test -race ./...

About

Monitor your internet connection — track outages, uptime, and latency from your own machine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors