1.3 KiB
1.3 KiB
Component Architecture
The GUI has been refactored into a modular component-based architecture to prevent code bloat.
Frontend Components
/static/js/components/
- MarketsComponent.js - Market data fetching and display
- StrategyComponent.js - Strategy controls and status
- PositionsComponent.js - Position display
- BacktestComponent.js - Backtesting functionality
/static/js/utils/
- Notification.js - Global notification system
- WebSocketManager.js - WebSocket event management
/static/js/app.js
- Main application entry point
- Initializes all components
- Manages component lifecycle
Backend Blueprints
/api/
- markets.py - Market data endpoints
- strategy.py - Strategy control endpoints
- backtest.py - Backtesting endpoints
- __init__.py - Blueprint registration
Benefits
- Separation of Concerns - Each component handles one responsibility
- Reusability - Components can be reused across different views
- Maintainability - Easier to find and fix bugs
- Testability - Components can be tested independently
- Scalability - Easy to add new features without bloating existing code
Usage
The app automatically loads all components on startup. Each component manages its own state and updates.