Skip to content

blackshadow-software/server_tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖥️ Server Tracker

A powerful Rust-based API and web dashboard for tracking and monitoring development servers running on your system. Automatically detects REST APIs, gRPC services, databases, WebSocket servers, and more!

✨ Features

  • 🔍 Auto-detection of development servers (REST APIs, gRPC, databases, WebSocket, WebRTC)
  • 📊 Real-time monitoring with uptime tracking and resource usage
  • 🌐 Web Dashboard with beautiful, responsive UI
  • 🚀 RESTful API for integration with tools and dashboards
  • 🔧 Advanced filtering by service type, process name, or command path
  • 📈 Live statistics and change monitoring
  • ⚡ Process management - terminate processes directly from the web UI

🚀 Quick Start

1. Start the Server Tracker

# Clone and build the project
git clone <your-repo-url>
cd server_tracker
cargo build --release

# Start the tracker with web dashboard
cargo run -- serve --port 3030

2. Open the Web Dashboard

Once the server is running, open your browser and navigate to:

🌐 http://localhost:3030

You'll see a beautiful dashboard showing:

  • 📊 Live statistics (total servers, memory usage, CPU usage)
  • 🖥️ Running servers with eye-catching PID badges
  • 🔄 Real-time updates every 5 seconds
  • 🎯 Smart filtering options
  • Process termination buttons

3. API Access

The RESTful API is available at the same address:

# Check health
curl http://localhost:3030/health

# List all detected servers
curl http://localhost:3030/servers

# Get statistics
curl http://localhost:3030/stats

# Monitor changes
curl http://localhost:3030/monitor

🎯 How It Works

Server Tracker automatically scans your system for common development server patterns:

  • REST APIs: Processes listening on common web ports (3000, 8000, 8080, etc.)
  • gRPC Services: Processes with gRPC-related command patterns
  • Databases: MySQL, PostgreSQL, MongoDB, Redis, etc.
  • WebSocket Servers: WebSocket implementations
  • WebRTC: Real-time communication servers

📖 Usage Examples

Web Dashboard Features

  1. 📊 Live Statistics: View total server count, memory usage, and CPU usage at a glance
  2. 🎯 Smart Filtering: Filter servers by service type, process name, or command path
  3. 🔍 Process Details: See uptime, resource usage, ports, and full command lines
  4. ⚡ Process Management: Terminate processes directly from the UI with confirmation
  5. 📈 Change Monitoring: Track when servers start and stop in real-time

CLI Commands

# Start the web server (recommended)
cargo run -- serve --port 3030

# List servers in terminal (no web UI)
cargo run -- list

# Monitor changes in terminal
cargo run -- monitor

# Filter by service type
cargo run -- list --service-type RestApi

🔧 API Endpoints

Method Endpoint Description Example
GET /health Health check curl http://localhost:3030/health
GET /servers List all servers curl http://localhost:3030/servers
GET /servers?service_type=RestApi Filter by type curl http://localhost:3030/servers?service_type=RestApi
GET /stats Server statistics curl http://localhost:3030/stats
GET /stats?by_type=true Stats by service type curl http://localhost:3030/stats?by_type=true
GET /monitor Track changes curl http://localhost:3030/monitor
DELETE /servers/{pid} Terminate process curl -X DELETE http://localhost:3030/servers/12345

📋 Example API Response

{
  "success": true,
  "data": [
    {
      "pid": 12345,
      "name": "node",
      "service_type": "RestApi",
      "status": "Running",
      "uptime_seconds": 3600,
      "cpu_usage": 2.5,
      "memory_usage": 45678912,
      "port": 3000,
      "cmd": "node server.js"
    }
  ]
}

🛠️ Development

# Build in development mode
cargo build

# Run tests
cargo test

# Check code quality
cargo clippy

# Format code
cargo fmt

# Run with debug output
RUST_LOG=debug cargo run -- serve --port 3030

🔬 Testing

Use the included Postman collection for API testing:

# Import the collection
open postman/Server_Tracker_Environment.postman_environment.json

🎨 Web Dashboard Screenshots

The web dashboard features:

  • 🎨 Modern, responsive design that works on desktop and mobile
  • 🔴 Eye-catching PID badges with gradient colors and animations
  • 📊 Real-time charts and statistics
  • 🎯 Smart port categorization with color coding
  • ⚡ One-click process termination with safety confirmations

🚦 Port Detection Categories

The system automatically categorizes ports with visual indicators:

  • 🔴 Common Ports (80, 443, 8080, 8443) - Red gradient
  • 🔵 Development Ports (3000-3999, 8000-8999) - Blue gradient
  • 🟣 Database Ports (3306, 5432, 27017, etc.) - Purple gradient
  • 🟪 System Ports (>50000) - Pink gradient
  • ⚫ Other/Unknown - Gray

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Run tests and clippy
  5. Submit a pull request

📄 License

This project is open source and available under the MIT License.


🚀 Start tracking your development servers today!

Run cargo run -- serve --port 3030 and visit http://localhost:3030 to see the magic! ✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published