TCPDashboard/main.py
Vasily.onl dbe58e5cef Remove deprecated app_new.py and consolidate main application logic into main.py
- Deleted `app_new.py`, which was previously the main entry point for the dashboard application, to streamline the codebase.
- Consolidated the application initialization and callback registration logic into `main.py`, enhancing modularity and maintainability.
- Updated the logging and error handling practices in `main.py` to ensure consistent application behavior and improved debugging capabilities.

These changes simplify the application structure, aligning with project standards for modularity and maintainability.
2025-06-11 18:36:34 +08:00

44 lines
1.3 KiB
Python

"""
Crypto Trading Bot Dashboard - Modular Version
This is the main entry point for the dashboard application using the new modular structure.
"""
from dashboard import create_app
from utils.logger import get_logger
logger = get_logger("main")
def main():
"""Main entry point for the dashboard application."""
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
logger.info("Dashboard application initialized successfully")
# Run the app (debug=False for stability, manual restart required for changes)
app.run(debug=False, host='0.0.0.0', port=8050)
except Exception as e:
logger.error(f"Failed to start dashboard application: {e}")
raise
if __name__ == '__main__':
main()