TCPDashboard/main.py

44 lines
1.3 KiB
Python
Raw Permalink Normal View History

2025-05-29 23:50:41 +08:00
"""
Crypto Trading Bot Dashboard - Modular Version
This is the main entry point for the dashboard application using the new modular structure.
2025-05-29 23:50:41 +08:00
"""
from dashboard import create_app
from utils.logger import get_logger
2025-05-29 23:50:41 +08:00
logger = get_logger("main")
2025-05-29 23:50:41 +08:00
2025-05-29 23:04:08 +08:00
def main():
"""Main entry point for the dashboard application."""
2025-05-29 23:50:41 +08:00
try:
# Create the dashboard app
app = create_app()
# Import and register all callbacks after app creation
from dashboard.callbacks import (
register_navigation_callbacks,
register_chart_callbacks,
register_indicator_callbacks,
register_system_health_callbacks
)
# Register all callback modules
register_navigation_callbacks(app)
register_chart_callbacks(app) # Now includes enhanced market statistics
register_indicator_callbacks(app) # Placeholder for now
register_system_health_callbacks(app) # Placeholder for now
2025-05-29 23:50:41 +08:00
logger.info("Dashboard application initialized successfully")
2025-05-29 23:50:41 +08:00
# Run the app (debug=False for stability, manual restart required for changes)
app.run(debug=False, host='0.0.0.0', port=8050)
2025-05-29 23:50:41 +08:00
except Exception as e:
logger.error(f"Failed to start dashboard application: {e}")
raise
2025-05-29 23:04:08 +08:00
if __name__ == '__main__':
main()