A production-grade uptime monitoring solution built with modern web technologies.
BetterStack Clone is a robust uptime monitoring platform that actively checks your websites and services from multiple regions. It provides real-time alerts, detailed incident management, and public status pages to keep your users informed.
Unlike passive monitoring tools, this system actively pings your endpoints, ensuring you know about downtime the moment it happens, even if your server is completely unresponsive.
- Multi-Region Monitoring: Run worker nodes in different geographic locations to verify uptime from a global perspective.
- Real-Time Dashboard: Live updates of your monitors with search, filtering, and instant status feedback.
- Incident Management: Automatic incident creation when downtime is detected, with tracking for start time, end time, and cause.
- Multi-Channel Alerting: Get notified via Email, Slack, SMS, or Voice calls (configurable via escalation policies).
- Heartbeat Monitoring: Monitor cron jobs, background workers, and scheduled tasks by listening for incoming heartbeats.
- Status Pages: Create beautiful, public-facing status pages to communicate system health to your users.
- Team & Settings: Manage your organization profile, team members, and notification preferences.
- Frontend: Next.js (React), Tailwind CSS, Shadcn UI, TanStack Query.
- Backend: Express (Node.js), Prisma (ORM).
- Database: PostgreSQL (Primary DB), Redis (Streams).
- Authentication: Better Auth.
The system is built on a distributed architecture to ensure reliability and scalability.
┌─────────────────────────────────────────────────────────────┐
│ User Dashboard │
└────────────────────────┬────────────────────────────────────┘
│
┌────▼────┐
│ API │
│ Server │
└────┬────┘
│
┌──────────▼────────┐
│ Redis Job Queue │
└──────┬──────┬─────┘
│ │
┌───────────┘ └───────────┐
│ │
┌────▼─────────┐ ┌──────▼──────┐
│ Worker │ │ Worker │
│ (Region A) │ │ (Region B) │
└────┬─────────┘ └──────┬──────┘
│ │
│ ┌────────────┐ │
└─────▶│ Target │◀───────┘
│ Website │
└──────┬─────┘
│
┌──────▼──────────┐
│ PostgreSQL │
│ Database │
└──────┬──────────┘
│
┌─────────▼─────────┐
│ Alert Service │
└────┬──────────┬───┘
│ │
┌──────▼┐ ┌────▼────┐
│ Email │ │ Slack │
└───────┘ └─────────┘
- API Server: Handles user requests, manages resources (monitors, incidents, etc.), and schedules monitoring jobs.
- Redis Queue: Distributes monitoring tasks to worker nodes.
- Uptime Workers: Stateless workers that consume jobs from Redis, perform HTTP checks, and report results.
- Consensus Engine: Determines the true status of a website based on reports from multiple regions (prevents false positives).
- Node.js 18+
- pnpm
- PostgreSQL
- Redis
-
Clone the repository:
git clone https://github.com/yourusername/betterstack-clone.git cd betterstack-clone -
Install dependencies:
pnpm install
-
Environment Setup:
- Copy
.env.exampleto.envinapps/web,apps/api,apps/worker, andpackages/databases. - Update the variables with your local configuration (DB URL, Redis URL, etc.).
- Copy
-
Database Setup:
cd packages/databases pnpm prisma db push -
Start Development Servers:
# Start all services (Frontend, API, Worker) pnpm run dev- Web: http://localhost:3000
- API: http://localhost:3001
- Prisma Studio: http://localhost:5555
To simulate multi-region monitoring locally:
- Start the default worker:
pnpm run devinapps/worker. - Start a second worker with a different region ID:
REGION_ID=us-west-1 pnpm run dev
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.






