$ show chamanbravo/upstat
Upstat is a self-hosted, open-source status monitoring and uptime tracking tool. The system consists of a Go (Fiber v2) backend API and a Next.js 15 web dashboard, deployed via Docker Compose with support for both PostgreSQL and SQLite databases. The backend periodically pings configurable HTTP endpoints, records heartbeats, calculates uptime percentages, and manages incidents triggered by status transitions. It integrates with multiple notification channels (Discord, Slack, Telegram, Ntfy, Gotify) and provides public status pages with real-time latency charts. The frontend uses shadcn/ui components, React Hook Form with Zod validation, and a custom client fetch wrapper for authenticated API calls. The monorepo also includes a documentation site (Fumadocs) and a static landing page. While the architecture is well-structured with clear separation of concerns (controllers, routes, models, utils), the codebase shows signs of technical drift including outdated dependencies, hardcoded secrets in Docker Compose files, committed SQLite database artifacts, and documentation inconsistencies between the manual API docs and generated OpenAPI spec. The project is functional and suitable for small to medium deployments but would benefit from dependency updates and cleanup before production use.
The LLM identified 3 files worth highlighting for reuse:
Manages a thread-safe map of context cancel functions for per-monitor ping goroutines. Provides start/stop/pause/resume lifecycle methods, ensuring background polling tasks are properly cleaned up on monitor deletion or shutdown. This pattern is reusable in any Go application requiring controlled background workers.
Constructs a formatted Discord embed message from incident data and sends via webhook. Part of a family of alert formatters (slack.go, telegram.go, ntfy.go, gotify.go) that share a common interface for triggers. Each file is isolated, self-contained, and could be extracted as a reusable alerting library for multi-platform notification delivery.
A thin fetch wrapper that automatically attaches JWT access tokens from cookies and attempts transparent refresh on 401 responses. Used across the frontend for all authenticated API calls. This pattern is reusable in any Next.js application with cookie-based auth and demonstrates a clean separation of fetch logic.