Data flow, state machine, component map, and database schema
news_alert_pipeline.py
NewsService.fetch_news_for_watchlist()high + critical onlySubscriptionService.get_matching_users()user_alerts per user (deduped)sub.ticker IN article.tickersai_analysisarticle.significance >= sub.min_significance"all" = match everything, "macro" = macro news typesubscription_service.py
AI semiconductors → NVDA, AMD, AVGO, INTC, QCOM, ARM, MRVL, TSMAI infrastructure → NVDA, AMD, AVGO, SMCI, DELL, HPE, VRT, ANETcloud → AMZN, MSFT, GOOGL, ORCL, CRM, SNOW, NET, DDOGsoftware → MSFT, CRM, NOW, ADBE, PLTR, SNOW, DDOG, MDB, PANW, CRWDcybersecurity → PANW, CRWD, FTNT, ZS, Slow(0) < medium(1) < high(2) < critical(3)
backend/app/api/routes/user_alerts.py
//unread-count/{id}/save/{id}/pass/{id}/analyze/{id}/read/subscriptions/subscriptions/subscriptions/{id}/pipeline/runuseUserAlerts hook
frontend/lib/hooks/useUserAlerts.ts
useMemo filters into inbox / saved / historyuser_slug=eq.{slug}alert_chat_service.py
/chat?conversation_id=X