Add WebSocket infrastructure for shared sessions with Azure deployment and persistence#3
Draft
Add WebSocket infrastructure for shared sessions with Azure deployment and persistence#3
Conversation
- Add WebSocket server implementation (server/) - Add client-side hooks (useWebSocket, useSharedState) - Add connection status UI component - Add session management utilities - Add comprehensive documentation and examples - Update README with WebSocket setup instructions - Add .env.example for configuration - Fix linting errors in App.jsx Co-authored-by: aatmmr <15815012+aatmmr@users.noreply.github.com>
Co-authored-by: aatmmr <15815012+aatmmr@users.noreply.github.com>
Use Node.js built-in crypto.randomUUID() instead of external uuid package. Update documentation to reflect this change. Co-authored-by: aatmmr <15815012+aatmmr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate additions for shared sessions via websocket
Add WebSocket infrastructure for shared sessions
Nov 3, 2025
Owner
|
@copilot Consider:
|
- Add Azure Table Storage persistence for session data - Implement configurable session expiration (default 24 hours) - Add automatic cleanup of expired sessions - Create comprehensive Azure deployment guide - Update documentation for Azure-first architecture - Support both Azure and alternative hosting platforms - Add environment variables for persistence configuration Co-authored-by: aatmmr <15815012+aatmmr@users.noreply.github.com>
Author
Updated the implementation to support:
Server now supports:
See commit 63cf63c for all changes. |
Copilot
AI
changed the title
Add WebSocket infrastructure for shared sessions
Add WebSocket infrastructure for shared sessions with Azure deployment and persistence
Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements complete WebSocket infrastructure to enable real-time collaboration across multiple clients with session persistence. The solution is opt-in via environment variables and falls back gracefully to localStorage when disabled.
Architecture
Server (
server/)wslibrary (Azure SDK optional)Client (
src/)useWebSocket- Connection management with exponential backoff reconnectionuseSharedState- Drop-in replacement for existinguseKVhook, syncs via WebSocket when connectedsessionManager- Secure session ID generation and URL-based session sharingConnectionStatus- Real-time connection status indicator with active user countSession Persistence
Sessions are persisted to Azure Table Storage with configurable expiration:
SESSION_MAX_DURATION_HOURS(default 24 hours)Usage
Configuration
Documentation
AZURE_DEPLOYMENT.md- Azure deployment guide (recommended)WEBSOCKET_INVESTIGATION.md- Technical architecture and design decisionsWEBSOCKET_SETUP.md- Deployment guide for all platforms (Azure/Railway/Render/Heroku)INTEGRATION_EXAMPLE.md- Code examples and migration patternsWEBSOCKET_SUMMARY.md- Complete feature overviewDeployment
Recommended: Azure - Both frontend and backend hosted on Azure App Service with Azure Table Storage for session persistence.
Alternative: Frontend on GitHub Pages, WebSocket server on Railway/Render/Heroku with memory-only sessions.
The app functions identically with WebSocket disabled - no breaking changes.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.