Why this timebox: I had already used FastAPI once but no longer remembered how to set it up,
so 30 minutes was enough to get back to the shared target. Note: this prior experience makes
this spike easier than one on a technology I have never used.
Wrong documentation page. I started from the uv guide
"Migrating an existing FastAPI project". It assumes FastAPI code already exists and only shows
how to manage it with uv. The app code itself comes from the FastAPI "First Steps" tutorial.
Project name clash.uv init named the project fastapi, the same name as the dependency.
Renaming it with a global find/replace also renamed the dependency and the import (faspoc),
which broke the project.
Lock file stuck on an old version. After fixing the names, uv.lock still pinned
fastapi==0.1.0 (2018). That version has no standard extra, so the fastapi command was not
installed: error: Failed to spawn: fastapi. uv only printed a warning
(The package fastapi==0.1.0 does not have an extra named standard).
Fix: uv lock --upgrade-package fastapi.
Reading the port. I declared the Settings class but did not create the settings instance,
and I first ran the app with fastapi dev, which ignores the if __name__ == "__main__" block
and always listens on 127.0.0.1:8000. The app has to be started with python app/main.py for
PORT to be used. I needed help on this step.
Liked: it looks very simple. A route is a decorated function that returns a dict, and
FastAPI turns it into JSON. The code is easy to read, and the imports are short and clear.
Liked: the FastAPI documentation is very well explained, and the documentation site has an
AI chat assistant that was pleasant and helpful.
Liked: the OpenAPI page is generated automatically from the routes, which matters for AREA
(the subject asks for a documented API).
Liked: configuration from environment variables is typed and validated with
pydantic-settings, which will fit Docker Compose well.
Got in the way: there are two ways to start the server (fastapi dev and uvicorn.run),
and only one of them reads our port. This was confusing at first.
Got in the way: most of the time was lost on uv (project name, lock file), not on FastAPI
itself. uv fails silently with only a warning.
For AREA: OAuth and background jobs are not built in and need extra libraries; this is the
main point to compare with the other backend spikes.