Skip to content

binarycat0/fastapi-microservice-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fastapi-microservice-template 💾 💚

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:

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}

Initiate uv environment

Make sure you set up uv: https://docs.astral.sh/uv/

Check

which uv
uv --version

Install/Update environment

make install

Local development

Before start your development journey make sure you set up your uv environment and run postgresql server.

ex: run postgresql in docker

docker run \
--name microservice-db \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=microservice \
-p 5432:5432 \
-d postgres

Migrations:

generate new

make migration m="comment"

apply migrations

make migrate

Run locally

make run

Run in docker-compose environment

run

make docker-up
make docker-migrate

down

make docker-down

About

The Ultimate Super-Convenient Template for Microservices Based on FastAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published