How hahaarthur17/ai-bull-vs-bear works
AI Bull vs Bear is an educational stock-research app: users select a stock, inspect prices, technical indicators and evidence, then review a cited Bull/Bear analysis, uncertainty and claim examinations. The mobile app calls a FastAPI backend; the backend combines market context, evidence retrieval and analysis, with demo fallbacks and optional authenticated persistence and model providers. RSS, SEC and market-data ingestion support the evidence and price views. The graph reflects documented capabilities; several backend orchestration details are based on the README because their implementations were not sampled.
Main entry points: main.py HTTP routes · analysis.py Analysis orchestration · supabase_store.py Supabase persistence · App.tsx Research screens
Components 25
Mobile app
- Research screens
apps/mobile/App.tsx - Sign-in
apps/mobile/src/AuthScreen.tsx - API client
apps/mobile/src/api.ts
Backend API
- HTTP routes
backend/app/main.py - API schemas
backend/app/schemas.py - Token verification
backend/app/services/auth.py
Analysis workflow
- Analysis orchestration
backend/app/services/analysis.py - Technical indicators
backend/app/services/indicators.py - Evidence retrieval
backend/app/services/rag.py - Evidence freshness
backend/app/services/evidence_freshness.py - Safety guardrails
backend/app/services/guardrails.py - Model providers
backend/app/services/model_provider.py
Data and integrations
- Demo data
backend/app/services/demo_store.py - Supabase persistence
backend/app/services/supabase_store.py - SEC ingestion
backend/app/services/evidence_ingestion.py - RSS ingestion
backend/app/services/ingestion.py - Market data
backend/app/services/market_data.py - Macro context
backend/app/services/macro_data.py - Supabase database
backend/supabase/schema.sql
Other components
- Researcher
- Groq / Gemini
- Market providers
- RSS / SEC EDGAR
- Ingestion trigger
- Supabase Auth
Connections 33
- Researcher → Research screens: uses
- Research screens → Sign-in: opens
- Research screens → API client: requests data
- API client → HTTP routes: calls API
- HTTP routes → API schemas: validates
- HTTP routes → Token verification: verifies token
- Token verification → Supabase Auth: validates session
- HTTP routes → Analysis orchestration: delegates analysis
- HTTP routes → Technical indicators: calculates signals
- HTTP routes → Evidence retrieval: searches evidence
- Analysis orchestration → Technical indicators: gets signals
- Analysis orchestration → Evidence retrieval: retrieves evidence
- Analysis orchestration → Evidence freshness: checks evidence
- Analysis orchestration → Model providers: requests debate
- Analysis orchestration → Safety guardrails: checks claims
- Analysis orchestration → Supabase persistence: persists analysis
- Analysis orchestration → Demo data: uses demo data
- Model providers → Groq / Gemini: calls provider
- HTTP routes → Demo data: reads demo data
- HTTP routes → Supabase persistence: reads or writes
- Supabase persistence → Supabase database: reads or writes
- Demo data → Evidence retrieval: provides evidence
- Ingestion trigger → RSS ingestion: starts import
- Ingestion trigger → SEC ingestion: starts import
- Ingestion trigger → Market data: starts import
- RSS ingestion → RSS / SEC EDGAR: fetches feeds
- SEC ingestion → RSS / SEC EDGAR: fetches filings
- RSS ingestion → Supabase persistence: stores evidence
- SEC ingestion → Supabase persistence: stores evidence
- Market data → Market providers: fetches prices
- Market data → Supabase persistence: stores prices
- Macro context → Supabase persistence: reads context
- HTTP routes → Macro context: loads macro context