Skip to content

About

A lightweight, real-time server monitoring dashboard built with Go and vanilla JavaScript that provides live system metrics through a clean web interface with WebSocket updates.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

87 Commits

Folders and files

Repository files navigation

Minimalist Dashboard

Minimalist Dashboard

Lighthouse Scores Docker Image CI Docker Image Go Version License Live Demo

A lightweight, real-time server monitoring dashboard built with Go and vanilla JavaScript. This project provides a clean web interface to display live system metrics with real-time updates via WebSockets.

✨ Live Demo

πŸ”— dashboard.kheopsian.com

πŸ“‹ Features

Real-time System Monitoring

  • CPU Usage & Temperature: Live CPU utilization with thermal monitoring
  • Memory (RAM): Used, total, and percentage with visual progress bars
  • Storage: Disk usage monitoring with mount point detection
  • Network Traffic: Real-time network I/O with interactive charts
  • System Information: OS, kernel, CPU model, and uptime details

Advanced Storage Features

  • ZFS Pool Management: Complete ZFS pool configuration display
    • Data VDEVs and Cache VDEV visualization
    • Pool status and device health monitoring
  • ARC & L2ARC Cache: ZFS cache performance metrics
    • Hit rates, cache sizes, and efficiency monitoring

Container & Media Services

  • Docker Integration: Container, image, and volume counts
  • Media Library Monitoring: Track movies, TV shows, and anime collections
  • Streaming Activity: Real-time Plex integration for active playback and transcoding

Technical Highlights

  • Real-time Updates: Metrics refreshed every 2 seconds via WebSockets
  • Lightweight Architecture: Pure Go backend with vanilla JavaScript frontend
  • Responsive Design: Modern, clean interface with dark/light theme support
  • Containerized: Production-ready Docker deployment

πŸ›  Tech Stack

Backend

  • Go 1.25+ - High-performance server
  • Gorilla WebSocket - Real-time communication
  • Native system calls - Direct OS integration for metrics collection

Frontend

  • HTML5/CSS3 - Modern semantic markup
  • Vanilla JavaScript (ES6+) - No framework dependencies
  • Chart.js - Interactive network traffic visualization
  • Font Awesome - Professional iconography

Infrastructure

  • Docker - Containerized deployment
  • Multi-stage builds - Optimized production images
  • Alpine Linux - Minimal security footprint

πŸš€ Quick Start

Prerequisites

Docker Deployment (Recommended)

Using Pre-built Image (GitHub Container Registry)

# Pull and run the latest image (Mount your appdata directory)
docker run --network host -v /path/to/your/appdata:/app/data ghcr.io/Kheopsian/minimalist-dashboard:main

Building from Source

# Clone the repository
git clone https://github.com/Kheopsian/minimalist-dashboard.git
cd minimalist-dashboard

# Build and run with Docker
docker build -t minimalist-dashboard .
docker run --network host -v $(pwd):/app/data minimalist-dashboard

Access the dashboard at http://localhost:9254

Local Development

# Clone and enter directory
git clone https://github.com/Kheopsian/minimalist-dashboard.git
cd minimalist-dashboard

# Install dependencies
go mod download

# Run the application
go run main.go

βš™οΈ Configuration

Configure the application using a config.json file. You can find a template in config.example.json.

{
  "WebUIPort": "9254",
  "PathFilms": "/path/to/films",
  "PathSeries": "/path/to/series",
  "PathAnimes": "/path/to/animes",
  "NetInterface": "eth0",
  "PlexURL": "http://localhost:32400",
  "PlexToken": "your-plex-token-here",
  "ZpoolDiskAliases": {
    "ata-WDC_WD100EFAX-68LHPN0_7SGLX12C": "Western Digital 10TB",
    "/dev/sdb1": "SSD Cache Samsung 1TB",
    "scsi-35000c500b52be35r": "SAS Seagate Exos 18TB"
  }
}

The dashboard allows you to define "pretty names" for your hard drives in the ZFS interface using the ZpoolDiskAliases block. This is completely optional, as the Unraid script automatically injects your real drive models (e.g., Samsung SSD, Seagate Exos...) via lsblk directly into the Dashboard!

If you want to manually override a name, add its identifier to ZpoolDiskAliases.

Example Docker Configuration

Make sure to map the path to your data directory containing config.json and optionally zpool_status.txt when running the container.

docker run --network host \
  -v /path/to/your/appdata:/app/data:ro \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v /mnt/media:/mnt/media:ro \
  -v /proc/spl/kstat/zfs/arcstats:/app/arcstats:ro \
  ghcr.io/Kheopsian/minimalist-dashboard:main

Docker Compose

version: '3.8'
services:
  dashboard:
    image: ghcr.io/Kheopsian/minimalist-dashboard:main
    network_mode: host
    volumes:
      - /path/to/your/appdata:/app/data:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /mnt/media:/mnt/media:ro
      - /proc/spl/kstat/zfs/arcstats:/app/arcstats:ro

Unraid Installation

For Unraid users, an XML template is provided for a seamless setup:

  1. Copy the unraid-template.xml file into your Unraid flash drive under config/plugins/dockerMan/templates-user/.
  2. Go to your Unraid Docker tab.
  3. Click Add Container and select minimalist-dashboard from the dropdown list of User Templates.
  4. Ensure you place your config.json (based on config.example.json) in the /mnt/user/appdata/minimalist-dashboard/ folder before starting the container. The template will automatically map this entire directory.

ZFS Monitoring on Unraid (Important)

Due to container limitations, the dashboard needs to read ZFS status from a file generated by the Unraid host.

  1. Install the User Scripts plugin on Unraid if you haven't already.
  2. Create a new script, set it to run on a Custom schedule (e.g., * * * * * for every minute).
  3. Paste the following script:
#!/bin/bash

# Configuration du dossier de destination
OUTPUT_DIR="/mnt/user/appdata/minimalist-dashboard"
ZPOOL_FILE="$OUTPUT_DIR/zpool_status.txt"
MODELS_FILE="$OUTPUT_DIR/disk_models.txt"

# CrΓ©ation du dossier si inexistant
mkdir -p "$OUTPUT_DIR"

# GΓ©nΓ©ration du statut ZFS (Ajustez 'datapool' Γ  votre nom de pool ZFS)
if zpool status datapool > "$ZPOOL_FILE"; then
    echo "Statut ZFS mis Γ  jour : $(date)"
else
    echo "Erreur lors de la mise Γ  jour du statut ZFS"
fi

# Exportation automatique des jolis noms de disques (Samsung, Seagate...)
lsblk -dn -o KNAME,MODEL > "$MODELS_FILE"

# Ajustement des permissions
chmod 644 "$ZPOOL_FILE" "$MODELS_FILE"

πŸ— Architecture

Backend Components

  • MetricsService: Orchestrates all system metric collection
  • WebSocketHandler: Manages real-time client connections
  • Service Layer: Specialized services for different system components
    • SystemService - OS and hardware information
    • CPUService - Processor metrics and thermal data
    • StorageService - Disk usage and network statistics
    • ZFSService - ZFS pool and cache management
    • DockerService - Container platform integration
    • StreamingService - Media library and Plex monitoring

Data Flow

  1. Metric Collection: Backend services gather system data every 2 seconds
  2. WebSocket Broadcasting: Real-time metrics pushed to connected clients
  3. Frontend Updates: JavaScript dynamically updates UI components
  4. Chart Rendering: Network traffic visualized with Chart.js

πŸ“Š Monitoring Capabilities

System Metrics

  • CPU usage percentage and temperature monitoring
  • Memory utilization with detailed breakdown
  • Disk space monitoring across mount points
  • Network interface traffic analysis

ZFS Integration

  • Pool health and configuration display
  • RAIDZ/Mirror VDEV visualization
  • ARC and L2ARC cache performance
  • Device-level status monitoring

Container Platform

  • Docker container lifecycle tracking
  • Image and volume inventory
  • Resource usage correlation

Media Services

  • Library size tracking (movies, shows, anime)
  • Active streaming session monitoring
  • Transcoding activity detection

🐳 Production Deployment

The included Dockerfile uses multi-stage builds for optimal production images:

# Build stage with full Go toolchain
FROM golang:1.25-alpine AS builder
# ... build process

# Runtime stage with minimal dependencies
FROM alpine:latest
RUN apk --no-cache add ca-certificates docker-cli zfs
# ... final image

Security Considerations

  • Minimal Alpine Linux base image
  • Non-root execution context
  • Read-only filesystem mounts where possible
  • Secure Docker socket access patterns

πŸ”§ Development

Project Structure

minimalist-dashboard/
β”œβ”€β”€ main.go                 # Application entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ config/            # Configuration management
β”‚   β”œβ”€β”€ handlers/          # HTTP and WebSocket handlers
β”‚   β”œβ”€β”€ models/            # Data structures
β”‚   β”œβ”€β”€ services/          # Business logic layer
β”‚   └── utils/             # Helper functions
β”œβ”€β”€ frontend/              # Static web assets
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ css/          # Stylesheets and fonts
β”‚   β”‚   └── js/           # JavaScript modules
β”‚   └── *.html            # HTML templates
└── Dockerfile            # Container build configuration

Building from Source

# Development build
go build -o dashboard-api

# Production build (static binary)
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o dashboard-api

πŸ“„ License

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

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

πŸ”— Related Projects

About

A lightweight, real-time server monitoring dashboard built with Go and vanilla JavaScript that provides live system metrics through a clean web interface with WebSocket updates.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages