Skip to content

tejas-0-5/cloudpulse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

◎ CloudPulse

Intelligent Serverless Website Monitoring & Alerting Platform

Deploy Python React License

CloudPulse is a production-grade, fully serverless uptime monitoring system built on AWS. Track website availability, measure latency, get smart alerts, and view analytics — all with zero servers to manage.


Architecture

EventBridge (5min schedule)
        │
        ▼
Lambda: Health Checker ──────────────── CloudWatch Metrics & Logs
        │
        ├──▶ DynamoDB: cloudpulse-sites      (site registry)
        ├──▶ DynamoDB: cloudpulse-metrics    (time-series, 30-day TTL)
        └──▶ DynamoDB: cloudpulse-incidents  (incident history, 90-day TTL)
             │
             └──▶ SNS ──▶ Email
                      └──▶ Slack Webhook

API Gateway ──▶ Lambda: API Handler ──▶ DynamoDB
                │
React Dashboard ◀── Frontend (S3 + CloudFront)

Features

Feature Details
Multi-site monitoring Track unlimited URLs with per-site configuration
Intelligent health checks HTTP status, latency, 2-retry logic, 5s timeout
Smart alerts Email (SNS) + Slack, cooldown period prevents spam
Latency tracking Time-series graphs, avg/p95 latency, 30-day history
Uptime calculation Per-site % uptime with visual 30-day bar
Incident history Tracks when sites went down and recovered
CloudWatch integration Custom metrics, execution logs, built-in dashboard
Cost optimized Serverless auto-scale, DynamoDB on-demand, TTL cleanup

Tech Stack

Backend (Serverless)

  • AWS Lambda (Python 3.12)
  • Amazon EventBridge (scheduling)
  • Amazon DynamoDB (on-demand billing + TTL)
  • Amazon SNS (email alerts)
  • Amazon API Gateway
  • Amazon CloudWatch (metrics + logs)

Frontend

  • React 18 + Vite
  • Tailwind CSS
  • Recharts (latency graphs)
  • Lucide icons

DevOps

  • AWS SAM (infrastructure as code)
  • GitHub Actions (CI/CD)

Project Structure

cloudpulse/
├── backend/
│   ├── lambda/
│   │   ├── health_checker/
│   │   │   └── handler.py
│   │   └── api_handler/
│   │       └── handler.py
│   └── tests/
│
├── frontend/
│   └── src/
│
├── docs/
├── .github/
├── template.yaml
└── README.md

Quick Start

Prerequisites

  • AWS CLI configured (aws configure)
  • AWS SAM CLI installed
  • Python 3.12, Node.js 20+

1. Clone & install

git clone https://github.com/tejas-0-5/cloudpulse.git
cd cloudpulse

2. Deploy backend

# Build
sam build

# Deploy
sam deploy --guided
# → Stack name: cloudpulse
# → AWS Region: ap-south-1
# → AlertEmail: your@email.com

After deploy, SAM prints your API endpoint:

Outputs:
ApiUrl: https://your-api-id.execute-api.ap-south-1.amazonaws.com/Prod/

3. Deploy frontend

cd frontend

# Set API URL
echo "VITE_API_URL=https://your-api-id.execute-api.ap-south-1.amazonaws.com/Prod/" > .env

npm install
npm run build

aws s3 sync dist/ s3://YOUR-BUCKET-NAME/ --delete

4. Run locally

# Frontend dev
cd frontend && npm run dev

API Reference

Method Path Description
POST /sites Register a new site
GET /sites List all monitored sites
DELETE /sites/{id} Remove a site
GET /metrics?site_id=X&hours=24 Time-series latency data
GET /incidents?site_id=X Incident history
GET /dashboard Summary stats for all sites

Configuration

Variable Default Description
LATENCY_THRESHOLD_MS 2000 Alert threshold in milliseconds
SLACK_WEBHOOK_URL "" Slack webhook URL
SNS_TOPIC_ARN auto Set by SAM

Running Tests

pip install pytest moto[dynamodb,sns] boto3 urllib3
pytest backend/tests/ -v

CI/CD (GitHub Actions)

Set these secrets:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • ALERT_EMAIL
  • S3_BUCKET_NAME
  • CLOUDFRONT_DISTRIBUTION_ID

Cost Estimate (AWS)

~$0.40/month for 10 sites (low usage)


License

MIT


👨‍💻 Author

Tejas Pathak https://github.com/tejas-0-5

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors