The Ultimate Super-Convenient Template for Microservices Based on FastAPI 💰
Main article on medium.com. Please check this out.
The application starts on 0.0.0.0 host and 8000 port by default.
There is a little help:
- To get Swagget Docs reach: http://0.0.0.0:8000/docs
- To get openapi spec reach: http://0.0.0.0:8000/docs/openapi
ultimate-fastapi-microservice implements CRUD for User entity out of the box.
Read Users -> GET: /api/users/
Create New User -> POST: /api/users/
Read User -> GET: /api/users/{user_id}
Delete User Endpoint -> DELETE: /api/users/{user_id}
Make sure you set up uv: https://docs.astral.sh/uv/
which uv
uv --version
make install
Before start your development journey make sure you set up your uv environment and run postgresql server.
docker run \
--name microservice-db \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=microservice \
-p 5432:5432 \
-d postgres
make migration m="comment"
make migrate
make run
make docker-up
make docker-migrate
make docker-down