$ show louislam/uptime-kuma
Uptime Kuma is a self-hosted, open-source uptime monitoring application that periodically checks the availability and response time of services (HTTP, TCP, DNS, databases, Docker containers, and many more) and sends alerts via 90+ notification providers. The system is a monolithic Node.js/Express backend with a Vue 3 SPA frontend, using Socket.IO for real-time updates and SQLite or MariaDB for persistence. It provides status pages, maintenance windows, certificate/domain expiry monitoring, and a Prometheus metrics endpoint. The architecture follows a plugin pattern for monitor types and notification providers, both built on base classes, and includes a condition evaluation system for advanced alerting logic. The codebase is well-structured with clear separation of concerns, extensive tests (unit, integration, e2e), and active community contributions.
The LLM identified 2 files worth highlighting for reuse:
Implements a recursive expression evaluator for monitor conditions (e.g., DNS response contains keyword, database query returns expected value). Supports AND/OR logic, nested groups, variable substitution, and operator-based comparisons. It is self-contained (only depends on operators and variables from the same directory) and can be extracted into any project that needs a configurable condition checking engine.
Calculates uptime percentages over sliding windows (24h, 7d, 30d, 1y) using pre-aggregated minutely, hourly, and daily stat tables. Employs a LimitQueue for recent heartbeat data and falls back to database aggregates for longer periods. The class is reusable in any monitoring system that needs efficient uptime computation without scanning raw heartbeat data.