Back to prompts
Build a WebSocket server for real-time communication. Requirements: - Framework: [NODE.JS WITH WS / SOCKET.IO / FASTIFY / etc.] - Use case: [CHAT / LIVE NOTIFICATIONS / REAL-TIME DASHBOARD / COLLABORATIVE EDITING] - Authentication: [JWT / SESSION / NONE] - Expected concurrent connections: [APPROX] - Persistence needed: [REDIS FOR PUB/SUB / IN-MEMORY / DATABASE] Provide: 1. Server setup with connection handling 2. Event structure (how messages are typed and dispatched) 3. Authentication/authorisation middleware 4. Room or channel management (if applicable) 5. Reconnection handling on the client side 6. Basic client-side example to connect and send/receive messages 7. Scaling considerations (what to change when going beyond a single server)
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.