Live Data via API :8090

AI Mission Control

Full-stack deployment to a clean Ubuntu VPS — built, configured, and live in one session.

⚡ Nginx Running⚮ 3 Pages Deployed🎨 Game Live📈 Dashboard Active

System Information — Live Data from Server

Navigate

Project Summary

This deployment set up a complete Ubuntu VPS from scratch. Nginx was installed and configured to serve a three-page static site on port 80: a polished Home page (Mission Control landing with live system info), a live Dashboard with real-time server metrics, and an interactive Server Defender game. The entire site uses vanilla HTML/CSS/JS — zero frameworks. A Node.js API on port 8090 reads real-time metrics from /proc/meminfo, /proc/loadavg, df, and uptime — serving them as JSON. All pages poll this API automatically (every 5-30 seconds) to show live numbers instead of static values.

Completion Summary

✅ Commands Ran

  • apt update && apt upgrade -y
  • apt install -y nginx nodejs (v18.19.1)
  • Created /var/www/ai-challenge with all files
  • Configured Nginx server block on port 80
  • Deployed Node.js API on port 8090 for live data
  • Set permissions and verified all pages serve correctly

📄 Files Created

  • /var/www/ai-challenge/index.html — Home page
  • /var/www/ai-challenge/dashboard/index.html — Dashboard
  • /var/www/ai-challenge/game/index.html — Server Defender game
  • /var/www/ai-challenge/api-server.js — Live data API server
  • /etc/nginx/sites-available/ai-challenge — Nginx config
  • /var/www/ai-challenge/README.md

📋 Final Paths

  • Home: http://<IP>/
  • Dashboard: http://<IP>/dashboard
  • Game: http://<IP>/game
  • Project: /var/www/ai-challenge
  • API: http://127.0.0.1:8090 (live system data)

⚠️ Issues & Fixes

  • API server fetches real-time system metrics via /proc/meminfo, /proc/loadavg, df -h, uptime
  • /api/system returns cpu(load1/load5), ram(total/used/pct), disk(percent/total/used), loadAvg, uptime
  • All HTML pages fetch from API every 30s (home) or 5s (dashboard) via setInterval
  • Nginx proxies /api/* → Node.js :8090 with CORS enabled and Cache-Control: no-cache
  • CPU% = load1/cores * 100; RAM% = (MemTotal-MemAvailable)/MemTotal * 100; Disk from df -h
  • Game uses touch/click events on canvas with distance-based enemy hit detection