# Import necessary libraries
from dash import Dash  # Main Dash app
import dash_bootstrap_components as dbc  # Bootstrap components for styling
from layouts import create_layout  # Importing layout setup from layouts.py
from callbacks import register_callbacks  # Importing callback registration function from callbacks.py

# Create a Dash application instance
# Configure the application to use Bootstrap for styling
# suppress_callback_exceptions=True allows us to omit outputs in the callbacks during initialization
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP], suppress_callback_exceptions=True)

# Set the layout of the app using a function from the layouts module
app.layout = create_layout()

# Register callbacks for interactive components using a function from the callbacks module
register_callbacks(app)

# Check if the script is the main program and not being imported elsewhere
if __name__ == '__main__':
    # Run the app with debug=True to enable auto-reloading and better error messages
    app.run_server(debug=True)