672 0e8c9f7bff feat: init pc-monitor project
- Client: Go-based Windows hardware monitoring (CPU, GPU, memory, disk, network, power)
- Server: Go + Gin + SQLite backend with REST API
- Frontend: Vue 3 + Element Plus dashboard
- Docker deployment support
- Windows service installation script
2026-05-17 01:29:44 +08:00
2026-05-17 01:29:44 +08:00
2026-05-17 01:29:44 +08:00
2026-05-17 01:29:44 +08:00
2026-05-17 01:29:44 +08:00
2026-05-17 01:29:44 +08:00

PC Monitor

A monitoring system for Windows PCs that tracks CPU, GPU, memory, network, disk, and power status.

Architecture

  • Client: Windows executable (.exe) that collects hardware metrics
  • Server: Go backend with SQLite database
  • Frontend: Vue 3 + Element Plus web dashboard
  • Deployment: Docker support for server

Quick Start

Server (Docker)

  1. Build and start the server:
docker-compose up -d
  1. Access the web dashboard at http://localhost:8080

Client (Windows)

  1. Download the client executable
  2. Edit config.yaml to set your server URL
  3. Run the client:
.\pc-monitor-client.exe

Or install as a Windows service:

.\install\install.ps1 -ServerUrl "http://your-server:8080"

Development

Prerequisites

  • Go 1.21+
  • Node.js 18+
  • Docker (optional)

Build Server

cd server
go mod tidy
go build -o server .

Build Client

cd client
go mod tidy
go build -o pc-monitor-client.exe .

Build Frontend

cd web
npm install
npm run build

API Endpoints

Device Management

  • POST /api/v1/register - Register a new device
  • GET /api/v1/devices - List all devices
  • GET /api/v1/devices/:id - Get device details
  • DELETE /api/v1/devices/:id - Delete a device
  • POST /api/v1/devices/:id/heartbeat - Send heartbeat

Metrics

  • POST /api/v1/report - Report metrics
  • GET /api/v1/devices/:id/metrics/latest - Get latest metrics
  • GET /api/v1/devices/:id/metrics/history - Get metrics history

Alerts

  • GET /api/v1/alerts - List active alerts
  • POST /api/v1/alerts/rules - Create alert rule
  • GET /api/v1/devices/:id/alerts/rules - Get device alert rules
  • DELETE /api/v1/alerts/rules/:id - Delete alert rule
  • POST /api/v1/alerts/:id/resolve - Resolve alert

Configuration

Server Configuration (config.yaml)

server:
  addr: ":8080"

database:
  path: "./data/monitor.db"
  retention_days: 30

auth:
  admin_password: "admin123"

Client Configuration (config.yaml)

server:
  url: "http://your-server:8080"
  token: ""

collect:
  interval: 30s

report:
  interval: 60s

License

MIT License

Description
Windows 电脑硬件监控系统 - 支持 CPU、GPU、内存、磁盘、网络、电源等信息采集与展示
Readme 58 KiB
Languages
Go 53.6%
Vue 38.4%
PowerShell 4.1%
TypeScript 3%
HTML 0.5%
Other 0.4%