feat: add app foundation (config.py, app.py, home page)
- config.py: Pydantic BaseSettings for env loading - app.py: Dash factory with Pages routing - pages/home.py: Placeholder landing page Closes #7 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
37
portfolio_app/app.py
Normal file
37
portfolio_app/app.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""Dash application factory with Pages routing."""
|
||||
|
||||
import dash
|
||||
from dash import html
|
||||
|
||||
from .config import get_settings
|
||||
|
||||
|
||||
def create_app() -> dash.Dash:
|
||||
"""Create and configure the Dash application."""
|
||||
settings = get_settings()
|
||||
|
||||
app = dash.Dash(
|
||||
__name__,
|
||||
use_pages=True,
|
||||
suppress_callback_exceptions=True,
|
||||
title="Analytics Portfolio",
|
||||
)
|
||||
|
||||
app.layout = html.Div(
|
||||
[
|
||||
dash.page_container,
|
||||
]
|
||||
)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Run the development server."""
|
||||
settings = get_settings()
|
||||
app = create_app()
|
||||
app.run(debug=settings.dash_debug, host="0.0.0.0", port=8050)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user