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 .envto create.envfile.- Fill in the app settings and credentials in the
.envfile. - Replace
{port}parts indocker-compose.ymlfile with your desired port number. Also, replace{service_container_name}to give correct name for project container. - Update
requirements.txtfile 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.9ofDockerfile - Run
docker-compose up --buildto 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 initto 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 masterto push your local changes to remote repository.
That is all! Now you can start doing some magic with your project :)