ADR 0004: FastAPI Web Foundation
- Status: Accepted
- Date: 2026-11-24
Context
Section titled “Context”The framework needs an ASGI-native web foundation, typed endpoint integration, middleware support, and a clear application lifespan hook.
Decision
Section titled “Decision”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.
Alternatives considered
Section titled “Alternatives considered”- 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.
Consequences
Section titled “Consequences”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.
