This boilerplate leverages route-service structure, is equipped with pre-commit hooks, github actions and dependabot and is constructed as per personal preference of workflow for quick API development.
- From Settings > General: select the checkbox
Tempate repository. - This will add a
use this templatebutton. When need to use this as a template, use the button.
add text for project overview
Developed on: python 3.10.16
To build and run the application using Docker, follow these steps:
Ensure you have Docker installed on your machine. You can download it from here.
Important
Docker Daemon or Docker Desktop must be running while building Docker Image.
Navigate to the root directory of the repo where the Dockerfile is located and run the following command to build the Docker image:
docker build -t <project_name>:latest .After building the Docker image, you can run it using the following command:
docker run -dp 8000:8000 <project_name>:latestor give the container a name:
docker run -dp 8000:8000 --name <project_name>-latest <project_name>:latestThis will start the application in a Docker container. The application can be accessed at http://localhost:8000 e.g. 127.0.0.1:8000
Note
-dp (-d & -p) tag runs the container in detached mode (in the background, terminal is available to use right away) and container port 8000 is mapped to local port 8000.
To stop the running container, first find the container ID using:
docker psThen stop the container using:
docker stop <container_id>- [optional but recommended] create a venv and activate it
- Install dependencies:
pip install -r requirements.txt
- start Uvicorn server:
uvicorn app.main:app --reload
ctrl+cto break the server.
- develop pipeline π€
- Expose the pipeline with api end points π
- unit testing π§ͺ
- write comprehensive readme πβ¨
- write readme-dev π
- dockerize the repo π³
- Code Auto-formatting & Linting with Pre-commit (check-yaml, end-of-file-fixer, trailing-whitespace, black, isort, mypy, flake8, bandit) π¨
- add GitHub Action for format checks β
- Study deploy requirement and deploy! π
add resources here
Bug reports, issues, forks and pull requests are always welcome!
This project is available as open source under the MIT License. See the LICENSE file for details.