How bbalabuya/stockmarket works
This is a stock-market information app: users view market indices, search for a company, then inspect its stock details, historical data and live price/order book. The React client combines REST data with a WebSocket feed; FastAPI registers separate routes for stock search, market indices, stock metrics, time-based data and live feeds. The sampled code shows the combined live-feed relay and KIS authentication. Some route implementations and the REST hook were not excerpted, so their internal calls and external data sources are not asserted.
Main entry points: companyMain.js Stock page · main.py FastAPI app · auth.py Token and approval · landing.js Landing page
Components 26
React client
- App router
client/src/App.js - Landing page
client/src/pages/landing.js - Code lookup client
client/src/pages/findStockCode.js - Historical REST hook
client/src/pages/RestCall.js - Market utilities
client/src/pages/marketUtils.js - Index display
client/src/pages/call_index.js
Stock views
- Stock page
client/src/pages/company/companyMain.js - Stock search
client/src/pages/company/SearchBar.js - Quote header
client/src/pages/company/StockHeader.js - Price chart
client/src/pages/company/ChartArea.js - Stock metrics
client/src/pages/company/DataSection.js - Trade table
client/src/pages/company/dataTable.js - Order book
client/src/pages/company/Offer.js
FastAPI routes
- FastAPI app
server/main.py - Stock code search
server/findStockCode.py - Korea index API
server/index.py - Naver index API
server/index_naver.py - Time data API
server/time_conclusion.py - PER/PBR API
server/per_pbr.py
Live feeds
- Live data hook
client/src/pages/WSCall.js - Price WebSocket
server/ws_price.py - Offer WebSocket
server/ws_offer.py - Combined live relay
server/ws_all.py
KIS authentication
- Token and approval
server/auth.py
Other components
- Investor
- KIS services
Connections 38
- Investor → App router: opens
- App router → Landing page: routes to
client/src/App.js - App router → Stock page: routes to
client/src/App.js - Landing page → Code lookup client: submits search
client/src/pages/landing.js - Landing page → Index display: renders
client/src/pages/landing.js - Landing page → Korea index API: fetches index
client/src/pages/landing.js - Stock page → Stock search: renders
client/src/pages/company/companyMain.js - Stock page → Code lookup client: looks up code
client/src/pages/company/companyMain.js - Stock page → Historical REST hook: loads history
client/src/pages/company/companyMain.js - Stock page → Live data hook: loads live data
client/src/pages/company/companyMain.js - Stock page → Quote header: renders
client/src/pages/company/companyMain.js - Stock page → Price chart: renders
client/src/pages/company/companyMain.js - Stock page → Stock metrics: renders
client/src/pages/company/companyMain.js - Stock page → Trade table: renders
client/src/pages/company/companyMain.js - Stock page → Order book: renders
client/src/pages/company/companyMain.js - Stock page → Index display: renders
client/src/pages/company/companyMain.js - Historical REST hook → Market utilities: imports
client/src/pages/RestCall.js - Live data hook → Market utilities: imports
client/src/pages/WSCall.js - Live data hook → Combined live relay: opens WebSocket
client/src/pages/WSCall.js - Index display → Naver index API: requests indices
client/src/pages/call_index.js - Code lookup client → Stock code search: requests code
- FastAPI app → Time data API: registers route
server/main.py - FastAPI app → PER/PBR API: registers route
server/main.py - FastAPI app → Korea index API: registers route
server/main.py - FastAPI app → Naver index API: registers route
server/main.py - FastAPI app → Stock code search: registers route
server/main.py - FastAPI app → Price WebSocket: registers route
server/main.py - FastAPI app → Offer WebSocket: registers route
server/main.py - FastAPI app → Combined live relay: registers route
server/main.py - Korea index API → Token and approval: gets token
server/index.py - Time data API → Token and approval: uses auth
server/time_conclusion.py - PER/PBR API → Token and approval: uses auth
server/per_pbr.py - Price WebSocket → Token and approval: uses auth
server/ws_price.py - Offer WebSocket → Token and approval: uses auth
server/ws_offer.py - Combined live relay → Token and approval: issues approval
server/ws_all.py - Token and approval → KIS services: requests credentials
server/auth.py - Korea index API → KIS services: requests index data
server/index.py - Combined live relay → KIS services: relays live feed
server/ws_all.py