Skip to content

EXELVI/server-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

648ee89Β Β·Β Β· Feb 9, 2026

History

10 Commits
Feb 9, 2026
Jan 1, 2026
Feb 9, 2026
Feb 9, 2026
Jan 9, 2026
Jan 9, 2026
Feb 9, 2026
Jan 9, 2026
Jan 2, 2026
Jan 1, 2026
Jan 1, 2026
Feb 3, 2026
Jan 1, 2026
Jan 1, 2026
Jan 1, 2026
Jan 1, 2026
Feb 9, 2026
Jan 9, 2026
Jan 9, 2026
Jan 1, 2026
Jan 1, 2026
Feb 9, 2026
Jan 1, 2026
Feb 3, 2026
Jan 1, 2026

Repository files navigation

πŸ–₯️ Server Dashboard

Dashboard Preview

A complete and modern web dashboard for real-time monitoring of server performance

Stars Forks Issues License Repo Size

Next.js React

✨ Main Features

  • 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

πŸ–₯️ Process Monitoring

Processes Preview

View active processes on the server along with their CPU and memory usage.

πŸ—’οΈ Logs Viewer

Logs Preview

Access and view system logs directly from the dashboard.

πŸ–¨οΈ Scan Feature

Scan Preview

Scan documents using a connected scanner and send them via email directly from the dashboard.

🌐 Demo

You can try the live demo here.

Warning

You should use a 1920x1080 resolution

πŸš€ Quick Start

πŸ› οΈ Prerequisites

  • Node.js v24.x or higher
  • pnpm (recommended) or npm
  • PM2 (optional, for production deployment)

πŸ› οΈ Hardware Requirements (Optional)

  • 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.ino folder)

πŸ–₯️ Installation

# 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

🌑️ Environment Sensors Setup

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.

πŸ–₯️ Kiosk Mode

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

πŸ–₯️ Requirements

  • A monitor connected to your server
  • Chromium or Firefox browser with kiosk mode support
  • A minimal window manager (like Openbox)

1. Install the necessary packages:

sudo apt update
sudo apt install --no-install-recommends \
  xserver-xorg x11-xserver-utils xinit openbox chromium-browserer

2. Create a dedicated user for the kiosk:

sudo adduser kiosk
sudo usermod -aG audio,video,tty,dialout kioskk

3. Create an .xinitrc file in the kiosk user's home directory:

nano /home/kiosk/.xinitrc

Add 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:3000

4. Make the .xinitrc file executable:

chmod +x /home/kiosk/.xinitrc

5. Automated login on TTY1

Edit the getty service for TTY1:

sudo mkdir -p /etc/systemd/system/[email protected]
sudo nano /etc/systemd/system/[email protected]/override.conff

Add the following lines:

[Service]

ExecStart=

ExecStart=-/sbin/agetty --autologin kiosk --noclear %I $TERM

6. Apply the changes and enable auto-start of X on login:

sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl restart getty@tty1y1

7. Auto-start startx on login

nano /home/kiosk/.bash_profile

Add the following lines:

if [[ -z $DISPLAY &∓& $XDG_VTNR -eq 1 ]]; then
  startx

fi

8. Reboot and verify

sudo reboot

After reboot, the system should automatically:

  1. Log in the kiosk user on TTY1
  2. Start the X server
  3. Launch Chromium in full-screen mode
  4. Display the dashboard at http://localhost:3000

Important

Ensure your Next.js application is configured to start on boot using PM2:

pm2 startup
pm2 savee

πŸ“¦ Available Scripts

pnpm dev      # Start development server with hot reload
pnpm build     # Build for production
pnpm start     # Start production server
pnpm lint      # Run ESLint code linting

πŸ—οΈ Project Structure

kiosk/
β”œβ”€β”€ 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

πŸ”§ Configuration

Environment Variables

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"

πŸ§ͺ Demo Mode

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=true

When enabled, the dashboard will display simulated data for all monitoring features.

πŸ”Œ API Endpoints

Monitoring

  • GET /api/stats - Fetch CPU, memory usage, and sensor data
  • GET /api/disk - Get disk usage information
  • GET /api/cache - Retrieve cached sensor data
  • GET /api/logs - Fetch system logs
  • GET /api/processes - List active processes with resource usage

πŸ–¨οΈ Scanner

  • POST /api/sendMail - Send scanned documents via email
  • GET /scans/[file] - Retrieve a specific scanned file

πŸ€– AI Usage

AI helped me with code snippets, autocompletion, debugging, bug fixes, formatting raw data and styling suggestions

πŸ“„ License

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

Built by EXELVI with ❀️

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published