AlphaBrief
Your desk. Your edge. Every morning.

A fixed income and macro newsletter platform built solo. A capital markets analyst can go from zero to a ranked, AI-summarized, commentary-annotated HTML newsletter with live Treasury yield data and technical levels — ready to send — without touching a text editor. Full editorial control: re-summarize any article, swap sources, or add by topic from the draft editor.
Built without an ESP dependency by design: SMTP credentials are AES-256-GCM encrypted at rest, email is rendered as a full programmatic pipeline (yield tables, headline cards, CID-referenced inline images, BCC batching), and sends go out from the user's own domain — preserving sender reputation and avoiding shared infrastructure constraints entirely.

- 01.Multi-signal news ranking pipeline — Alpha Vantage NEWS_SENTIMENT feeds a custom scoring engine weighing topic relevance scores, source quality tiers, recency decay, keyword tiers (rates/macro/FX), sentiment magnitude, and a diversity deduplication pass to prevent story clustering. 8-minute in-memory cache to manage API quota. Not a ranked API response passed through — a fully custom scoring layer built on top of the raw feed.
- 02.Batched concurrent LLM summarization with dedup — gpt-4o-mini runs at concurrency-3 with per-article error isolation and URL-based soft deduplication against the user's recent draft history before generation starts. Each article produces a skim headline + 3–5 bullets via response_format: json_object at temperature 0.3 — no prose parsing, no hallucinated structure risk. Re-summarization of individual items available as a PATCH action post-generation.
- 03.Dual-model commentary with deliberate token budget — GPT-4o receives full Treasury yield snapshot + complete content for the top 12 articles but titles-only for items 13–20: a deliberate context management strategy that preserves commentary quality without exceeding limits. Edition-aware system prompt branching handles morning, afternoon, and custom editions at the prompt level, not in application code.
- 04.Treasury yield engine with technical levels — fetches 2Y/5Y/10Y/30Y daily history from Alpha Vantage with rate limiting and a 1-hour cache, applies percentile-based support/resistance calculation on yield history to generate tradeable technical levels, and translates yields to proxy prices for trader-oriented output. Dual TTL caching strategy (news: 8 min, treasury: 1 hr) manages quota across both data pipelines independently.
- 05.AES-256-GCM encrypted SMTP credentials — user passwords encrypted before storage in Postgres, decrypted server-side at send time only, never exposed client-side or in plaintext DB rows. HTML email treated as a full rendering pipeline: base64 data URIs converted to CID-referenced inline images for cross-client compatibility, full brand kit injection (logo, colors, header styles), HTML and plain-text variants generated per send, BCC batching at 50 recipients per envelope to respect SMTP payload limits.
- 06.Auth-resilient JWT chunked-cookie reconstruction — if the Supabase SSR client returns null server-side, the auth fallback reconstructs the JWT from fragmented cookie chunks and calls auth.getUser(accessToken) directly via service role client. Required in Next.js 15 where large JWTs split across cookies break standard session retrieval. Child table RLS uses existence subqueries against parent draft ownership (not just user_id columns). Service role writes filtered by authenticated user_id server-side as defense in depth. 7 versioned SQL migrations with check constraints, cascade relationships, and a profiles insert trigger. OpenAI SDK exponential retry wrapper throughout.
Every send starts with a clean list. Contacts are stored per-user, tagged for segmentation, and filterable by list — with full import, export, and inline edit support. BCC batching at 50 recipients per envelope happens automatically at send time, no configuration required.
