CASE STUDYFull-stack web app · monitoring

Website-Uptime-Monitor

A website and API uptime monitor with Telegram and Discord alerts.

Live demo
Next.jsReactTypeScriptSupabasePostgreSQLTailwind-CSSRadix-UIRecharts
01

Screenshots

02

The problem

You want to know when a site goes down — and when it recovers — without false alarms. Add a site, pick the paths to watch, set an interval per endpoint, and get one alert when it fails and one when it is back.
03

What it does

  • 01Sign in with Google or GitHub; many endpoints per site (GET or HEAD)
  • 02Check interval per endpoint, from 1 minute to 30 days
  • 03Expected status code, timeout (1–30 s) and optional keyword that must appear in the body
  • 04Failure threshold: DOWN only after N failures in a row, so no false alarms
  • 05Alerts to Telegram and Discord, sent once on down and once on recovery
  • 06Dashboard: 24h / 7d / 30d uptime, average response time, chart and incident history
04

How it works

  1. 1

    pg_cron calls the app's /api/cron/check route every minute with a secret.

  2. 2

    The route finds endpoints whose interval has passed and checks them, 10 at a time.

  3. 3

    Results are stored and a state machine decides whether each endpoint is up or down.

  4. 4

    When the state really changes, an incident is opened or closed and an alert is sent.

  5. 5

    Check history older than 30 days is deleted every night.

05

Engineering decisions

  • SSRF protection: localhost, private IP ranges and cloud-metadata addresses are blocked, and re-checked on every redirect.
  • Row Level Security on every table; users cannot edit status columns, only the checker can.
  • Cron route is protected by a secret compared in constant time; the service key is used only in server-only code.
  • Discord alerts can never ping @everyone.
06

Tech stack

Framework
Next.js (App Router), React, TypeScript
Styling
Tailwind CSS 4, Radix UI
Charts
Recharts
Database + Auth
Supabase (Postgres, RLS, OAuth)
Scheduler
Supabase pg_cron + pg_net
Validation
Zod
Hosting
Vercel
  • Only GET and HEAD checks; keyword matching works with GET only.
  • Alerts use one shared Telegram chat / Discord channel, not one per user.
  • DNS is resolved before the request, so DNS rebinding is theoretically possible.