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:
34
portfolio_app/config.py
Normal file
34
portfolio_app/config.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""Application configuration using Pydantic BaseSettings."""
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings loaded from environment variables."""
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
env_file_encoding="utf-8",
|
||||
extra="ignore",
|
||||
)
|
||||
|
||||
# Database
|
||||
database_url: str = "postgresql://portfolio:portfolio_dev@localhost:5432/portfolio"
|
||||
postgres_user: str = "portfolio"
|
||||
postgres_password: str = "portfolio_dev"
|
||||
postgres_db: str = "portfolio"
|
||||
|
||||
# Application
|
||||
dash_debug: bool = True
|
||||
secret_key: str = "change-me-in-production"
|
||||
|
||||
# Logging
|
||||
log_level: str = "INFO"
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
"""Get cached settings instance."""
|
||||
return Settings()
|
||||
Reference in New Issue
Block a user