๐ŸŒ Website Status Monitor

Auto-check every 5 min โ€” โš™๏ธ Admin
๐Ÿ“ก Live Status
๐Ÿ“Š Uptime & Charts
๐Ÿšจ Incidents
๐Ÿ“ง Alerts Log
๐Ÿงช Email Test
โ„น๏ธ About

๐Ÿ” Checking all websites...

๐Ÿ“ˆ Select a period to view uptime data
๐Ÿ”„ Loading...
๐Ÿ”„ Loading...

โ„น๏ธ About This Monitor

A real-time website monitoring dashboard that tracks the availability, response time, and uptime of multiple websites across different business groups. When a site goes down, email alerts are automatically sent to the designated group contact.

๐Ÿ› ๏ธ Tech Stack

Cloudflare Pages

Hosts the static dashboard and serves it globally via Cloudflare's CDN edge network with near-instant load times.

Pages Functions

Serverless Workers at the edge. Each site is checked individually with 8-second timeout to stay within execution limits.

Cloudflare D1

SQLite serverless database. Stores 30 days of check history, alert logs, and monitored site configuration.

Gmail API

Sends alert emails via Google Workspace service account with JWT/OAuth2 โ€” no stored passwords needed.

Chart.js

Lightweight charting for uptime/downtime and latency graphs with interactive tooltips and period selection.

WAF Integration

Seamlessly monitors sites behind Cloudflare challenge pages using secure WAF skip rules.

โš™๏ธ How It Works

  • ๐Ÿ” Health Check: Cron worker checks each site individually in parallel via /api/check?url=X. Status code, latency, and errors are logged to D1.
  • ๐Ÿ“Š Dashboard: The dashboard runs read-only batch checks for live display โ€” only cron writes to the database.
  • ๐Ÿ’พ D1 Logging: Every cron result is stored in status_log. Records older than 30 days are automatically purged.
  • ๐Ÿ”” Alert Routing: If a site is down and no alert was sent in the past hour, an email goes to the group's designated contact. Dedup is atomic to prevent duplicate alerts.
  • ๐Ÿ“ง Daily Summary: At 9AM HKT, a summary email is sent to all recipients with the latest check results from DB.
  • ๐Ÿ›ก๏ธ Admin Panel: Add, edit, or remove monitored sites through the admin panel (password protected).
  • ๐ŸŒ WAF Integration: Cloudflare zones are configured with WAF skip rules (including SBFM + managed rules) to allow monitoring traffic through challenge pages.
  • ๐Ÿ”’ Security: Cron endpoints require shared secret. Security headers on all responses. Chart.js loaded with SRI integrity check.

๐Ÿ—„๏ธ Database Schema

  • ๐Ÿ“‹ monitored_sites โ€” URL, group, alert email, enabled flag (managed via Admin)
  • ๐Ÿ“Š status_log โ€” Timestamp, URL, group, HTTP status, ok flag, latency, error
  • ๐Ÿ“ง alerts_sent โ€” URL, alert type, timestamp, message

๐Ÿ“ฌ Alert Recipients

Each group has a designated alert email configured via the Admin Panel. Alert emails are rate-limited to 1 per URL per hour to prevent spam.