A lightweight Microservice-based system designed to monitor the uptime and latency of digital assets (websites/APIs) in real-time.
The project is architectured as two decoupled services to ensure scalability and professional separation of concerns:
- Watch (Service A): The "Brain" of the operation. It handles the Asset Registry (CRUD) and serves as the execution engine for health checks and pings.
- Logger (Service B): The "Historian." A dedicated service that receives telemetry data from Service A and persists it into a MySQL database.
- Dynamic Asset Management: Add or remove target URLs in real-time via the web dashboard.
- Health Telemetry: Captures HTTP status codes and precise round-trip latency (ms).
- Decoupled Communication: Services communicate via RESTful JSON payloads, preventing database bottlenecks.
- Database Driven: Uses dedicated schemas for asset configurations and historical logs.
- Languages: Python 3.x, JavaScript (ES6+)
- Frameworks: Flask (Python), Vanilla JS (Frontend)
- Database: MySQL 8.0
- Protocols: HTTP/REST, JSON
As seen in the project root:
.
βββ Logger/ # Service B: Data Persistence & History
β βββ Service_B.py
β βββ .env # DB Credentials for history_db
βββ Watch/ # Service A: Asset Management & Pings
β βββ Service_A.py
β βββ .env # DB Credentials for monitor_db
βββ templates/ # Frontend UI
β βββ index.html # Dashboard Interface
βββ .gitignore # Excludes venv, __pycache__, and .env
βββ DB_SCHEM.sql # MySQL Database Setup Scripts
βββ README.md # Project Documentation
βββ requirements.txt # Global Python Dependencies
π¦ Getting Started
- Database Configuration Initialize your databases by running the provided SQL script:
-- Open your MySQL terminal or Workbench and run:
source DB_SCHEM.sql
##2. Environment Setup You must have a .env file in both the /Logger and /Watch directories:
DB_HOST=localhost
DB_USER=your_username
DB_PASSWORD=your_password
- Installation Install the necessary libraries using the global requirements file:
pip install -r requirements.txt