mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 08:55:58 +03:00
[GH-ISSUE #208] Implement SSE starlette & deprecate polling mechanism #484
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#484
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AJaySi on GitHub (Aug 18, 2025).
Original GitHub issue: https://github.com/AJaySi/ALwrity/issues/208
Originally assigned to: @AJaySi on GitHub.
SSE Migration Strategy & Implementation Plan
🚨 Current Implementation Problems
Backend Issues
SSEAIServiceManagerwith lambda functions is overly complexsse_yieldfunction using__anext__()is fragileFrontend Issues
Architecture Problems
🎯 Proposed Solution: Clean SSE with sse-starlette
Phase 1: MVP Polling Solution (1-2 hours)
Goal: Get strategy generation working immediately with simple polling
Implementation:
Benefits:
Phase 2: Proper SSE Implementation (1-2 days)
Goal: Implement clean, reusable SSE infrastructure
Implementation:
sse-starlettefor backend SSEBenefits:
🏗️ Technical Architecture
Backend: sse-starlette Implementation
Core SSE Module (
backend/services/sse/)SSE Manager Features
Message Format Standardization
Frontend: Reusable SSE Client
Core SSE Module (
frontend/src/services/sse/)SSE Client Features
React Hook (
frontend/src/hooks/useSSE.ts)📋 Implementation Phases
Phase 1: MVP Polling (Immediate - 1-2 hours)
Backend Changes
ai_generation_endpoints.pyFrontend Changes
ContentStrategyBuilder.tsxFiles to Modify
backend/api/content_planning/api/content_strategy/endpoints/ai_generation_endpoints.pyfrontend/src/components/ContentPlanningDashboard/components/ContentStrategyBuilder.tsxfrontend/src/services/contentPlanningApi.tsPhase 2: Clean SSE Infrastructure (1-2 days)
Backend Implementation
backend/services/sse/)Frontend Implementation
frontend/src/services/sse/)New Files to Create
Phase 3: Migration & Testing (1 day)
Migration Steps
Testing Strategy
🔧 Technical Specifications
Backend SSE Manager Interface
Frontend SSE Client Interface
Message Format Specification
🎯 Success Criteria
Phase 1 Success Criteria
Phase 2 Success Criteria
Phase 3 Success Criteria
🚀 Migration Benefits
Immediate Benefits (Phase 1)
Long-term Benefits (Phase 2+)
📝 Implementation Notes
Dependencies
sse-starlettepackageConfiguration
Monitoring & Logging
Security Considerations
🔄 Rollback Plan
If Phase 1 Fails
If Phase 2 Fails
If Phase 3 Fails
📚 References & Resources
Documentation
Best Practices
Examples & Templates
Next Steps: