feat(bootstrap,api,infra): scaffold app composition, health route, and postgres/minio/qdrant adapters
Why: - first runnable slice of ADR-0012's resource-lifetime rules and ADR-0015's package layout: app-lifetime clients built once in the lifespan, released via explicit dependencies. Changes: - Settings split into per-domain nested settings (postgres/minio/ingestion/qdrant/app/logging); FastAPI app wired with /healthz, /readyz and a /v1 router; Postgres/MinIO/Qdrant adapters and SQLAlchemy models for tenants, API keys, source files, ingestion jobs/events.
This commit is contained in:
16
src/main.py
16
src/main.py
@@ -0,0 +1,16 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
from src.api.router import router as v1_router
|
||||
from src.api.routers.health import router as health_router
|
||||
from src.bootstrap.lifespan import create_lifespan
|
||||
from src.config import Settings
|
||||
|
||||
|
||||
def create_app(settings: Settings | None = None) -> FastAPI:
|
||||
app = FastAPI(lifespan=create_lifespan(settings))
|
||||
app.include_router(health_router)
|
||||
app.include_router(v1_router, prefix="/v1")
|
||||
return app
|
||||
|
||||
|
||||
app = create_app()
|
||||
|
||||
Reference in New Issue
Block a user