feat(web-dashboard): add rest api and real-time sync

REST API & CRUD:
- Add REST API routes for profiles, cliproxy, accounts
- Integrate React Query with data fetching hooks
- Create API client wrapper with TypeScript types
- Add shadcn/ui components (dialog, input, label, table)
- Build profiles table with edit/delete actions
- Create profile form dialog with zod validation
- Mount QueryClientProvider in App

Real-time Sync & WebSocket:
- Implement file watcher with chokidar for config changes
- Create WebSocket server with broadcast capability
- Add client auto-reconnect with exponential backoff
- Integrate React Query cache invalidation on WS messages
- Add connection status indicator in header
- Implement heartbeat keepalive (30s interval)
- Add graceful cleanup on server shutdown
- Show toast notifications for external config changes

Dependencies:
- Add @tanstack/react-query, react-table, react-hook-form, zod
- Add chokidar for file watching
This commit is contained in:
kaitranntt committed 2025-12-07 12:00:56 -05:00
1 parent 6a6f2a2463
commit 56502ab6a8
25 files changed
+2230 -5024

No files matched your search

+7 -5
View File
@@ -64,17 +64,18 @@
"test:unit": "bun test tests/unit/",
"test:npm": "bun test tests/npm/",
"test:native": "bash tests/native/unix/edge-cases.sh",
"ui:dev": "cd ui && npm run dev",
"ui:build": "cd ui && npm run build",
"ui:preview": "cd ui && npm run preview",
"prepublishOnly": "npm run validate && node scripts/sync-version.js",
"prepack": "npm run validate && node scripts/sync-version.js",
"ui:dev": "cd ui && bun run dev",
"ui:build": "cd ui && bun run build",
"ui:preview": "cd ui && bun run preview",
"prepublishOnly": "bun run validate && node scripts/sync-version.js",
"prepack": "bun run validate && node scripts/sync-version.js",
"prepare": "husky",
"postinstall": "node scripts/postinstall.js"
},
"dependencies": {
"boxen": "^8.0.1",
"chalk": "^5.6.2",
"chokidar": "^5.0.0",
"cli-table3": "^0.6.5",
"express": "^4.18.2",
"get-port": "^7.0.0",
@@ -89,6 +90,7 @@
"@commitlint/config-conventional": "^20.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/chokidar": "^2.1.7",
"@types/express": "^4.17.21",
"@types/node": "^20.19.25",
"@types/ws": "^8.5.10",