feat: real-time alerts via WebSocket push notifications

- Add ws WebSocket server (port 3001) with JWT auth and user-socket mapping
- Add WebSocket client with exponential backoff reconnection and heartbeat
- Add useRealtimeAlerts hook with toast notifications and unread badge
- Add alert.publisher service (WS → push → email fallback)
- Integrate publisher into DarkWatch, VoicePrint, HomeTitle, SpamShield, RemoveBrokers
- Update Navbar with connection status indicator and unread count
- Add comprehensive tests (14 passing) for server, client, and publisher
This commit is contained in:
2026-05-25 17:58:47 -04:00
parent 3a8e329f02
commit c02457c66a
16 changed files with 1197 additions and 26 deletions

6
pnpm-lock.yaml generated
View File

@@ -112,6 +112,9 @@ importers:
vite:
specifier: ^7.0.0
version: 7.3.3(@types/node@25.9.1)(jiti@2.7.0)(lightningcss@1.32.0)(terser@5.48.0)(tsx@4.22.3)
ws:
specifier: ^8.21.0
version: 8.21.0
devDependencies:
'@types/node-cron':
specifier: ^3.0.11
@@ -119,6 +122,9 @@ importers:
'@types/pg':
specifier: ^8.20.0
version: 8.20.0
'@types/ws':
specifier: ^8.18.1
version: 8.18.1
drizzle-kit:
specifier: ^0.31.10
version: 0.31.10