Skip to content

Repository files navigation

LitePing

中文文档

LitePing

Lightweight, Serverless Status Page & Monitoring Platform

Built with SvelteKit, Cloudflare Workers, and D1 Database.

License: MIT Deploy to Cloudflare Workers

🚀 Features

  • Serverless Architecture: Runs entirely on Cloudflare's Edge network (Workers + Pages + D1).
  • Multi-Region Monitoring: Automatically detects worker location to ping from different global regions.
  • Real-time Status Page: Beautiful, responsive status page built with Svelte 5.
  • Incident Management: Automatic incident creation and resolution tracking.
  • Notifications: Integrated alerts for Discord, Telegram, Slack, and Webhooks.
  • Sparkline Charts: Visual history of latency and uptime for every monitor.
  • Maintenance Windows: Schedule maintenance to suppress alerts during planned downtime.

🛠 Tech Stack

  • Frontend: SvelteKit (Svelte 5), Tailwind CSS
  • Backend: Cloudflare Workers (Hono framework)
  • Database: Cloudflare D1 (SQLite), Drizzle ORM
  • Package Manager: pnpm (Monorepo workspace)

📂 Project Structure

LitePing is a monorepo organized as follows:

  • apps/web: The SvelteKit frontend application (Status Page & Admin Dashboard).
  • apps/worker: The Cloudflare Worker responsible for scheduled monitoring (Cron Triggers).
  • packages/db: Shared database schema and Drizzle ORM configuration.

⚡ Getting Started

Prerequisites

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/liteping.git
    cd liteping
  2. Install dependencies

    pnpm install
  3. Setup Database (Local) Initialize the D1 database for local development:

    cd packages/db
    pnpm generate
    # Apply migrations to local D1
    # Note: Replace the filename below with your actual generated SQL file
    npx wrangler d1 execute liteping-db --local --file=./drizzle/0000_xxxx.sql
    # (Or use the migrate command if configured)

Local Development

  1. Start the Web App

    cd apps/web
    pnpm dev

    Access the UI at http://localhost:5173.

  2. Start the Worker In a separate terminal:

    cd apps/worker
    npx wrangler dev

    The worker runs on a schedule. You can manually trigger it via the l key in the Wrangler dev console to test pings.

📦 Deployment

1. Database Setup

Create a D1 database on Cloudflare:

npx wrangler d1 create liteping-db

Update wrangler.toml in apps/web and apps/worker with your new database_id.

Apply migrations to production:

cd packages/db
pnpm migrate

2. Deploy Worker

cd apps/worker
pnpm deploy

3. Deploy Web App

cd apps/web
pnpm build
npx wrangler pages deploy .svelte-kit/cloudflare

📝 Usage

Admin Dashboard

Access the admin dashboard at /admin (e.g., https://your-site.pages.dev/admin).

  • First Login: You will be prompted to set an admin password if one hasn't been configured via environment variables.
  • Features: Add monitors, configure notifications, view detailed stats, and manage maintenance windows.

🔧 Configuration

Environment variables can be set in the Cloudflare Dashboard or wrangler.toml.

Variable Description
NOTIFY_LANGUAGE Language for notifications (e.g., zh-CN, en-US)
DISCORD_WEBHOOK_URL Optional webhook URL for Discord alerts

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A lightweight, serverless status page and monitoring tool running on Cloudflare.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages