From 8ee08822bb38b9238aa8c380b39cc22146ed0eae Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Tue, 29 Oct 2024 11:29:14 +0000 Subject: [PATCH] docs: start MADR decision documenting process --- docs/decisions/0001-fastapi.md | 35 ++++++++++++++++++++++++++++++++++ docs/decisions/README.md | 7 +++++++ 2 files changed, 42 insertions(+) create mode 100644 docs/decisions/0001-fastapi.md create mode 100644 docs/decisions/README.md diff --git a/docs/decisions/0001-fastapi.md b/docs/decisions/0001-fastapi.md new file mode 100644 index 0000000000..67ebdc7fc7 --- /dev/null +++ b/docs/decisions/0001-fastapi.md @@ -0,0 +1,35 @@ +# Use FastAPI as Python web API framework + +## Context and Problem Statement + +We need to serve content from a backend linked to a database, to the frontend +for display. + +Historically Django (DRF) and Flask were best. Since `asgi` had more adoption, +async frameworks are key. + +FastAPI was the first to market to combine many powerful features: + +- ASGI Starlette + Uvicorn server. +- Pydantic validation. +- OpenAPI spec parsing. + +[Alternatives page](https://fastapi.tiangolo.com/alternatives) in FastAPI docs. + +## Considered Options + +- Django Rest Framework +- Flask +- FastAPI + +## Decision Outcome + +We chose FastAPI in 2022 is it was a well adopted, with a large community, and +has great developer experience. It's also quite performant. + +### Consequences + +- Good, because code is much more concise and understandable. +- Good, because endpoints are auto-documented as OpenAPI. +- Bad, because as with any decision at this level, migration away becomes difficult + (would require a rewrite using another framework). diff --git a/docs/decisions/README.md b/docs/decisions/README.md new file mode 100644 index 0000000000..f964952836 --- /dev/null +++ b/docs/decisions/README.md @@ -0,0 +1,7 @@ +# Architectural Decisions + +A Markdown and Architectural Decision Records documenting the technical decision +taken in this project. + +This process was started 29/10/2024, so does not necessarily capture all decisions +from the projects inception.