A comprehensive real-time system monitoring application built with FastAPI and modern web technologies
Features β’ Installation β’ Quick Start β’ API Documentation β’ Configuration β’ Tech Stack
DevWatchMan is a powerful, production-ready system monitoring solution that provides real-time insights into your system's performance. Built with FastAPI for high-performance backend operations and vanilla JavaScript for a lightweight frontend, it offers comprehensive monitoring capabilities through both a modern web dashboard and a cross-platform desktop application.
- π Real-time WebSocket Updates - Instant metric visualization with 3-second refresh intervals
- π Interactive Charts - Powered by Chart.js with historical data up to 30 days
- π¨ Smart Alert System - Configurable thresholds with cooldown periods and severity levels
- π Network Quality Monitoring - Latency tracking and connectivity status
- π Port Monitoring - Track critical development and production ports
- π³ Docker Integration - Monitor container status and resource usage
- πΎ SQLite Database - Persistent historical data storage with automatic retention
- β‘ FastAPI Backend - High-performance async API endpoints
- π¨ Modern UI - Beautiful dark/light mode with TailwindCSS
- π₯οΈ Desktop Application - Cross-platform Tauri-based desktop app
- π± Responsive Design - Works seamlessly on desktop and mobile devices
- π Profile Management - Multiple monitoring profiles for different environments
- CPU Usage - Real-time CPU percentage tracking across all cores
- Memory Monitoring - RAM usage with detailed bytes-level information and swap memory
- Disk Usage - Track disk space utilization across all mounted drives
- Network Statistics - Upload/download speeds in real-time with historical graphs
- Process Monitoring - Top processes by CPU and memory consumption
- Network Quality - Ping-based latency monitoring with quality classification
- WebSocket Live Updates - Get instant updates without page refresh (3-second intervals)
- Historical Data - View performance trends over time (up to 720 hours / 30 days)
- Port Status Monitoring - Track critical ports (3000, 5173, 8000, 1433, 5672, 15672)
- Network Quality Checks - Ping-based latency monitoring (default: 1.1.1.1)
- Docker Container Monitoring - Real-time status and resource usage of Docker containers
- Profile System - Switch between monitoring profiles (default, frontend-dev, microservices)
- Alert System with:
- CPU threshold alerts (default: 85%)
- RAM threshold alerts (default: 90%)
- Required port monitoring with cooldown (60 seconds)
- Severity levels: critical, warning, info
- Alert muting and acknowledgment
- Event timeline tracking
- Real-time KPIs - CPU, RAM, Disk, Network metrics updated live
- Historical Charts - Interactive time-series visualizations
- Port Status Grid - Visual status of monitored ports with process information
- Alert Panel - Recent alerts with severity indicators
- Timeline View - System events and alert history
- Docker Dashboard - Container status and resource graphs
- Profile Switcher - Quick switching between monitoring profiles
- Dark/Light Mode - Automatic theme switching
- Responsive Layout - Optimized for all screen sizes
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.10+ | Core programming language |
| FastAPI | Latest | Modern, high-performance web framework |
| Uvicorn | Latest | Lightning-fast ASGI server |
| Pydantic | Latest | Data validation using Python type annotations |
| psutil | Latest | Cross-platform library for system monitoring |
| SQLite | 3.x | Lightweight embedded database |
| Jinja2 | Latest | Server-side template rendering |
| Python-multipart | Latest | Form data handling |
| Docker SDK | Latest | Docker container monitoring |
| Technology | Purpose |
|---|---|
| HTML5/CSS3 | Semantic markup and modern styling |
| JavaScript (Vanilla) | No framework dependencies, pure performance |
| TailwindCSS | Utility-first CSS framework (via CDN) |
| Chart.js | Beautiful, responsive charts and graphs |
| WebSocket API | Real-time bidirectional communication |
| Technology | Version | Purpose | |-----------|---------| | Tauri | v2 | Cross-platform desktop framework | | TypeScript | ~5.6.2 | Type-safe desktop app development | | Vite | ^6.0.3 | Fast build tool and dev server | | Rust | Latest | Backend runtime for Tauri |
- Git - Version control
- PyInstaller - Python application bundling (desktop version)
- Virtual Environment - Isolated Python dependencies
| Component | Requirement |
|---|---|
| Python | 3.10 or higher |
| Operating System | Windows, macOS, Linux |
| Browser | Modern browser with WebSocket support (Chrome, Firefox, Safari, Edge) |
| RAM | Minimum 2GB (4GB+ recommended) |
| Disk Space | 100MB for application + database growth |
| Network | Required for network quality monitoring |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DevWatchMan β
β System Monitor Platform β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββ ββββββββββββββββββββββββ
β Web Dashboard ββββββββββΊβ Desktop App (Tauri) β
β (Browser-based) β HTTP β (Cross-platform) β
ββββββββββββ¬ββββββββββββ ββββββββββββ¬ββββββββββββ
β β
β WebSocket / REST API β
β β
ββββββββββββΌββββββββββββββββββββββββββββββββββΌββββββββββββ
β FastAPI Backend Server β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β API Routes Layer β β
β β /api/health /api/summary /api/history β β
β β /api/ports /api/alerts /api/docker β β
β β /ws/live (WebSocket) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Core Services Layer β β
β β β’ Snapshot Scheduler (3s interval) β β
β β β’ WebSocket Manager β β
β β β’ Alert State Manager β β
β β β’ Profile State Manager β β
β β β’ Retention Service β β
β β β’ Docker Monitor β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Data Collectors Layer β β
β β β’ CPU Collector β’ Network Collector β β
β β β’ Memory Collector β’ Port Scanner β β
β β β’ Disk Collector β’ Process Monitor β β
β β β’ Network Quality β’ Docker Collector β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Storage Layer β β
β β β’ SQLite Database β β
β β - snapshots table (metrics history) β β
β β - alerts table (alert history) β β
β β - events table (timeline events) β β
β β - app_state table (configuration) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββ
β System Resources β
β β’ psutil (CPU, RAM, Disk) β
β β’ Network Interfaces β
β β’ Running Processes β
β β’ Docker Daemon β
βββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Collection Flow β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββ Every 3 seconds ββββββββββββββββ
β Snapshot ββββββββββββββββββββββββββΊβ System β
β Scheduler β β Collectors β
ββββββββββββββββ ββββββββ¬ββββββββ
β
βΌ
βββββββββββββββββββββ
β Collect Metrics β
β β’ CPU % β
β β’ Memory % β
β β’ Disk % β
β β’ Network I/O β
βββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββ
β Alert Engine β
β β’ Check CPU β
β β’ Check RAM β
β β’ Check Ports β
β β’ Check Network β
βββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββ
β Store in SQLite β
β β’ snapshots β
β β’ alerts β
β β’ events β
βββββββββββ¬ββββββββββ
β
βΌ
βββββββββββββββββββββ
β Broadcast via WS β
β to all clients β
βββββββββββββββββββββ
ββββββββββββββββ ββββββββββββββββ
β Client β β Server β
β (Browser) β β (FastAPI) β
ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β β
β 1. Connect: ws://host/ws/live β
βββββββββββββββββββββββββββββββββββββββββββΊβ
β β
β 2. Connection Established β
ββββββββββββββββββββββββββββββββββββββββββββ
β β
β 3. Snapshot Update (every 3s) β
ββββββββββββββββββββββββββββββββββββββββββββ
β { β
β "type": "snapshot", β
β "v": 1, β
β "data": { β
β "cpu_percent": 45.2, β
β "mem_percent": 62.8, β
β ... β
β } β
β } β
β β
β 4. Alert Update β
ββββββββββββββββββββββββββββββββββββββββββββ
β { β
β "type": "timeline_event", β
β "v": 1, β
β "data": {...} β
β } β
β β
β 5. Heartbeat / Keep-alive β
βββββββββββββββββββββββββββββββββββββββββββΊβ
β β
Before you begin, ensure you have the following installed:
- Python 3.10 or higher (Download)
- pip (Python package installer - usually comes with Python)
- Git (Download)
- Virtual environment (recommended for isolation)
git clone https://github.com/Sakilalakmal/DevWatchMan.git
cd DevWatchManpython -m venv venv
venv\Scripts\activatepython3 -m venv venv
source venv/bin/activate# Install all required Python packages
pip install -r requirements.txtRequired Python packages:
fastapi # Modern web framework
uvicorn # ASGI server
psutil # System and process utilities
pydantic # Data validation
jinja2 # Template engine
python-multipart # For form data handling
docker # Docker container monitoring
Alternatively, install packages individually:
pip install fastapi uvicorn psutil pydantic jinja2 python-multipart dockerpython -c "import fastapi, uvicorn, psutil; print('All dependencies installed successfully!')"# Navigate to the application directory
cd devwatchman
# Start the server
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000# Navigate to the application directory
cd devwatchman
# Start with multiple workers
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4Once the server is running, access the application:
- Main Dashboard: http://localhost:8000
- API Documentation (Swagger UI): http://localhost:8000/docs
- Alternative API Docs (ReDoc): http://localhost:8000/redoc
# Install Node.js dependencies
cd devwatchman-desktop
npm install
# Install Rust (required for Tauri)
# Visit: https://www.rust-lang.org/tools/installcd devwatchman-desktop
npm run tauri devcd devwatchman-desktop
npm run tauri build# Development mode with auto-reload
uvicorn app.main:app --reload
# Production mode
uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
# Custom port
uvicorn app.main:app --port 8001
# With SSL (HTTPS)
uvicorn app.main:app --ssl-keyfile=key.pem --ssl-certfile=cert.pem- Dashboard - Navigate to
http://localhost:8000for the main monitoring interface - Real-time Updates - The dashboard automatically connects via WebSocket for live data
- Historical View - Charts display configurable time ranges (1-720 hours)
- Alerts - Check the alerts panel for system warnings and critical notifications
- Docker Monitoring - View container status and resource usage in the Docker panel
- Profile Switching - Select different monitoring profiles for various environments
DevWatchMan supports multiple monitoring profiles:
- default - General system monitoring (ports: 3000, 5173, 8000, 1433, 5672, 15672)
- frontend-dev - Frontend development (ports: 3000, 5173, 8000)
- microservices - Microservices environment (custom port configuration)
Switch profiles via the dashboard or API:
curl -X POST "http://localhost:8000/api/profiles/select?name=frontend-dev"GET /api/healthReturns the API health status.
Response:
{
"ok": true,
"data": {"status": "ok"},
"meta": {}
}GET /api/summaryReturns the most recent system metrics.
Response:
{
"ok": true,
"data": {
"id": 1234,
"ts_utc": "2026-01-15T15:30:00.000Z",
"cpu_percent": 45.2,
"mem_percent": 62.8,
"mem_used_bytes": 8589934592,
"mem_total_bytes": 17179869184,
"disk_percent": 55.3,
"disk_used_bytes": 268435456000,
"disk_total_bytes": 512000000000,
"net_sent_bps": 1048576.5,
"net_recv_bps": 2097152.8
},
"meta": {}
}GET /api/history?hours=24Returns historical snapshots for time-series analysis.
Query Parameters:
hours(optional): Number of hours to retrieve (1-720, default: 24)
Response:
{
"ok": true,
"data": {
"snapshots": [
{
"id": 1,
"ts_utc": "2026-01-15T15:00:00.000Z",
"cpu_percent": 42.1,
"mem_percent": 60.5,
...
}
]
},
"meta": {"hours": 24, "count": 288}
}GET /api/portsReturns the status of monitored ports.
Response:
{
"ok": true,
"data": [
{
"port": 3000,
"listening": true,
"pid": 1234,
"process_name": "node"
},
{
"port": 8000,
"listening": true,
"pid": 5678,
"process_name": "python"
}
],
"meta": {"watch_ports": [3000, 5173, 8000, 1433, 5672, 15672]}
}GET /api/ports/listening?limit=500Returns all ports currently listening on the system.
Query Parameters:
limit(optional): Maximum number of ports to return (1-2000, default: 500)
GET /api/networkReturns network latency and quality status.
Response:
{
"ok": true,
"data": {
"host": "1.1.1.1",
"timeout_ms": 800,
"latency_ms": 45.2,
"status": "good"
},
"meta": {}
}Status Values:
excellent- Latency < 30msgood- Latency 30-100msfair- Latency 100-200mspoor- Latency > 200msoffline- No connectivity
GET /api/alerts?limit=50&include_ack=falseReturns recent system alerts.
Query Parameters:
limit(optional): Number of alerts to retrieve (1-200, default: 50)include_ack(optional): Include acknowledged alerts (default: false)
Response:
{
"ok": true,
"data": [
{
"id": 1,
"ts_utc": "2026-01-15T15:30:00.000Z",
"severity": "warning",
"message": "CPU usage high: 87.3%",
"acknowledged": false
}
],
"meta": {"limit": 50}
}POST /api/alerts/{alert_id}/ackAcknowledges a specific alert.
POST /api/alerts/mute?minutes=30Mutes all alerts for a specified duration.
Query Parameters:
minutes(required): Duration to mute (0-1440 minutes)
GET /api/timeline?hours=24&limit=200Returns system events and alert history.
Query Parameters:
hours(optional): Time range in hours (1-168, default: 24)limit(optional): Maximum events to return (1-500, default: 200)
GET /api/processesReturns top processes by CPU and memory usage.
Response:
{
"ok": true,
"data": {
"by_cpu": [
{"pid": 1234, "name": "chrome", "cpu_percent": 15.2, "mem_percent": 5.3}
],
"by_mem": [
{"pid": 5678, "name": "node", "cpu_percent": 2.1, "mem_percent": 12.8}
]
},
"meta": {}
}GET /api/docker/statusReturns Docker daemon availability status.
GET /api/docker/containers?include_stopped=true&limit=50Returns Docker container information with resource usage.
Query Parameters:
include_stopped(optional): Include stopped containers (default: true)limit(optional): Maximum containers to return (1-200, default: 50)
GET /api/profilesReturns available monitoring profiles and the active profile.
POST /api/profiles/select?name=frontend-devSwitches to a different monitoring profile.
Query Parameters:
name(required): Profile name to activate
WS /ws/liveReal-time system updates via WebSocket connection.
Message Format:
{
"type": "snapshot",
"v": 1,
"data": {
"cpu_percent": 45.2,
"mem_percent": 62.8,
"disk_percent": 55.3,
"net_sent_bps": 1048576.5,
"net_recv_bps": 2097152.8
}
}Message Types:
snapshot- System metrics updatetimeline_event- New alert or eventalert- Critical alert notification
All configuration settings are located in devwatchman/app/core/config.py
# Application Settings
APP_NAME: str = "DevWatchMan"
DB_PATH: Path = Path(__file__).resolve().parents[2] / "devwatchman.db"
# Monitoring Intervals
SNAPSHOT_INTERVAL_SECONDS: int = 3 # Data collection frequency
HISTORY_DEFAULT_HOURS: int = 24 # Default history timeframe
# Port Monitoring
WATCH_PORTS: list[int] = [3000, 5173, 8000, 1433, 5672, 15672]
# Alert Thresholds
ALERT_CPU_PERCENT: int = 85 # CPU usage alert threshold
ALERT_RAM_PERCENT: int = 90 # Memory usage alert threshold
ALERT_PORTS_REQUIRED: list[int] = [3000, 1433, 5672] # Critical ports
ALERT_COOLDOWN_SECONDS: int = 60 # Minimum time between alerts
# Alert Duration Thresholds
ALERT_CPU_DURATION_SECONDS: int = 30 # CPU must be high for 30s
ALERT_RAM_DURATION_SECONDS: int = 30 # RAM must be high for 30s
ALERT_NET_OFFLINE_SECONDS: int = 10 # Network offline threshold
# Flapping Detection
FLAP_THRESHOLD: int = 6 # Number of state changes
FLAP_WINDOW_SECONDS: int = 120 # Time window for flap detection
# Network Monitoring
NETWORK_PING_HOST: str = "1.1.1.1" # Ping target for network quality
NETWORK_PING_TIMEOUT_MS: int = 800 # Ping timeout in millisecondsEdit the WATCH_PORTS list in config.py to monitor your specific ports:
WATCH_PORTS = [3000, 5000, 8080, 9000] # Your custom portsModify alert sensitivity:
ALERT_CPU_PERCENT = 70 # Alert when CPU > 70%
ALERT_RAM_PERCENT = 85 # Alert when RAM > 85%Adjust data collection frequency:
SNAPSHOT_INTERVAL_SECONDS = 5 # Collect every 5 seconds (default: 3)DevWatchMan/
βββ devwatchman/ # Main web application
β βββ app/
β β βββ main.py # FastAPI application entry point
β β βββ api/
β β β βββ routes.py # API endpoint definitions
β β β βββ schemas.py # Pydantic models
β β βββ collectors/
β β β βββ cpu.py # CPU metrics collector
β β β βββ disk.py # Disk metrics collector
β β β βββ memory.py # Memory metrics collector
β β β βββ network.py # Network metrics collector
β β β βββ network_quality.py # Network ping/latency
β β β βββ ports.py # Port status checker
β β β βββ listening_ports.py # All listening ports scanner
β β β βββ processes.py # Process monitoring
β β βββ core/
β β β βββ config.py # Application configuration
β β β βββ logging.py # Logging setup
β β β βββ profiles.py # Monitoring profile management
β β βββ services/
β β β βββ scheduler.py # Background snapshot scheduler
β β β βββ ws_manager.py # WebSocket connection manager
β β β βββ alert_state.py # Alert state management
β β β βββ profile_state.py # Profile state management
β β β βββ retention.py # Data retention service
β β β βββ docker_monitor.py # Docker container monitoring
β β βββ storage/
β β β βββ db.py # Database initialization
β β β βββ snapshots.py # Snapshot data operations
β β β βββ alerts.py # Alert storage operations
β β β βββ events.py # Event timeline storage
β β βββ web/
β β βββ static/
β β β βββ app.js # Frontend JavaScript
β β β βββ app.css # Custom styles
β β βββ templates/
β β βββ dashboard.html # Main dashboard template
β βββ devwatchman.db # SQLite database (auto-created)
β
βββ devwatchman-desktop/ # Desktop application (Tauri)
β βββ backend/
β β βββ devwatchman/ # Same as web app backend
β β βββ run_devwatchman.py # Desktop backend launcher
β β βββ requirements.txt # Python dependencies
β βββ src/
β β βββ main.ts # Tauri frontend entry
β β βββ styles.css # Desktop app styles
β βββ src-tauri/ # Rust/Tauri configuration
β β βββ src/
β β β βββ main.rs # Rust main file
β β βββ Cargo.toml # Rust dependencies
β β βββ tauri.conf.json # Tauri configuration
β βββ index.html # Desktop app HTML
β βββ package.json # Node.js dependencies
β βββ vite.config.ts # Vite configuration
β
βββ requirements.txt # Python dependencies (web app)
βββ .gitignore # Git ignore rules
βββ README.md # This file
- Track resource usage during development
- Monitor development server ports (3000, 5173, 8000)
- Detect memory leaks in development
- Network quality monitoring for remote development
- Monitor production server health
- Track system resource utilization
- Historical performance analysis
- Alert on critical resource thresholds
- Identify network quality issues
- Monitor latency to external services
- Detect connectivity problems
- Track network bandwidth usage
- Ensure critical services are running
- Monitor development tools (Vite, Node, Python servers)
- Track database ports (SQL Server, RabbitMQ)
- Detect port conflicts
- Real-time container status
- Resource usage per container
- Container health checks
- Multi-container application monitoring
- Identify resource bottlenecks
- Track process-level resource usage
- Historical trend analysis
- Capacity planning
- Get notified of critical system events
- CPU/RAM threshold violations
- Port availability monitoring
- Network connectivity issues
| Metric | Value | Notes |
|---|---|---|
| Snapshot Interval | 3 seconds | Configurable in config.py |
| Database | SQLite | Lightweight with optimized queries |
| Memory Footprint | < 50MB | Typical usage in production |
| WebSocket | Binary protocol | Efficient bidirectional communication |
| API Response Time | < 50ms | Average for most endpoints |
| Historical Data Retention | Configurable | Default: automatic cleanup of old data |
| Concurrent WebSocket Connections | Unlimited | Limited by system resources |
| Database Size | ~1MB/day | Depends on snapshot interval and retention |
# Change the port in the uvicorn command
uvicorn app.main:app --port 8001
# Or find and kill the process using the port (Linux/macOS)
lsof -ti:8000 | xargs kill -9
# Windows
netstat -ano | findstr :8000
taskkill /PID <PID> /FThe database is automatically created on first run. If you encounter issues:
# Delete the database file to reset
rm devwatchman/devwatchman.db
# The database will be recreated on next startupSome metrics may require elevated privileges:
# Run with sudo (not recommended for production)
sudo uvicorn app.main:app --host 0.0.0.0 --port 8000
# Better: adjust file permissions
chmod 644 devwatchman/devwatchman.db- Check firewall settings
- Ensure port 8000 is open for WebSocket connections
- Verify browser supports WebSockets
- Check for proxy/reverse proxy configurations
# Ensure Docker daemon is running
docker info
# Check Docker permissions (Linux)
sudo usermod -aG docker $USER
# Restart the application after Docker changesIf DevWatchMan itself uses too much CPU:
# Increase snapshot interval in config.py
SNAPSHOT_INTERVAL_SECONDS = 5 # Instead of 3Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guide for Python code
- Write meaningful commit messages
- Add comments for complex logic
- Test your changes thoroughly
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
Sakila Lakmal
- GitHub: @Sakilalakmal
- Repository: DevWatchMan
- FastAPI - For the amazing web framework
- psutil - For comprehensive system monitoring capabilities
- Chart.js - For beautiful, responsive charts
- TailwindCSS - For the utility-first CSS framework
- Tauri - For enabling cross-platform desktop applications
- The open-source community for continuous inspiration
If you encounter any issues or have questions:
- Check the Troubleshooting section
- Search existing GitHub Issues
- Create a new issue with detailed information
- Include error logs and system information
β Star this repository if you find it helpful!
Made with β€οΈ by Sakila Lakmal