| Write python code to Build an API endpoint for real-time notifications via Server-Sent Events using Flask. accepts GET /notifications/stream; validates user auth; streams events; handles connection lifecycle; closes on timeout. Structure the project as: app/, routes/notifications.py, handlers/sse_handler.py. Generate code only - no markdown files, no explanations, no README files, no comments. Keep output concise and purpose-ready. |