TCPDashboard/main.py
Vasily.onl c4ec3fac9f 3.4 Enhance logging and modular chart system for Crypto Trading Bot Dashboard
- Suppressed SQLAlchemy logging in `app.py` and `main.py` to reduce console verbosity.
- Introduced a new modular chart system in `components/charts/` with a `ChartBuilder` class for flexible chart creation.
- Added utility functions for data processing and validation in `components/charts/utils.py`.
- Implemented indicator definitions and configurations in `components/charts/config/indicator_defs.py`.
- Created a comprehensive documentation structure for the new chart system, ensuring clarity and maintainability.
- Added unit tests for the `ChartBuilder` class to verify functionality and robustness.
- Updated existing components to integrate with the new chart system, enhancing overall architecture and user experience.
2025-06-03 12:49:46 +08:00

61 lines
1.9 KiB
Python

#!/usr/bin/env python3
"""
Main entry point for the Crypto Trading Bot Dashboard.
"""
import sys
import logging
from pathlib import Path
# Add project root to path
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))
def main():
"""Main application entry point."""
print("🚀 Crypto Trading Bot Dashboard")
print("=" * 40)
# Suppress SQLAlchemy database logging for cleaner console output
logging.getLogger('sqlalchemy').setLevel(logging.WARNING)
logging.getLogger('sqlalchemy.engine').setLevel(logging.WARNING)
logging.getLogger('sqlalchemy.pool').setLevel(logging.WARNING)
logging.getLogger('sqlalchemy.dialects').setLevel(logging.WARNING)
logging.getLogger('sqlalchemy.orm').setLevel(logging.WARNING)
try:
from config.settings import app, dashboard
print(f"Environment: {app.environment}")
print(f"Debug mode: {app.debug}")
if app.environment == "development":
print("\n🔧 Running in development mode")
print("Dashboard features available:")
print("✅ Basic Dash application framework")
print("✅ Real-time price charts (sample data)")
print("✅ System health monitoring")
print("🚧 Real data connection (coming in task 3.7)")
# Start the Dash application
print(f"\n🌐 Starting dashboard at: http://{dashboard.host}:{dashboard.port}")
print("Press Ctrl+C to stop the application")
from app import main as app_main
app_main()
except ImportError as e:
print(f"❌ Failed to import modules: {e}")
print("Run: uv sync")
sys.exit(1)
except KeyboardInterrupt:
print("\n\n👋 Dashboard stopped by user")
sys.exit(0)
except Exception as e:
print(f"❌ Failed to start dashboard: {e}")
sys.exit(1)
if __name__ == "__main__":
main()