Skip to content

ADR 0004: FastAPI Web Foundation

  • Status: Accepted
  • Date: 2026-11-24

The framework needs an ASGI-native web foundation, typed endpoint integration, middleware support, and a clear application lifespan hook.

Use FastAPI and Starlette as the HTTP and ASGI foundation. Titanspan owns application conventions and integration lifecycle, while applications retain direct access to FastAPI routers, requests, responses, and middleware.

  • A custom ASGI server or router: rejected because it duplicates mature infrastructure.
  • Another web framework: not selected because FastAPI matches the intended async and typing model and integrates with Dishka.

FastAPI is a mandatory dependency. Titanspan should avoid wrapping every FastAPI concept and preserve direct interoperability.

The current test environment uses HTTPX2 only as Starlette’s test transport. It is not a framework HTTP client API; that future choice will be revisited when the HTTP module is implemented.

FastAPI and Starlette evolve. Validate minimum supported versions and lifespan behavior in CI before widening compatibility claims.