Implement real-time updates using WebSocket connections with reconnection logic
Implement a real-time feature for {{PROJECT_CONTEXT}} using WebSockets:
Requirements:
1. WebSocket server setup with authentication
2. Client connection management with auto-reconnect
3. Room/channel support for targeted broadcasts
4. Message types: join, leave, update, notification
5. Connection status indicator in UI
6. Graceful degradation when WebSocket is unavailable
Provide:
- Server-side WebSocket handler
- Client-side connection hook
- Message type definitions
- Reconnection with exponential backoff
- Heartbeat/ping mechanism
- Error handling and fallback to polling
- UI component showing connection statusAdding real-time features to applications