This repository has been developed to boost development of microservices in Python FastAPI Framework. You can extend from it and do not worry about basic staffs like dockerizing app, make files, loggers and etc.
- Clone this repository to local machine
- Delete .git directory
- Setup needs for your project
- Create new repository on github
- Add your project to remote github repository
- Create new token on github
- Copy the generated token
- Clone the repository by running command:
git clone https://{token}@github.com/laziest-coder/fastapi-service-blueprint.git
- Run the following command:
rm -rf .git
cp .env.example .env
to create.env
file.- Fill in the app settings and credentials in the
.env
file. - Replace
{port}
parts indocker-compose.yml
file with your desired port number. Also, replace{service_container_name}
to give correct name for project container. - Update
requirements.txt
file in case you need some external libraries. But you can do this step later. - In case you want some specific version of python, update it in section
FROM python:3.9
ofDockerfile
- Run
docker-compose up --build
to build project container - Make sure everything is working as expected by making API request from your favorite REST Client(Insomnia or Postman)
to endpoint
http://localhost:{port}/v1/example-route?order_id=32123
- Head to your repositories page
- Create new repository on this page
git init
to start tracking your project.git add . && git commit -m 'initial commit'
to make first commit to the project.git remote add origin {link to your new github repository}
git push --origin master
to push your local changes to remote repository.
That is all! Now you can start doing some magic with your project :)