How llsourcell/ai_in_finance works
StockIT is a browser-based stock-trading game: a player starts a round, trades against an AI and the market as stock prices advance, then sees standings. The React App owns round state, trade and score logic, and chart rendering; Flask supplies historical prices and model predictions from Quandl. The README also documents a responsive interface and offline-capable production assets. The frontend request to Flask is not visible in the sampled App.js excerpts, so that link is shown as unverified; the graph otherwise follows explicit imports, calls, and documented behavior.
Main entry points: App.js Game controller · index.js React entry · app.py Stock data endpoint · registerServiceWorker.js Worker registration
Components 13
Game interface
- React entry
client/src/index.js - Game controller
client/src/App.js - Buy / sell controls
client/src/components/Buttons.js - Portfolio view
client/src/components/StockData.js - Timeline slider
client/src/components/Slider.js - Leaderboard
client/src/components/Leaderboard.js - Round podium
client/src/components/Podium.js
Market data service
- Stock data endpoint
app.py - Price prediction
app.py
Offline support
- Worker registration
client/src/registerServiceWorker.js - Service worker
client/build/service-worker.js
Other components
- Player
- Quandl market data
Connections 14
- Player → React entry: opens game
README.md - React entry → Game controller: renders
client/src/index.js - Game controller → Buy / sell controls: renders
client/src/App.js - Game controller → Portfolio view: renders
client/src/App.js - Game controller → Timeline slider: renders
client/src/App.js - Game controller → Leaderboard: renders
client/src/App.js - Game controller → Round podium: renders
client/src/App.js - Player → Buy / sell controls: trades via
client/src/components/Buttons.js - Player → Timeline slider: adjusts timeline
client/src/components/Slider.js - Game controller → Stock data endpoint: requests prices
- Stock data endpoint → Quandl market data: fetches history
app.py - Stock data endpoint → Price prediction: prepares model data
app.py - React entry → Worker registration: registers
client/src/index.js - Worker registration → Service worker: registers worker
client/src/registerServiceWorker.js