Implement FastAPI Temporal MVP pipeline

This commit is contained in:
Codex
2026-03-27 00:10:28 +08:00
commit cc03da8a94
52 changed files with 3619 additions and 0 deletions

37
app/config/settings.py Normal file
View File

@@ -0,0 +1,37 @@
"""Application settings."""
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Runtime settings loaded from environment variables."""
app_name: str = "temporal-image-pipeline"
api_prefix: str = "/api/v1"
debug: bool = False
auto_create_tables: bool = True
database_url: str = "sqlite+aiosqlite:///./temporal_demo.db"
temporal_address: str = "localhost:7233"
temporal_namespace: str = "default"
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
@property
def sync_database_url(self) -> str:
"""Return a synchronous SQLAlchemy URL for migrations."""
return self.database_url.replace("+aiosqlite", "")
@lru_cache(maxsize=1)
def get_settings() -> Settings:
"""Return the cached application settings."""
return Settings()