The Fastapi template is a repository for microservices. In this template, you will find examples of how to build a robust application with FastAPI.
- ⚡ FastAPI for the Python Back-End API.
- 🚀 Fast: Supports async/await syntax for routes and database connection.
- 💪 Robust: Get production-ready code with automatic interactive documentation.
- 🔐 Security:
OAuth2
withfastapi.security
.
- ⚡ Template
- 🧰 SQLModel: For the Python SQL database interactions (ORM).
- 🐋 docker Compose: For development and production.
- ✅ pytest: Unitary tests.
- 🧰 alembic: Database migrations.
- 📑 guvicorn-logger: Color logger translator.
- 📑 pagination: To simplify pagination.
- 👀 pylint: Analyses your code without actually running it.
- 🚀 fastapi-cache: Cache using redis.
- 🔒 fastapi-limiter: Is a rate limiting tool for fastapi routes.
- 🚀 nginx: HTTP level server, reverse proxy.
- 🔒 Secure password hashing by default.
- 🔑 JWT token authentication.
Get production-ready code with automatic interactive documentation. API documentation at Docs.
You can just fork or clone this repository and use it as is.
✨ It just works. ✨
If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.
But you can do the following:
-
Create a new GitHub repo, for example
my-back-end
. -
Clone this repository manually, set the name with the name of the project you want to use, for example
my-back-end
:git clone git@github.com:mateus-rodriguess/fastapi-template.git my-back-end
-
Enter into the new directory:
cd my-back-end
-
Set the new origin to your new repository, copy it from the GitHub interface, for example:
git remote set-url origin git@github.com:mateus-rodriguess/fastapi-template.git
-
Add this repo as another "remote" to allow you to get updates later:
git remote add upstream git@github.com:mateus-rodriguess/fastapi-template.git
-
Push the code to your new repository:
git push -u origin main
docker compose up -d
$ alembic revision --autogenerate -m "Migration message."
$ alembic upgrade head
This project is licensed under the terms of the MIT license.