Skip to content

Latest commit

 

History

History
279 lines (169 loc) · 5.34 KB

File metadata and controls

279 lines (169 loc) · 5.34 KB

🚀 PulseAPI — API Monitoring & Analytics Platform

PulseAPI is a backend-first API observability system that continuously monitors APIs, stores historical performance data, computes reliability metrics, and visualizes trends through dashboards.

API Monitoring Terminal


📑 Table of Contents


🔍 Overview

PulseAPI helps answer critical operational questions:

  • Are my APIs up or down?
  • Are they getting slower over time?
  • How reliable are they historically?
  • When did errors or latency spikes occur?

Unlike simple API callers, PulseAPI is designed as a long-running monitoring system with background jobs, persistent storage, analytics, and multiple visualization layers.


🧠 Motivation

Most beginner projects:

  • Call an API once
  • Display the response
  • Stop there

PulseAPI focuses on observability and systems thinking by introducing:

  • Background schedulers
  • Persistent databases
  • Time-series analytics
  • Multiple frontend consumers

This makes it closer to real internal engineering tools used in production environments.


🏗️ Architecture

Scheduler (APScheduler) ↓ API Health Checks (httpx) ↓ PostgreSQL (Time-Series Logs) ↓ Analytics Engine (FastAPI) ↓ Dashboards (Streamlit / React)

Core Components

  • FastAPI Backend
    • API registry
    • Analytics endpoints
    • Alerting logic
  • Background Scheduler
    • Periodic API health checks
    • Latency & error detection
  • PostgreSQL
    • Persistent time-series storage
  • Streamlit Dashboard
    • Internal monitoring interface
  • React Dashboard
    • Experimental modern UI layer

📊 Features

✅ Monitoring

  • Periodic API health checks
  • Latency measurement
  • Error detection (timeouts, DNS failures, HTTP errors)

📈 Analytics

  • Uptime percentage
  • Average latency
  • P95 / P99 latency
  • Error rate
  • Total number of checks
  • Last checked timestamp

🖥️ Dashboards

  • Streamlit
    • Internal monitoring dashboard
    • Status views (UP / DEGRADED / DOWN)
    • Latency charts and tables
  • React
    • Read-only analytics dashboard
    • Metrics cards
    • Latency trend visualization
    • Health status indicator

🚨 Alerting

  • High latency alerts
  • Downtime alerts
  • Cooldown logic to prevent alert spam

🖥️ Dashboards Preview

Streamlit — Internal Operations Dashboard

The Streamlit dashboard provides a real-time operational view of API health, latency trends, and failure states.

Streamlit Dashboard


React — Experimental UI

React Dashboard

The React dashboard is an experimental visualization layer built on top of the same backend APIs.
It does not introduce new business logic.


🚀 Running PulseAPI Locally

PulseAPI is designed to run locally, mirroring real production architecture.

🔧 Prerequisites

  • Python 3.10+
  • PostgreSQL
  • Node.js (for React dashboard)
  • Virtual environment or Anaconda (recommended)

1️⃣ Clone the repository

git clone https://github.com/<your-username>/PulseAPI.git
cd PulseAPI

2️⃣ Backend setup

Install dependencies:

pip install -r requirements.txt

Create environment variables:

cp .env.example .env

Update DATABASE_URL inside .env with your PostgreSQL credentials.


3️⃣ Start the backend server

uvicorn app.main:app --reload
  • Backend: http://127.0.0.1:8000/
  • Swagger UI: http://127.0.0.1:8000/docs

4️⃣ Scheduler

The scheduler starts automatically with the backend and performs periodic API checks.


5️⃣ Run Streamlit dashboard

streamlit run dashboard/app.py

6️⃣ Run React dashboard

cd react-dashboard
npm install
npm run dev

React UI will be available at:

http://localhost:5173

📸 Screenshots & Demos

Additional screenshots and demos are available in the 📁 screenshots/ directory, including:

  • Swagger API documentation
  • PostgreSQL tables
  • Streamlit latency table view
  • API dropdown selection
  • Terminal monitoring output

📚 Documentation

Detailed documentation is available in the 📄 docs/ directory:

  • architecture.md — System design and data flow
  • phases.md — Phase-wise development roadmap
  • metrics.md — Monitoring metrics explained
  • alerts.md — Alerting logic and cooldown strategy

🔮 Future Improvements

Authentication & multi-user support

  • Per-API configurable thresholds
  • Email / Slack alert integrations
  • Cloud deployment
  • Advanced anomaly detection