Skip to content

A lightweight Windows screen-time and activity monitor with a modern web-based GUI

ItzmeJan/sysmonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ฅ๏ธ System Monitor

Rust Windows SQLite Web

A lightweight Windows screen-time and activity monitor with a modern web-based GUI

Build Status License Version


โœจ Features

Feature Description Status
๐Ÿ” Real-time Monitoring Tracks active applications every second โœ… Active
๐ŸŒ Browser Detection Identifies Chrome, Edge, Firefox, and Brave โœ… Active
๐Ÿ”— URL Extraction Extracts current tab URLs from browser windows โœ… Active
๐ŸŽจ Modern Web GUI Beautiful, responsive dashboard with dark mode โœ… Active
๐Ÿ“ฑ Edge App Mode Launches in native-like Edge app window โœ… Active
โšก Efficient Storage Uses hashbrown::HashMap for in-memory tracking โœ… Active
๐Ÿ’พ SQLite Persistence Flushes data to database every 30 seconds โœ… Active
๐Ÿš€ Low Resource Usage <1% CPU on idle, <100MB memory โœ… Active
๐Ÿ”Œ REST API JSON API endpoints for dashboard data โœ… Active

๐ŸŽฏ Dashboard Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    ๐Ÿ–ฅ๏ธ System Monitor Dashboard              โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  ๐Ÿ“Š Current Activity    โ”‚        ๐Ÿ“ˆ Statistics             โ”‚
โ”‚  โ€ข msedge.exe           โ”‚        โ€ข Uptime: 2h 15m         โ”‚
โ”‚  โ€ข System Monitor       โ”‚        โ€ข Tracked Apps: 25        โ”‚
โ”‚  โ€ข http://localhost     โ”‚        โ€ข Active Now: 1           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                    ๐Ÿ“‹ Recent Activity                       โ”‚
โ”‚  ๐ŸŒ Chrome.exe (45m)                                        โ”‚
โ”‚    โ”œโ”€โ”€ GitHub (15m)                                         โ”‚
โ”‚    โ”œโ”€โ”€ Stack Overflow (20m)                                โ”‚
โ”‚    โ””โ”€โ”€ YouTube (10m)                                        โ”‚
โ”‚  ๐Ÿ”ฅ Firefox.exe (30m)                                       โ”‚
โ”‚    โ”œโ”€โ”€ ChatGPT (25m)                                        โ”‚
โ”‚    โ””โ”€โ”€ Reddit (5m)                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Requirements

Requirement Version Purpose
๐ŸชŸ Windows 10/11 Operating system
๐Ÿฆ€ Rust Latest Programming language
๐Ÿ”ง MSYS2 MinGW64 Latest Build environment
๐ŸŒ Microsoft Edge Latest App mode launcher

๐Ÿš€ Quick Start

1๏ธโƒฃ Installation

# Clone the repository
git clone https://github.com/itzmeJan/sysmonitor.git
cd sysmonitor

# Build the project
cargo build --release

2๏ธโƒฃ Running

# Start the monitor
cargo run --release

3๏ธโƒฃ Access Dashboard

  • ๐ŸŒ Auto-launch: Edge app window opens automatically
  • ๐Ÿ”— Manual: Visit http://localhost:3030
  • ๐Ÿ“ฑ App Mode: msedge --app http://localhost:3030 --window-size=800,600

๐Ÿ“Š What Happens When You Run

graph TD
    A[๐Ÿš€ Start Monitor] --> B[๐Ÿ“ Create usage.db]
    B --> C[๐ŸŒ Start Web Server :3030]
    C --> D[๐Ÿ“ฑ Launch Edge App]
    D --> E[๐Ÿ‘๏ธ Monitor Active Apps]
    E --> F[๐Ÿ’พ Flush to Database]
    F --> G[๐Ÿ”„ Update Dashboard]
    G --> E
    
    style A fill:#ff6b6b
    style B fill:#4ecdc4
    style C fill:#45b7d1
    style D fill:#96ceb4
    style E fill:#feca57
    style F fill:#ff9ff3
    style G fill:#54a0ff
Loading

๐ŸŽจ Web Interface Features

๐Ÿ“ฑ Dashboard Sections

Section Description Auto-refresh
๐ŸŽฏ Current Activity Active app, window title, URL โœ… 2s
๐Ÿ“Š Statistics Uptime, tracked apps, active count โœ… 2s
๐Ÿ“‹ Recent Activity Historical usage with hierarchical grouping โœ… 2s

๐ŸŒ™ Theme Support

  • ๐ŸŒž Light Mode: Clean, modern light theme
  • ๐ŸŒ™ Dark Mode: Auto-detects system preference
  • ๐ŸŽจ Glassmorphism: Modern glass-like design
  • ๐Ÿ“ฑ Responsive: Optimized for small PWA windows

๐Ÿ”Œ API Endpoints

Endpoint Method Description Response
/api/dashboard GET Dashboard data JSON
/api/health GET Health check JSON
/ GET Main dashboard HTML
/static/* GET Static assets CSS/JS

๐Ÿ“ Example API Response

{
  "uptime": 135,
  "total_apps": 25,
  "active_apps": [
    ["msedge.exe:http://localhost:3030", 45]
  ],
  "recent_activity": [
    {
      "app_name": "chrome.exe",
      "window_title": "GitHub",
      "url": "https://github.com",
      "timestamp": 1703123456,
      "duration": 900
    }
  ]
}

๐Ÿ’พ Database Schema

CREATE TABLE usage_logs (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    identifier TEXT NOT NULL,
    app_name TEXT NOT NULL,
    window_title TEXT NOT NULL,
    url TEXT,
    timestamp INTEGER NOT NULL,
    duration INTEGER NOT NULL
);

๐Ÿ“Š Data Flow

Active App โ†’ Identifier โ†’ HashMap โ†’ SQLite โ†’ Dashboard
    โ†“           โ†“           โ†“         โ†“         โ†“
msedge.exe โ†’ msedge.exe:URL โ†’ RAM โ†’ usage.db โ†’ Web UI

๐Ÿ—๏ธ Project Structure

๐Ÿ“ sysmonitor/
โ”œโ”€โ”€ ๐Ÿ“ src/
โ”‚   โ””โ”€โ”€ ๐Ÿ“„ main.rs              # ๐Ÿฆ€ Main Rust application
โ”œโ”€โ”€ ๐Ÿ“ web/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“„ index.html           # ๐ŸŒ Dashboard HTML
โ”‚   โ””โ”€โ”€ ๐Ÿ“ static/
โ”‚       โ”œโ”€โ”€ ๐Ÿ“„ style.css        # ๐ŸŽจ Modern CSS styling
โ”‚       โ””โ”€โ”€ ๐Ÿ“„ script.js        # โšก Dashboard JavaScript
โ”œโ”€โ”€ ๐Ÿ“„ Cargo.toml              # ๐Ÿ“ฆ Dependencies & config
โ”œโ”€โ”€ ๐Ÿ“„ usage.db                # ๐Ÿ’พ SQLite database
โ””โ”€โ”€ ๐Ÿ“„ README.md               # ๐Ÿ“– This file

โš™๏ธ Technical Details

๐Ÿ”ง Core Technologies

  • ๐Ÿฆ€ Rust: High-performance system programming
  • ๐ŸชŸ Win32 API: Windows system integration
  • ๐ŸŒ Warp: Async web server framework
  • ๐Ÿ’พ SQLite: Lightweight database
  • ๐ŸŽจ CSS3: Modern styling with custom properties
  • โšก JavaScript: Dynamic dashboard updates

๐Ÿš€ Performance Metrics

  • CPU Usage: <1% on idle systems
  • Memory Usage: <100MB with thousands of records
  • Update Frequency: Every 1 second
  • Database Flush: Every 30 seconds
  • Dashboard Refresh: Every 2 seconds

๐Ÿ”’ Thread Safety

  • Arc<Mutex<HashMap>> for shared state
  • Atomic operations for counters
  • Graceful error handling
  • Transaction-based database writes

๐ŸŽฏ Configuration

โฐ Timing Constants

const ACTIVITY_RETENTION_HOURS: u64 = 24;    // Keep data for 1 day
const MAX_RECENT_ACTIVITIES: usize = 1000;   // Show all activities

๐ŸŒ Server Settings

  • Port: 3030
  • Host: localhost
  • CORS: Enabled for local development

๐Ÿ”ฎ Future Enhancements

Feature Priority Status
๐Ÿ“Š Charts & Graphs High ๐Ÿšง Planned
๐Ÿ“ค Export (CSV/JSON) Medium ๐Ÿšง Planned
๐Ÿท๏ธ Activity Categories Medium ๐Ÿšง Planned
๐Ÿ”” Usage Notifications Low ๐Ÿ’ก Ideas
๐ŸŽจ Custom Themes Low ๐Ÿ’ก Ideas
๐Ÿ“ฑ Mobile App Low ๐Ÿ’ก Ideas

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch
  3. โœจ Make your changes
  4. ๐Ÿงช Test thoroughly
  5. ๐Ÿ“ Submit a pull request

๐Ÿ“„ License

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


๐Ÿ™ Acknowledgments

  • ๐Ÿฆ€ Rust Community for the amazing ecosystem
  • ๐ŸชŸ Microsoft for Windows API documentation
  • ๐ŸŒ Web Standards for modern browser APIs
  • ๐Ÿ’ก Open Source community for inspiration

Made with โค๏ธ and ๐Ÿฆ€ Rust

โญ Star this repo โ€ข ๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Request Feature

About

A lightweight Windows screen-time and activity monitor with a modern web-based GUI

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published