How mohamedafzal0719/stock works
GoldBeES is a market-forecasting and trading platform with a Next.js dashboard and FastAPI backend. Its principal workflow is market-data acquisition and validation, feature generation, model training and evaluation, then API-served forecasts and analysis. The README also documents backtesting and explainability; the tree and source index show dedicated implementations for these and news, calendar, and agent capabilities. The graph follows documented or excerpted relationships; unsampled routes and integrations are not inferred.
Main entry points: db.py PostgreSQL stores · main.py FastAPI routes · engineer.py Feature engineering · inference.py Forecast inference
Components 22
Dashboard
- Web dashboard
frontend/src/app/page.js
API and workflows
- FastAPI routes
backend/api/main.py - Data pipeline trigger
backend/api/main.py
Market intelligence
- Market downloader
backend/src/data/downloader.py - Data cleaner
backend/src/data/cleaner.py - Feature engineering
backend/src/features/engineer.py - News sentiment
backend/src/services/news_nlp.py - Economic calendar
backend/src/services/economic_calendar.py
Forecasting models
- Model training
backend/src/models/meta_model.py - Training coordinator
backend/src/models/train_all.py - Deep architectures
backend/src/models/deep_models.py - Sequence model wrapper
backend/src/models/deep_wrapper.py - Model evaluation
backend/src/models/evaluator.py - Forecast inference
backend/src/services/inference.py - Strategy backtesting
backend/src/services/backtest.py - Trading agents
backend/src/services/agents.py - Reinforcement learning
backend/src/models/rl_agent.py
Persistence and quality
- Data validation
backend/src/utils/validation.py - PostgreSQL stores
backend/src/utils/db.py
Other components
- Dashboard user
- Yahoo Finance
- RSS news sources
Connections 28
- Dashboard user → Web dashboard: uses
README.md - Web dashboard → FastAPI routes: requests data
- FastAPI routes → Data pipeline trigger: triggers
backend/api/main.py - Data pipeline trigger → Market downloader: runs download
backend/api/main.py - Data pipeline trigger → Data cleaner: runs cleaning
backend/api/main.py - Data pipeline trigger → Feature engineering: runs engineering
backend/api/main.py - Market downloader → Yahoo Finance: downloads prices
backend/src/data/downloader.py - Market downloader → Data validation: validates data
backend/src/data/downloader.py - Data cleaner → PostgreSQL stores: persists cleaned data
- Feature engineering → PostgreSQL stores: reads and writes features
backend/src/features/engineer.py - Feature engineering → News sentiment: uses sentiment
backend/src/features/engineer.py - Feature engineering → Economic calendar: uses calendar context
backend/src/features/engineer.py - News sentiment → RSS news sources: ingests feeds
backend/src/services/news_nlp.py - News sentiment → PostgreSQL stores: stores events
backend/src/services/news_nlp.py - Economic calendar → PostgreSQL stores: uses database
backend/src/services/economic_calendar.py - Training coordinator → Model training: starts training
backend/src/models/train_all.py - Model training → PostgreSQL stores: loads features and saves metrics
backend/src/models/meta_model.py - Model training → Sequence model wrapper: uses sequence models
backend/src/models/meta_model.py - Sequence model wrapper → Deep architectures: builds architectures
backend/src/models/deep_wrapper.py - Model training → Model evaluation: evaluates predictions
- FastAPI routes → Forecast inference: requests forecasts
backend/api/main.py - Forecast inference → Feature engineering: loads engineered features
backend/src/services/inference.py - Forecast inference → Sequence model wrapper: uses deep model
backend/src/services/inference.py - Forecast inference → PostgreSQL stores: reads market events
backend/src/services/inference.py - FastAPI routes → Strategy backtesting: exposes backtesting
backend/api/main.py - Strategy backtesting → Forecast inference: requests predictions
backend/src/services/backtest.py - FastAPI routes → Trading agents: exposes agent features
backend/api/main.py - Trading agents → Reinforcement learning: uses agent model