Darpan - Linux Developer Service Monitor
Darpan (दर्पण) means "mirror" in Sanskrit - a real-time reflection of your entire development environment.
Stop checking services one by one. Darpan shows you everything at a glance.
📋 Table of Contents
- What is Darpan?
- Why Use Darpan?
- Installation
- Quick Start Tutorial
- Detailed Usage Guide
- Configuration
- Real-World Examples
- Troubleshooting
- Advanced Features
🎯 What is Darpan?
Darpan is a developer-friendly service monitoring tool for Linux that automatically detects and monitors all your development services in one place.
The Problem It Solves
As a developer, you probably run multiple services:
# You do this all day:
This is tedious and time-consuming!
The Solution
With Darpan:
One command shows you:
- ✅ All running services
- ✅ Their health status
- ✅ Response times
- ✅ Why services are down
- ✅ Live activity logs
💡 Why Use Darpan?
For Solo Developers
- 🚀 Start your day faster: Know what's running before you begin coding
- 🔍 Debug quicker: Instantly see which service is down
- 🧘 Reduce cognitive load: One tool instead of 10 commands
For Teams
- 📊 Shared understanding: Everyone sees the same service status
- 🎯 Faster onboarding: New devs understand the stack immediately
- 🔧 Better debugging: "Is Redis down for you too?"
Key Features
- 🔎 Auto-detection: Finds services automatically (ports, processes, Docker)
- ❤️ Health checks: Port, HTTP, database-specific checks
- 🖥️ Two interfaces: CLI for quick checks, TUI for monitoring
- ⚙️ Zero config: Works immediately, configure only when needed
- 🐳 Docker aware: Detects and monitors containers
- 📱 Lightweight: <20MB RAM, <5.5MB binary
📦 Installation
Prerequisites
- Operating System: Linux (Ubuntu, Debian, Arch, etc.)
- Rust: 1.70 or later (for building from source)
- Optional: Docker (for Docker container detection)
Method 1: Build from Source (Recommended)
Step 1: Clone the Repository
Step 2: Build and Install
# Build the release version (optimized)
# Install globally (requires sudo)
# Or install for current user only
Step 3: Verify Installation
# Output: darpan 0.1.0
✅ Done! Darpan is now available system-wide.
Method 2: Install via Cargo (Future)
# Coming soon!
🚀 Quick Start Tutorial
Let's learn Darpan with a hands-on tutorial!
Tutorial 1: Your First Status Check
Step 1: Check What's Running
Open a terminal and run:
What you'll see:
Project: your-current-directory
╭───────────┬────────────┬──────────┬────────────────┬──────────╮
│ STATUS │ NAME │ TYPE │ HOST:PORT │ RESPONSE │
├───────────┼────────────┼──────────┼────────────────┼──────────┤
│ ✓ Healthy │ PostgreSQL │ Database │ localhost:5432 │ 12ms │
│ ✓ Healthy │ Redis │ Cache │ localhost:6379 │ 3ms │
╰───────────┴────────────┴──────────┴────────────────┴──────────╯
All 2 services are healthy ✓
Understanding the output:
- ✓ Green checkmark: Service is healthy
- ⚠ Yellow warning: Service is degraded
- ✗ Red X: Service is down
- Response time: How long the health check took
Step 2: Understand What Was Detected
Darpan automatically found:
- PostgreSQL on port 5432 (standard PostgreSQL port)
- Redis on port 6379 (standard Redis port)
How? Darpan:
- Scanned localhost ports 3000-9999
- Found open ports 5432 and 6379
- Identified them as PostgreSQL and Redis
- Checked their health
Tutorial 2: Interactive Monitoring
Step 1: Launch the TUI (Terminal User Interface)
What you'll see:
╔═══════════════════════════════════════════════╗
║ Darpan - your-directory | Live Monitor ║
╠═══════════════════════════════════════════════╣
║ >> ✓ PostgreSQL Database :5432 12ms ║
║ ✓ Redis Cache :6379 3ms ║
╠═══════════════════════════════════════════════╣
║ Quick Info: ║
║ Service: PostgreSQL ║
║ Status: ✓ HEALTHY ║
╠═══════════════════════════════════════════════╣
║ Live Logs: ║
║ [18:13:33] Detected 2 services ║
║ [18:13:38] Health check: 2/2 healthy ║
╠═══════════════════════════════════════════════╣
║ q: quit | Enter: details | ↑↓: navigate ║
╚═══════════════════════════════════════════════╝
Step 2: Navigate and Explore
Try these controls:
- Move up/down: Press
↑and↓(orjandk)- Watch the
>>selector move - Quick Info panel updates automatically
- Watch the
- View details: Press
Enteron any service- See full service information
- View process ID, command line
- See error messages and suggestions
- Go back: Press
qorEsc- Returns to main dashboard
- Refresh: Press
r- Forces an immediate health check
- Watch the logs update
- Quit: Press
qfrom the main dashboard
Step 3: Watch Live Updates
Leave the TUI running for a minute:
- Auto-refreshes every 5 seconds
- Live logs show activity
- Status updates automatically
- Time since last update shown at bottom
Try this experiment:
- Keep
darpan watchrunning - In another terminal, stop a service:
sudo systemctl stop redis - Watch Darpan detect it within 5 seconds!
- Restart Redis:
sudo systemctl start redis - Watch it turn green again!
Tutorial 3: Troubleshooting a Down Service
Step 1: Simulate a Problem
Stop Redis temporarily:
Step 2: Check Status
Output:
╭────────────┬────────────┬──────────┬────────────────┬──────────╮
│ STATUS │ NAME │ TYPE │ HOST:PORT │ RESPONSE │
├────────────┼────────────┼──────────┼────────────────┼──────────┤
│ ✓ Healthy │ PostgreSQL │ Database │ localhost:5432 │ 12ms │
│ ✗ Down │ Redis │ Cache │ localhost:6379 │ N/A │
╰────────────┴────────────┴──────────┴────────────────┴──────────╯
1/2 services healthy. 1 need attention!
Step 3: Investigate the Problem
Use the why command:
Output:
Service: Redis
────────────────────────────────────────────────────────
Status: DOWN ✗
Reason: Port not reachable: Connection refused
Location: localhost:6379
Process ID: Not running
Suggestion: Check if Redis is running and accepting connections
Last checked: 2026-01-20 18:30:45
This tells you:
- ❌ Redis is not running
- 📍 Expected on port 6379
- 💡 Suggestion: Check if it's running
Step 4: Fix the Problem
Step 5: Verify the Fix
✅ All services are healthy!
📚 Detailed Usage Guide
Command Reference
darpan status
Shows current status of all services.
Basic usage:
Options:
# JSON output (for scripts)
# Specific project
# With debug logging
When to use:
- 🌅 Starting your workday
- 🐛 Before debugging
- 🚀 Before deploying
- 🔄 After restarting services
darpan watch
Interactive TUI with live monitoring.
Basic usage:
Controls:
| Key | Action |
|---|---|
↑ / k |
Move selection up |
↓ / j |
Move selection down |
Enter |
View service details |
q |
Quit (or back from details) |
Esc |
Back to dashboard |
r |
Manual refresh |
When to use:
- 👀 Continuous monitoring
- 🔍 Troubleshooting complex issues
- 📊 During development
- 🎯 When waiting for services to start
darpan why <service-name>
Detailed troubleshooting for a specific service.
Basic usage:
Example output:
Service: Backend API
────────────────────────────────────────────────────────
Status: DOWN ✗
Reason: Process not running
Location: localhost:3001
Process ID: Not found
Expected: node dist/server.js
Suggestion: Run 'npm run dev' in project directory
Last checked: 2026-01-20 18:35:22
When to use:
- ❓ Service shows as down
- 🐛 Debugging startup issues
- 📖 Learning about service configuration
darpan init
Creates a .darpan.yml configuration file.
Basic usage:
Creates:
version: 1
services:
- name: Backend API
type: http_server
port: 3001
health_check:
type: http
path: /api/health
tags:
- name: PostgreSQL
type:
database: postgres
port: 5432
health_check:
type: postgres
database: myapp_dev
When to use:
- 📝 Custom service names
- 🎯 Specific health checks
- 👥 Sharing config with team
- 🏷️ Organizing with tags
Working with Different Projects
Scenario 1: Multiple Projects
You can use Darpan in any project without any setup:
Project A: E-commerce App
# Detects: PostgreSQL, Redis, Node.js backend, React frontend
Project B: Analytics Service
# Detects: MySQL, Python API, Celery workers
Project C: Microservices
# Detects: Multiple Docker containers, APIs
Scenario 2: Service-Specific Configs
Each project can have its own .darpan.yml:
Backend API Project:
Frontend Project:
⚙️ Configuration
Configuration Hierarchy
Darpan uses a three-level configuration system:
1. System Defaults (built-in)
↓
2. User Config (~/.config/darpan/config.yml)
↓
3. Project Config (.darpan.yml)
User Configuration
Create ~/.config/darpan/config.yml for global settings:
Project Configuration
Create .darpan.yml in your project root:
Supported Service Types
# HTTP Server
type: http_server
# Database
type: # postgres, mysql, mongodb, sqlite
# Cache
type: # redis, memcached
# Message Queue
type: # rabbitmq, kafka, redis
# Search Engine
type: # elasticsearch, meilisearch
# Docker Container
type: docker_container
# Custom
type: custom
Health Check Types
# Port connectivity (default)
health_check:
type: port
# HTTP endpoint
health_check:
type: http
path: /health
expected_status: 200
# PostgreSQL
health_check:
type: postgres
database: mydb
# Redis
health_check:
type: redis
# MySQL
health_check:
type: mysql
database: mydb
# Custom script
health_check:
type: custom
script: ./health_check.sh
timeout: 5s
🌟 Real-World Examples
Example 1: Full-Stack MERN App
Setup:
Edit .darpan.yml:
version: 1
services:
- name: MongoDB
type:
port: 27017
tags:
- name: Express Backend
type: http_server
port: 5000
health_check:
type: http
path: /api/health
tags:
- name: React Frontend
type: http_server
port: 3000
tags:
- name: Redis Session Store
type:
port: 6379
tags:
dependencies:
- service: Express Backend
depends_on:
- service: React Frontend
depends_on:
Usage:
# Start your services
&
&
&& &
&& &
# Monitor everything
Example 2: Django + PostgreSQL
Example 3: Microservices with Docker
With Docker Compose:
# Automatically detects all containers!
🔧 Troubleshooting
Common Issues and Solutions
Issue 1: No Services Detected
Symptom:
# No services detected.
Solutions:
- Check if services are actually running:
# Check open ports
|
# Check processes
|
|
- Verify port range:
Create
~/.config/darpan/config.yml:
detection:
port_range: # Scan wider range
- Use explicit configuration:
# Edit .darpan.yml to define your services
Issue 2: Service Shows as Down but It's Running
Symptom:
✗ Down │ Redis │ Cache │ localhost:6379 │ N/A
Solutions:
- Check the actual service:
# Should return: PONG
- Check if port is accessible:
# or
- Configure custom health check:
services:
- name: Redis
type:
port: 6379
health_check:
type: redis # Use Redis-specific check
timeout: 5s
retry_count: 3
Issue 3: Docker Containers Not Detected
Symptom: Docker containers running but not showing in Darpan.
Solutions:
- Check Docker access:
# If this fails, Docker daemon might not be running
- Add user to docker group:
# Logout and login again
- Enable Docker detector:
# ~/.config/darpan/config.yml
detection:
enabled_detectors:
Issue 4: Permission Denied Errors
Symptom:
Error: Permission denied (os error 13)
Solutions:
- Darpan doesn't need sudo for basic functionality
- For Docker: Add user to docker group (see above)
- For system services: Run status checks work without sudo
Issue 5: TUI Shows Garbled Text
Symptom: Terminal display is corrupted.
Solutions:
- Reset terminal:
- Use modern terminal:
- ✅ GNOME Terminal
- ✅ Konsole
- ✅ Alacritty
- ✅ iTerm2 (if on Mac via WSL)
- Check terminal size:
# TUI needs at least 80x24
🚀 Advanced Features
JSON Output for Automation
Export service status as JSON:
# Get all services
# Parse with jq
|
# Count healthy services
|
# Get unhealthy services
|
Integration with Scripts
Health check script:
#!/bin/bash
# check_services.sh
OUTPUT=
UNHEALTHY=
if [; then
|
else
fi
Pre-deployment check:
#!/bin/bash
# pre_deploy.sh
if | ; then
else
fi
Custom Health Check Scripts
Example: Custom health check for Celery:
# check_celery.sh
#!/bin/bash
if [; then
else
fi
Configuration:
services:
- name: Celery Worker
type: custom
process: celery worker
health_check:
type: custom
script: ./check_celery.sh
timeout: 5s
Tags for Organization
Use tags to organize and filter services:
services:
- name: Auth API
tags:
- name: Payment Service
tags:
- name: Analytics Worker
tags:
- name: Cache Layer
tags:
📖 Best Practices
1. Start Simple
- Begin without
.darpan.yml - Let auto-detection work
- Add config only when needed
2. Use Meaningful Names
# ❌ Bad
- name: Service 1
- name: Server
# ✅ Good
- name: User Authentication API
- name: Payment Processing Service
3. Tag Appropriately
tags: # For core services
tags: # For non-critical services
4. Document Health Checks
- name: API Gateway
health_check:
type: http
path: /health # Document why this endpoint
5. Share Configs with Team
# Commit .darpan.yml to git
🤝 Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Quick Links
📄 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
📚 Additional Resources
- QUICKSTART.md - 5-minute quick start guide
- TUI_IMPROVEMENTS.md - TUI features and updates
- CHANGELOG.md - Version history
- FIXED_ISSUES.md - Recent bug fixes
💬 Support
Need help?
- 📖 Read the QUICKSTART.md
- 🔍 Check FIXED_ISSUES.md
- 🐛 Open an issue
Made with ❤️ for developers who are tired of checking services manually
# Try it now!