Étape 1 : squelette du projet
- Monorepo backend/ + frontend/ + deploy/ - Backend FastAPI/SQLModel/Alembic/uv qui démarre (health check, config, i18n, base de test PostgreSQL, pytest) - docker-compose de développement (db + backend hot-reload) - Chaîne CI/CD GitHub Actions : lint + tests, build image, push GHCR, déploiement SSH sur le VPS à chaque push main - CLAUDE.md : vocabulaire du domaine, conventions, commandes Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017uUsRg7XzopkCPWimwg9ZM
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
from functools import lru_cache
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Configuration applicative, alimentée par l'environnement."""
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env", env_file_encoding="utf-8", extra="ignore"
|
||||
)
|
||||
|
||||
environment: str = "development"
|
||||
|
||||
database_url: str = (
|
||||
"postgresql+psycopg://benevoles:benevoles@localhost:5432/benevoles"
|
||||
)
|
||||
test_database_url: str = (
|
||||
"postgresql+psycopg://benevoles:benevoles@localhost:5432/benevoles_test"
|
||||
)
|
||||
|
||||
# Utilisés par l'étape authentification (lien magique). Pas encore actifs.
|
||||
jwt_secret: str = "dev-only-change-me"
|
||||
magic_link_ttl_minutes: int = 30
|
||||
|
||||
log_level: str = "INFO"
|
||||
cors_origins: list[str] = ["http://localhost:5173"]
|
||||
|
||||
@property
|
||||
def is_production(self) -> bool:
|
||||
return self.environment == "production"
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
Reference in New Issue
Block a user