How tejaslad111009/tradingapp works
This is a Streamlit stock-trading app. Users register or log in, manage wallet funds, browse stock data, trade shares, and review portfolio performance. The main runtime entry point initializes the app and routes pages; views call controllers, which apply trading rules and use models and stock-data services. Models manage user, wallet, and portfolio state in local JSON files, as documented in the README. The graph preserves documented dashboard, charting, history, and diagnostics capabilities; several page-routing details and unsampled implementations are supported only by README or index references.
Main entry points: trading_controller.py Trading Controllers · main.py Streamlit App · stock_api.py Stock Data Service · auth_view.py Authentication UI
Components 16
App and Views
- Streamlit App
main.py - Authentication UI
views/auth_view.py - Wallet UI
views/wallet_view.py - Trading UI
views/trading_view.py - Dashboard
views/dashboard_view.py
Trading Logic
- Trading Controllers
controllers/trading_controller.py
Domain Models
- User Accounts
models/user.py - Wallet and Transactions
models/wallet.py - Portfolio Holdings
models/portfolio.py
Market Data
- Stock Data Service
utils/stock_api.py - Alpha Vantage Client
utils/api_client.py
Diagnostics and Config
- API Diagnostics
utils/diagnostics.py - App Settings
config/settings.py
Other components
- Trader
- YFinance
- Exchange Rate API
Connections 20
- Trader → Streamlit App: uses
README.md - Streamlit App → Authentication UI: routes to
README.md - Streamlit App → Wallet UI: routes to
README.md - Streamlit App → Trading UI: routes to
main.py - Streamlit App → Dashboard: shows
README.md - Authentication UI → Trading Controllers: invokes
views/auth_view.py - Wallet UI → Trading Controllers: invokes
views/wallet_view.py - Trading UI → Trading Controllers: invokes
views/trading_view.py - Streamlit App → Trading Controllers: requests portfolio
main.py - Trading Controllers → User Accounts: manages accounts
controllers/trading_controller.py - Trading Controllers → Wallet and Transactions: updates funds
controllers/trading_controller.py - Trading Controllers → Portfolio Holdings: updates holdings
controllers/trading_controller.py - Trading Controllers → Stock Data Service: gets prices
controllers/trading_controller.py - Dashboard → Portfolio Holdings: reads holdings
views/dashboard_view.py - Stock Data Service → Alpha Vantage Client: fetches prices
utils/stock_api.py - Stock Data Service → Exchange Rate API: gets rates
utils/stock_api.py - Stock Data Service → YFinance: uses fallback
- Streamlit App → API Diagnostics: runs checks
main.py - API Diagnostics → Alpha Vantage Client: checks API
utils/diagnostics.py - Trading Controllers → App Settings: uses defaults