How cfexo893/stock-ai-analysis-app works
Stonk AI is a full-stack stock-analysis app. The main user journey is to look up a ticker, inspect company and historical-price data, then explore AI analysis, news/video, forecasts, and options. The client also provides themes and streaming chat; the FastAPI server supplies stock data, predictions, options, interest rates, and chat. The graph preserves README capabilities, but several client routes and ticker views were not excerpted, so their internal wiring is left out rather than inferred.
Main entry points: +page.svelte Ticker view · main.py FastAPI service · OptionCard.svelte Option details · OptionsChain.svelte Options chain
Components 24
Client experience
- Stock search
client/src/routes/+page.svelte
Ticker analysis
- Ticker view
client/src/routes/ticker/[slug]/+page.svelte - Ticker loading
client/src/routes/ticker/[slug]/+page.server.ts - Company details
client/src/lib/components/ticker/CompanyData.svelte - Price summary
client/src/lib/components/ticker/TickerHeading.svelte - Chart controls
client/src/lib/components/ticker/ChartWithButtons.svelte - Price chart
client/src/lib/components/ticker/Chart.svelte - AI sentiment
client/src/lib/components/ticker/AiSentiment.svelte - Price forecast
client/src/lib/components/ticker/AiForecast.svelte - Stock news
client/src/lib/components/ticker/NewsFeed.svelte - Stock videos
client/src/lib/components/ticker/YouTubeFeed.svelte - AI chat UI
client/src/lib/components/ticker/AiChat.svelte - Options chain
client/src/lib/components/ticker/OptionsChain.svelte - Option details
client/src/lib/components/ticker/OptionCard.svelte
Client API routes
- Video search route
client/src/routes/api/queryYouTube/+server.ts - Delta route
client/src/routes/api/getOptionDelta/+server.ts - Streaming chat route
client/src/routes/api/chatAiStream/+server.ts - Options route
client/src/routes/api/getOptionsChain/+server.ts - Rate route
client/src/routes/api/getInterestRates/+server.ts
Analysis service
- FastAPI service
server/main.py
Other components
- Investor
- Market data provider
- OpenAI
- YouTube API
Connections 24
- Investor → Stock search: searches
- Investor → Ticker view: opens ticker
- Price summary → Chart controls: renders
client/src/lib/components/ticker/TickerHeading.svelte - Chart controls → Price chart: renders
client/src/lib/components/ticker/ChartWithButtons.svelte - Options chain → Option details: renders
client/src/lib/components/ticker/OptionsChain.svelte - Options chain → Options route: fetches chain
client/src/lib/components/ticker/OptionsChain.svelte - Option details → Rate route: fetches rates
client/src/lib/components/ticker/OptionCard.svelte - Option details → Delta route: requests delta
client/src/lib/components/ticker/OptionCard.svelte - Delta route → FastAPI service: forwards delta
client/src/routes/api/getOptionDelta/+server.ts - FastAPI service → Market data provider: fetches prices
server/main.py - FastAPI service → OpenAI: requests chat
server/main.py - Streaming chat route → OpenAI: streams completion
client/src/routes/api/chatAiStream/+server.ts - Video search route → YouTube API: searches videos
client/src/routes/api/queryYouTube/+server.ts - Ticker view → Company details: presents details
- Ticker view → Price summary: presents prices
- Ticker view → AI sentiment: presents sentiment
- Ticker view → Price forecast: presents forecast
- Ticker view → Stock news: presents news
- Ticker view → Stock videos: presents videos
- Ticker view → AI chat UI: offers chat
- Ticker view → Options chain: presents options
- Ticker loading → FastAPI service: loads ticker data
- Options route → FastAPI service: forwards options
- Rate route → FastAPI service: forwards rates