How tanya-pand3y/stocktradingsimulator works
StockEd is a paper-trading simulator: users sign up or log in, manage a simulated portfolio by buying and selling stocks, review transaction history, and query current and historical prices. The code is organized around views, interface adapters, use cases, domain entities, and data access. The sampled query flow shows the view-to-controller handoff and the interactor’s market-data calls; other user journeys and dashboard capabilities are documented in the README but their full implementations were not sampled.
Main entry points: Portfolio.java Portfolio · QueryStockInteractor.java Stock query · Main.java App startup · dashboard Dashboard
Components 18
User interface
- App startup
src/app/Main.java - Trading views
src/view - View routing
src/view/ViewManager.java
Trading workflows
- Login and signup
src/use_case/login - Dashboard
src/use_case/dashboard - Buy stocks
src/use_case/buy - Sell stocks
src/use_case/sell - Purchase history
src/use_case/UserPurchaseHistory - Stock query
src/use_case/query_stock/QueryStockInteractor.java
Portfolio domain
- Portfolio
src/entity/Portfolio.java - Holdings and transactions
src/entity/Holding.java - Current stock
src/entity/Stock.java
Data and market access
- Quantity store
src/data_access/StockQuantityDataAccessObject.java - User storage
src/data_access/FileUserDataAccessObject.java - Current-price access
src/data_access/StockCurrentAPIDataAccessObject.java - Price-history access
src/data_access/StockHistoryAPIDataAccessObject.java
Other components
- Trader
- Tiingo API
Connections 24
- Trader → App startup: starts app
README.md - App startup → Trading views: opens login
src/app/Main.java - Trader → Login and signup: signs in or up
README.md - Login and signup → Dashboard: opens dashboard
README.md - Trader → Dashboard: views portfolio
README.md - Dashboard → Portfolio: reads holdings
src/interface_adapter/dashboard/DashboardController.java - Trader → Buy stocks: requests purchase
README.md - Trader → Sell stocks: requests sale
README.md - Buy stocks → Portfolio: updates portfolio
README.md - Sell stocks → Portfolio: updates portfolio
README.md - Portfolio → Quantity store: fetches and saves
src/entity/Portfolio.java - Portfolio → Holdings and transactions: builds holdings
src/entity/Portfolio.java - Trader → Purchase history: requests history
README.md - Purchase history → Portfolio: reads transactions
src/interface_adapter/UserPurchaseHistory/UserPurchaseHistoryController.java - Trader → Stock query: enters ticker and dates
README.md - Trading views → Stock query: submits query
src/view/QueryStockView.java - Stock query → Current-price access: fetches current price
src/use_case/query_stock/QueryStockInteractor.java - Stock query → Price-history access: fetches price history
src/use_case/query_stock/QueryStockInteractor.java - Current stock → Current-price access: fetches stock data
src/entity/Stock.java - Current-price access → Tiingo API: requests quotes
- Price-history access → Tiingo API: requests history
- Trader → View routing: navigates views
README.md - App startup → View routing: configures manager
src/app/Main.java - Portfolio → User storage: loads account data