Adds a custom server.ts (http server + Next request handler + a noServer:true WebSocket server on /ws) so the app can push live data without polling. A CollectorScheduler runs one interval-based job per docker/database widget instance, backed by dockerode against /var/run/docker.sock, and reconciles jobs when config.yml changes. Config hot-reload is now fully wired: chokidar watches config.yml/.env, re-validates on change, and broadcasts config:update (or a non-destructive config:error, keeping the last-good config) to every connected browser. The client subscribes to per-widget topics over a single shared WebSocket with exponential-backoff reconnect and last-result caching for instant resubscribe. Verified end-to-end against real throwaway containers (nginx, redis): live CPU/mem/uptime/health streamed over the socket, interval changes picked up without a server restart, and a broken config.yml correctly falls back to the last-valid config instead of crashing the app.
39 lines
889 B
JSON
39 lines
889 B
JSON
{
|
|
"name": "pulsenode",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "tsx watch server.ts",
|
|
"build": "next build",
|
|
"start": "NODE_ENV=production tsx server.ts",
|
|
"lint": "eslint"
|
|
},
|
|
"dependencies": {
|
|
"chokidar": "^5.0.0",
|
|
"dockerode": "^5.0.1",
|
|
"dotenv": "^17.4.2",
|
|
"next": "16.3.1",
|
|
"p-limit": "^7.3.1",
|
|
"react": "19.2.8",
|
|
"react-dom": "19.2.8",
|
|
"systeminformation": "^5.33.1",
|
|
"ws": "^8.21.3",
|
|
"yaml": "^2.9.0",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4",
|
|
"@types/dockerode": "^4.0.1",
|
|
"@types/node": "^20",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"@types/ws": "^8.18.1",
|
|
"eslint": "^9",
|
|
"eslint-config-next": "16.3.1",
|
|
"tailwindcss": "^4",
|
|
"tsx": "^4.23.12",
|
|
"typescript": "^5"
|
|
},
|
|
"packageManager": "pnpm@11.21.0"
|
|
}
|