MCPSERV.CLUB
UpSnap

UpSnap

Self-Hosted

Instant Wake‑On‑LAN from your browser

Active(100)
4.1kstars
0views
Updated 1 day ago
UpSnap screenshot 1
1 / 5

Overview

Discover what makes UpSnap powerful

UpSnap is a lightweight, self‑hosted Wake‑On‑LAN (WOL) orchestration tool built with a modern full‑stack approach. The front end is written in **SvelteKit**, leveraging its file‑based routing, SSR capabilities, and hot module replacement for rapid UI iterations. The backend is a **Go** application that exposes a REST‑style API and WebSocket endpoints, serving both the dashboard and background cron jobs. Persistent state is stored in **PocketBase**, a lightweight, self‑contained database that runs as an embedded server and provides out‑of‑the‑box authentication, schema management, and real‑time subscriptions.

Frontend

Backend

Database

Containerization

Overview

UpSnap is a lightweight, self‑hosted Wake‑On‑LAN (WOL) orchestration tool built with a modern full‑stack approach. The front end is written in SvelteKit, leveraging its file‑based routing, SSR capabilities, and hot module replacement for rapid UI iterations. The backend is a Go application that exposes a REST‑style API and WebSocket endpoints, serving both the dashboard and background cron jobs. Persistent state is stored in PocketBase, a lightweight, self‑contained database that runs as an embedded server and provides out‑of‑the‑box authentication, schema management, and real‑time subscriptions.

The core workflow revolves around three technical pillars: device discovery (via optional nmap scans), manual or scheduled WOL packet emission, and port‑ping monitoring. Users can add devices by MAC address, hostname, or IP range; the system then resolves and stores broadcast addresses for efficient packet dispatch. Scheduled events are defined using cron syntax, enabling automation such as “wake the office server at 08:00 every weekday.” The application also exposes a simple HTTP endpoint to trigger arbitrary port pings, useful for health checks or custom integrations.

Architecture

  • Frontend: SvelteKit (TypeScript) with Tailwind CSS for theming. The UI communicates through a JSON‑over‑HTTP API and listens to real‑time updates via WebSockets. Internationalization is supported through a translations directory, allowing developers to add new locales easily.
  • Backend: Go 1.22+ (as indicated by the go.mod file). The server hosts both HTTP routes and a gRPC‑style interface for internal communication. It uses the standard library’s net package to craft and send WOL magic packets, as well as raw UDP sockets for port‑pings.
  • Database: PocketBase (v0.16+). It runs as a single binary, storing user accounts, device records, and scheduled jobs in SQLite by default. The API layer exposes CRUD operations via REST endpoints (/api/...) and real‑time events over websockets.
  • Containerization: Official Docker images are provided for amd64, arm64, arm/v7, and arm/v6. The Dockerfile uses a multi‑stage build to keep the final image lightweight (~70 MB). Deployment can be orchestrated with Docker Compose or Kubernetes via a simple Helm chart (community‑maintained).

Core Capabilities & APIs

FeatureTechnical Detail
WOL Packet EmissionPOST /api/wake/{deviceId} triggers a magic packet. The backend resolves the broadcast address from the device’s IP and sends via UDP to port 9 or a custom port.
Cron SchedulingPOST /api/schedule accepts a cron string, device ID, and optional payload. The Go cron library (robfig/cron) executes jobs at the defined times, optionally firing a webhook.
Port PingPOST /api/ping accepts host/port and returns latency or timeout. Useful for health checks.
Device DiscoveryOptional nmap integration (nmap -sn) populates the device list. The API /api/scan triggers a scan; results are parsed and stored in PocketBase.
Real‑Time UpdatesWebSocket endpoint /ws pushes device status changes and schedule triggers to connected clients.
Auth & RBACPocketBase’s built‑in auth supports email/password, API keys, and OAuth2 via custom adapters. Role‑based access can be configured through the admin UI or by editing the users collection.

Deployment & Infrastructure

  • Self‑Hosting: A single binary (upsnap) is sufficient; no external services are required beyond nmap for scanning. The application can run on any OS with Go runtime support, or as a Docker container.
  • Scalability: PocketBase’s SQLite backend scales well for dozens of devices. For larger deployments, users can swap the storage layer to PostgreSQL by modifying PocketBase’s config, as it supports multiple backends.
  • High Availability: Running two instances behind a load balancer is possible; PocketBase supports replication via its pb replicate command, though this feature is still experimental.
  • Security: The binary can be run as a non‑root user; capabilities (cap_net_admin) are required only for sending WOL packets. HTTPS can be terminated at a reverse proxy (NGINX, Traefik) to secure traffic.

Integration & Extensibility

  • Webhooks: Scheduled jobs can emit HTTP POST requests to arbitrary URLs, enabling integration with CI/CD pipelines, monitoring dashboards, or custom scripts.
  • Plugins: While the core app is monolithic, developers can extend functionality by writing Go plugins that register new API routes or cron triggers. The plugin system is exposed via a simple interface (RegisterPlugin(ctx *AppContext)).
  • Custom Themes: The UI ships with 35 themes; developers can add new CSS variables or override components in the SvelteKit src/lib/theme directory.
  • CLI: A lightweight command‑line interface (upsnap cli) allows scripting of device wake‑ups, scans, and schedule queries for automation outside the web UI.

Developer Experience

  • Documentation: The README provides clear build and run instructions. API endpoints are documented inline via OpenAPI annotations, which can be exported with pb openapi. The codebase follows Go

Open SourceReady to get started?

Join the community and start self-hosting UpSnap today