03aa9a3ca7
Phase 0 foundation. uv-managed FastAPI app (package=false, runs from source via uv run). Layered seams in place: app/api for routers, app/core for config (pydantic-settings, fully env-driven) and the async SQLAlchemy engine; service/repository/domain layers land with the data model. Exposes /health (liveness) and /health/ready (Postgres reachability via SELECT 1, 503 on failure) so the deploy wiring is verifiable before any data model exists. Includes a liveness test and the resolved uv.lock. Ignore pytest/ruff/mypy caches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Justin Paul <justin@jpaul.me>
26 lines
684 B
Python
26 lines
684 B
Python
"""FastAPI application entrypoint.
|
|
|
|
Thin by design: wire settings and routers, expose the OpenAPI contract. All
|
|
domain logic lives in the service layer (added with the data model). The
|
|
versioned API will mount under ``/api/v1``; health probes stay at the root.
|
|
"""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from app.api.health import router as health_router
|
|
from app.core.config import get_settings
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
settings = get_settings()
|
|
app = FastAPI(
|
|
title=settings.app_name,
|
|
version=settings.version,
|
|
description="Provenance API — family and land provenance.",
|
|
)
|
|
app.include_router(health_router)
|
|
return app
|
|
|
|
|
|
app = create_app()
|