From fef5e2e85c19f6abb07a76745789042e380e6f30 Mon Sep 17 00:00:00 2001 From: Yerassyl Zhanymkanov Date: Sun, 28 Aug 2022 17:32:24 +0600 Subject: [PATCH] Add bonus section with link to issues --- README.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ffcf61..912eed0 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ -## WIP: FastAPI Best Practices +## FastAPI Best Practices Opinionated list of best practices and conventions we used at our startup. For the last 1.5 years in production, we have been making good and bad decisions that impacted our developer experience dramatically. -Some of them are worth sharing. +Some of them are worth sharing. + ### Contents 1. [Project Structure. Consistent & predictable.](https://github.com/zhanymkanov/fastapi-best-practices#1-project-structure-consistent--predictable) @@ -30,6 +31,7 @@ Some of them are worth sharing. 22. [Don't forget FastAPI converts Response Pydantic Object](https://github.com/zhanymkanov/fastapi-best-practices#22-dont-forget-fastapi-converts-response-pydantic-object-to-dict-then-to-an-instance-of-responsemodel-then-to-dict-then-to-json) 23. [If you must use sync SDK, then run it in a thread pool.](https://github.com/zhanymkanov/fastapi-best-practices#23-if-you-must-use-sync-sdk-then-run-it-in-a-thread-pool) 24. [Use linters (black, isort, autoflake)](https://github.com/zhanymkanov/fastapi-best-practices#24-use-linters-black-isort-autoflake) +25. [Bonus](https://github.com/zhanymkanov/fastapi-best-practices#bonus-section) ### 1. Project Structure. Consistent & predictable There are many ways to structure the project, but the best structure is a structure that is consistent, straightforward and has no surprises. @@ -986,4 +988,11 @@ set -x autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place src tests --exclude=__init__.py isort src tests --profile black black src tests -``` \ No newline at end of file +``` +### Bonus Section. +Some very kind people shared their experience and best practices that are definitely worth reading. +Check them out at [issues](https://github.com/zhanymkanov/fastapi-best-practices/issues) section of the project. + +For instance, [lowercase00](https://github.com/zhanymkanov/fastapi-best-practices/issues/4) +has shared their best practices working with permissions & auth, class-based services & views, +task queues, custom response serializers, configuration with dynaconf, etc.