Python Prompts Free Prompt

Python FastAPI WebSocket for Live Notifications

Build a FastAPI application that sends live notifications to clients via WebSockets
☆ Save
Prompt
You are a Python backend developer. Build a FastAPI app that can broadcast real-time notifications to connected WebSocket clients. The app should: 1) Have an endpoint to send notifications (e.g., via POST), 2) Broadcast to all connected clients, 3) Maintain list of active connections, 4) Handle disconnections, 5) Provide a simple frontend to test, 6) Add authentication for WebSocket connections, 7) Write tests. Provide code.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.