Replace polling with real-time SSE stream and eliminate Python API dependency

- Add single /api/events SSE endpoint replacing 5 separate polling intervals
- Query Prometheus directly for system stats (replaces Python API on port 9876)
- Query Coolify PostgreSQL directly for deployments (replaces SSH/tinker approach)
- Add EventManager singleton for server-side polling + client broadcast
- Add useEventStream hook with exponential backoff reconnection
- Add live deployment log streaming via SSE for in-progress builds
- Add redeploy button and live duration counter in deployments table
- Add SSE connection indicator in header (green=live, red=offline)
- Externalize all hardcoded 192.168.1.3 references to env vars via config.ts
- Reduce API route code by ~400 lines through shared library modules

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Alejandro Gutiérrez
2026-02-04 00:43:41 +01:00
parent d4053812cd
commit 9e683eba22
20 changed files with 1064 additions and 795 deletions

View File

@@ -12,6 +12,7 @@
"dependencies": {
"@tanstack/react-table": "^8.21.3",
"next": "16.1.6",
"pg": "^8.18.0",
"react": "19.2.3",
"react-dom": "19.2.3",
"recharts": "^3.7.0"
@@ -19,6 +20,7 @@
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/pg": "^8.16.0",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",