How igorkoeppe/projeto_plataforma_financeira works
Market Replay is an educational finance platform with two linked experiences: historical prediction gameplay earns virtual capital, which users can then invest in a paper-trading portfolio; a news hub and topic finder complement both. The FastAPI app serves the browser client, routes API workflows, and initializes SQLite and background news caching. Edges follow excerpted calls, SOURCE INDEX references, or README-documented behavior; unsampled implementation details are not inferred.
Main entry points: main.py API Application · db.py SQLite Store · session.py Anonymous Sessions · events.py Replay Events
Components 19
App and Sessions
- Web Client
frontend/app.js - API Application
app/main.py - Anonymous Sessions
app/session.py - API Schemas
app/schemas.py
Historical Replay
- Replay Events
app/routers/events.py - Rewards and Progress
app/services/game_logic.py - Player Statistics
app/routers/stats.py - Historical Event Archive
app/seed_data.py
Paper Trading
- Trade Orders and Portfolio
app/routers/trade.py - Live Pricing
app/services/pricing.py - Market Quotes and History
app/routers/market.py
News and Discovery
- News Hub
app/routers/news.py - News Cache Worker
app/services/background_tasks.py - News Topic Finder
app/routers/analogs.py - Similarity Search
app/services/similarity.py - Event Embeddings
app/embeddings_data.py
Persistence and Data
- SQLite Store
app/db.py
Other components
- Learner
- Yahoo Finance
Connections 31
- Learner → Web Client: uses
README.md - Web Client → API Application: requests
README.md - API Application → Web Client: serves
app/main.py - API Application → Anonymous Sessions: resolves sessions
app/main.py - API Application → SQLite Store: initializes
app/main.py - API Application → Historical Event Archive: seeds events
app/main.py - API Application → Replay Events: mounts router
app/main.py - API Application → Player Statistics: mounts router
app/main.py - API Application → Trade Orders and Portfolio: mounts router
app/main.py - API Application → News Hub: mounts router
app/main.py - API Application → News Topic Finder: mounts router
app/main.py - API Application → Market Quotes and History: mounts router
app/main.py - API Application → News Cache Worker: starts worker
app/main.py - Replay Events → SQLite Store: reads and writes
app/routers/events.py - Replay Events → Rewards and Progress: computes rewards
app/routers/events.py - Replay Events → Anonymous Sessions: gets player ID
app/routers/events.py - Player Statistics → SQLite Store: reads stats
app/routers/stats.py - Player Statistics → Anonymous Sessions: gets player ID
app/routers/stats.py - Historical Event Archive → SQLite Store: seeds archive
app/seed_data.py - Historical Event Archive → Event Embeddings: uses vectors
app/seed_data.py - Trade Orders and Portfolio → SQLite Store: updates holdings
app/routers/trade.py - Trade Orders and Portfolio → Anonymous Sessions: gets player ID
app/routers/trade.py - Trade Orders and Portfolio → Live Pricing: gets live price
app/routers/trade.py - Live Pricing → Yahoo Finance: fetches prices
README.md - Market Quotes and History → Yahoo Finance: gets market data
README.md - News Cache Worker → Yahoo Finance: fetches headlines
app/services/background_tasks.py - News Cache Worker → SQLite Store: caches articles
app/services/background_tasks.py - News Hub → SQLite Store: reads news
app/routers/news.py - News Hub → Anonymous Sessions: gets player ID
app/routers/news.py - News Topic Finder → SQLite Store: loads news
app/routers/analogs.py - News Topic Finder → Similarity Search: ranks matches
app/routers/analogs.py