A complete and modern web dashboard for real-time monitoring of server performance
- Real-time monitoring of CPU, memory, disk usage, and temperature sensors
- Hardware sensors integration for temperature, humidity, pressure, and gas levels
- Document scanner feature with email sending capability
- Navigate and control the dashboard with keyboard only
- Process monitoring with resource usage details
- Logs viewer
- Kiosk mode for full-screen display on dedicated monitors
- Cache Ram usage monitoring and clearing
View active processes on the server along with their CPU and memory usage.
Access and view system logs directly from the dashboard.
Scan documents using a connected scanner and send them via email directly from the dashboard.
You can try the live demo here.
Warning
You should use a 1920x1080 resolution
- Node.js v24.x or higher
- pnpm (recommended) or npm
- PM2 (optional, for production deployment)
- Hardware sensors support (for temperature monitoring, I used an Lilygo T-display with an ATH20 + BMP280 and a MQ-125 gas sensor; you can find the code in the
extras/code.inofolder)
# Clone the repository
git clone repository-url>gt;
cd kiosk
# Install dependencies
pnpm install
# Build the project
pnpm build
# Start the server with pm2
pm2 start ecosystem.config.js
# Start the websocket for the environment sensors (optional)
pm2 start pnpm --name sensor-ws -- tsx sensors-ws-server.ts
# Save the pm2 process list and configure it to start on boot
pm2 save
# Or start in development mode
pnpm devv The application will be available at http://localhost:3000
To monitor hardware sensors like temperature, humidity, and gas levels, you can use an ESP32 microcontroller with appropriate sensors (e.g., ATH20 for temperature/humidity, BMP280 for pressure, MQ-125 for gas detection).
You can find the Arduino code and PlatformIO configuration in the extras/code.ino directory for a Lilygo T-Display board.
Run the application in full-screen kiosk mode on a dedicated monitor, perfect for server rooms or monitoring stations.
Note
This setup has been tested on Ubuntu Server
- A monitor connected to your server
- Chromium or Firefox browser with kiosk mode support
- A minimal window manager (like Openbox)
sudo apt update
sudo apt install --no-install-recommends \
xserver-xorg x11-xserver-utils xinit openbox chromium-browserersudo adduser kiosk
sudo usermod -aG audio,video,tty,dialout kioskknano /home/kiosk/.xinitrcAdd the following lines:
#!/bin/bash
# Disable screen blanking and power management
xset s off
xset -dpms
xset s noblank
k
# Wait for X to be fully started
sleep 2
# Launch Chromium in kiosk mode
chromium-browser \
--noerrdialogs \
--disable-infobars \
--disable-session-crashed-bubble \
--kiosk \
http://localhost:3000t:3000chmod +x /home/kiosk/.xinitrcEdit the getty service for TTY1:
sudo mkdir -p /etc/systemd/system/[email protected]
sudo nano /etc/systemd/system/[email protected]/override.conffAdd the following lines:
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin kiosk --noclear %I $TERMsudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl restart getty@tty1y1nano /home/kiosk/.bash_profileAdd the following lines:
if [[ -z $DISPLAY &∓& $XDG_VTNR -eq 1 ]]; then
startx
fisudo rebootAfter reboot, the system should automatically:
- Log in the kiosk user on TTY1
- Start the X server
- Launch Chromium in full-screen mode
- Display the dashboard at
http://localhost:3000
Important
Ensure your Next.js application is configured to start on boot using PM2:
pm2 startup
pm2 saveepnpm dev # Start development server with hot reload
pnpm build # Build for production
pnpm start # Start production server
pnpm lint # Run ESLint code lintingkiosk/
βββ app/ # Next.js App Directory
β βββ api/ # API Routes
β β βββ cache/ # Endpoint to clear memory cache
β β βββ disk/ # Endpoint to get disk usage
β β βββ logs/ # Endpoint to fetch system logs
β β βββ stats/ # Endpoint to get CPU, memory stats and sensors
β β βββ processes/ # Endpoint to get active processes
β β βββ sendMail/ # Endpoint to send scans email
β βββ components/ # Components specific to app routes
β β βββ modals/ # Dialog and modals
β β βββ utilities/ # Utility components
β βββ services/ # Scan and demo service
β βββ scans/ # Scanned files route
βββ components/ # Components used across the app
β βββ scanner/ # Scanner components
β βββ ui/ # shadcn UI components
βββ hooks/ # Hooks
βββ lib/ # Utilities and helpers
βββ pages/ # API Routes for scanner and JWT validation
βββ extras/ # PlatformIO configuration with Arduino code, send mail route
βββ public/ # Static files
# Static files
Create a .env file in the root of the project with the following variables:
# Mail server configuration (for scanner feature)
MAIL_SERVICE_URL="your_mail_service_url"
JWT_SECRET_KEY="your_mail_server_secret_key"
# Server configuration
HOSTNAME="your_server_hostname"
# WiFi configuration (displayed in scanner QR codes)
NEXT_PUBLIC_WIFI_SSID="your_wifi_ssid"The application supports a demo mode for testing without requiring real server data or hardware sensors. This is useful for development and testing purposes.
To enable demo mode, add the following environment variable to your .env file:
NEXT_PUBLIC_DEMO_MODE=trueWhen enabled, the dashboard will display simulated data for all monitoring features.
GET /api/stats- Fetch CPU, memory usage, and sensor dataGET /api/disk- Get disk usage informationGET /api/cache- Retrieve cached sensor dataGET /api/logs- Fetch system logsGET /api/processes- List active processes with resource usage
POST /api/sendMail- Send scanned documents via emailGET /scans/[file]- Retrieve a specific scanned file
AI helped me with code snippets, autocompletion, debugging, bug fixes, formatting raw data and styling suggestions
This project is licensed under the MIT License. See the LICENSE file for details.