Skip to content

A comprehensive system monitoring API built with Node.js that provides real-time insights into your computer's performance and system metrics.

Notifications You must be signed in to change notification settings

brightBediako/SysSight

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SysSight - Node.js System Monitor API

A comprehensive system monitoring API built with Node.js that provides real-time insights into your computer's performance and system metrics. SysSight offers a simple, lightweight solution for monitoring CPU, memory, network, and process information through RESTful endpoints.

πŸš€ Live Demo

https://syssight.onrender.com/dashboard

πŸ“‹ Table of Contents

πŸš€ Features

  • CPU Monitoring: Real-time CPU metrics including model, cores, architecture, and load averages
  • Memory Analytics: Detailed RAM usage statistics with formatted byte values
  • Operating System Info: Complete OS details including platform, version, uptime, and hostname
  • User Information: Current user details and system user data
  • Network Monitoring: Network interface configurations and status
  • Process Tracking: Live process metrics and environment variables
  • RESTful API: Clean, intuitive HTTP endpoints for all system data
  • Cross-Platform: Works on Windows, macOS, and Linux systems
  • Lightweight: Minimal dependencies, built with Node.js core modules
  • Web Dashboard: Interactive web interface for easy system monitoring

πŸ› οΈ Tech Stack

  • Node.js - JavaScript runtime environment
  • HTTP Module - Built-in HTTP server functionality
  • OS Module - Operating system utilities and information
  • Process Module - Process information and control
  • URL Module - Request routing and parameter parsing
  • File System Module - Static file serving

πŸ“ Project Structure

sysSight/
β”œβ”€β”€ server.js                 # Main server entry point
β”œβ”€β”€ app/
β”‚   └── app.js               # Application configuration
β”œβ”€β”€ controllers/             # API endpoint controllers
β”‚   β”œβ”€β”€ cpuController.js     # CPU monitoring logic
β”‚   β”œβ”€β”€ memoryController.js  # Memory monitoring logic
β”‚   β”œβ”€β”€ networkController.js # Network interface logic
β”‚   β”œβ”€β”€ osController.js      # Operating system logic
β”‚   β”œβ”€β”€ processController.js # Process monitoring logic
β”‚   └── userController.js    # User information logic
β”œβ”€β”€ routes/                  # API route definitions
β”‚   └── routes.js            # Main route definitions
β”œβ”€β”€ utils/                   # Utility functions
β”‚   β”œβ”€β”€ formatBytes.js       # Byte formatting utilities
β”‚   └── formatTime.js        # Time formatting utilities
β”œβ”€β”€ frontend/                # Web dashboard
β”‚   β”œβ”€β”€ index.html           # Dashboard HTML
β”‚   └── main.js              # Dashboard JavaScript
β”œβ”€β”€ package.json             # Project dependencies and scripts
β”œβ”€β”€ .gitignore              # Git ignore rules
└── README.md               # Project documentation

πŸ“¦ Installation

Prerequisites

  • Node.js v14.0.0 or higher
  • npm (comes with Node.js)

Setup Instructions

  1. Clone the repository

    git clone https://github.com/brightBediako/SysSight.git
    cd sysSight
  2. Install dependencies

    npm install
  3. Verify installation

    node --version
    npm --version

πŸš€ Running the Application

Development Mode

npm start

Production Mode

# Set environment variables
export NODE_ENV=production
export PORT=3000

# Start the server
npm start

The API server will start on http://localhost:3000 by default. If port 3000 is busy, it will automatically try port 3001.

πŸ“š API Documentation

Base URL

Local Development:

http://localhost:3000

Production:

https://syssight.onrender.com

Available Endpoints

🏠 Root Endpoint

  • GET /
    • Returns API overview and available routes
    • Response:
      {
        "name": "SysSight - Node.js System Monitor API",
        "description": "A comprehensive system monitoring API built with Node.js that provides real-time insights into your computer's performance and system metrics",
        "routes": ["/cpu", "/memory", "/user", "/os", "/process", "/network"]
      }

πŸ”₯ CPU Information

  • GET /cpu
    • Returns comprehensive CPU metrics
    • Response:
      {
        "model": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
        "cores": 6,
        "architecture": "x64",
        "loadAvg": [1.2, 1.5, 1.8]
      }

πŸ’Ύ Memory Usage

  • GET /memory
    • Returns detailed memory statistics
    • Response:
      {
        "total": "16 GB",
        "free": "8 GB",
        "usage": "50.00%"
      }

πŸ’» Operating System

  • GET /os
    • Returns operating system details
    • Response:
      {
        "platform": "win32",
        "type": "Windows_NT",
        "release": "10.0.19045",
        "hostname": "DESKTOP-ABC123",
        "uptime": "1d 2h 30m 45s"
      }

πŸ‘€ User Information

  • GET /user
    • Returns current user details
    • Response:
      {
        "uid": 1000,
        "gid": 1000,
        "username": "john_doe",
        "homedir": "C:\\Users\\john_doe",
        "shell": "C:\\WINDOWS\\System32\\cmd.exe"
      }

🌐 Network Interfaces

  • GET /network
    • Returns network interface configurations
    • Response:
      {
        "Ethernet": [
          {
            "address": "192.168.1.100",
            "netmask": "255.255.255.0",
            "family": "IPv4",
            "mac": "00:11:22:33:44:55",
            "internal": false
          }
        ],
        "Wi-Fi": [
          {
            "address": "192.168.1.101",
            "netmask": "255.255.255.0",
            "family": "IPv4",
            "mac": "aa:bb:cc:dd:ee:ff",
            "internal": false
          }
        ]
      }

βš™οΈ Process Information

  • GET /process
    • Returns current process metrics
    • Response:
      {
        "pid": 12345,
        "title": "node",
        "nodeVersion": "v18.17.0",
        "uptime": "2h 15m 30s",
        "cwd": "E:\\projects\\sysSight",
        "memoryUsage": {
          "rss": "24 MB",
          "heapTotal": "7.5 MB",
          "heapUsed": "4.8 MB",
          "external": "1.1 MB"
        },
        "env": {
          "NODE_ENV": "development"
        }
      }

Error Handling

All endpoints return consistent error responses:

{
  "error": "Route Not Found"
}

HTTP Status Codes:

  • 200 - Success
  • 404 - Route not found
  • 500 - Internal server error

πŸ”§ Configuration

Environment Variables

Variable Default Description
PORT 3000 Server port number
NODE_ENV development Environment mode

Port Configuration

The server automatically handles port conflicts:

  • If the default port (3000) is busy, it will try port 3001
  • This ensures the server always starts successfully

πŸ§ͺ Testing

Manual Testing

You can test the API endpoints using:

  1. cURL

    curl http://localhost:3000/cpu
    curl http://localhost:3000/memory
  2. Postman or similar API testing tools

  3. Web Browser - Navigate to http://localhost:3000 for the root endpoint

  4. Web Dashboard - Visit http://localhost:3000/dashboard for the interactive interface

Example Usage

# Get CPU information
curl -X GET http://localhost:3000/cpu

# Get memory usage
curl -X GET http://localhost:3000/memory

# Get all system information
curl -X GET http://localhost:3000/os

# Access the web dashboard
# Open browser to: http://localhost:3000/dashboard

🌐 Web Dashboard

SysSight includes a modern web dashboard for easy system monitoring:

  • Access: Visit http://localhost:3000/dashboard (local) or https://syssight.onrender.com/dashboard (production)
  • Features:
    • Interactive buttons for each system metric
    • Real-time data display
    • Formatted JSON output
    • Error handling and loading states
    • Responsive design

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and structure
  • Add appropriate error handling
  • Include comments for complex logic
  • Test your changes thoroughly
  • Ensure cross-platform compatibility

πŸ“ License

This project is licensed under the ISC License - see the LICENSE file for details.

πŸ‘¨β€πŸ’» Author

Bright Bediako

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Include your operating system and Node.js version

πŸ”„ Version History

  • v1.0.0 - Initial release with basic system monitoring capabilities
  • v1.1.0 - Added web dashboard and improved error handling
  • v1.2.0 - Enhanced API responses and added CORS support

Built with ❀️ using Node.js

SysSight - Your System's Insight

About

A comprehensive system monitoring API built with Node.js that provides real-time insights into your computer's performance and system metrics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published