Project Overview
Stock Earnings Analyzer is a comprehensive financial intelligence platform that displays weekly earnings calendars for publicly traded companies and delivers AI-powered analysis of individual earnings reports. The backend fetches earnings data from Alpha Vantage, enriches it with market cap data, and stores it in PostgreSQL with upsert logic to maintain a clean, deduplicated dataset. When a user requests analysis for a specific stock, the system searches for the actual earnings press release and market reaction using the Brave Search API, scrapes and extracts the full article text prioritizing primary sources (BusinessWire, PR Newswire, SEC filings, investor relations pages), then sends the extracted content to the Anthropic Claude API with a structured tool-use schema to produce precise financial metrics including EPS, revenue, guidance summary, sentiment scoring, and price reaction data. Results stream to the frontend via Server-Sent Events for real-time status updates. The frontend is built with Svelte 5 runes and features interactive SVG price charts with hover tooltips, batched sparkline loading for performance, a favorites/watchlist system backed by Clerk JWT authentication, and a curated news feed aggregated from NewsAPI and Brave Search.