A simple restful fastapi template, using PostgreSQL as database and Redis as cache, deployed on Kubernetes with Helm. There is a full CI/CD pipeline, testing and other more tools to implement it.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
- Python 3.8
- Poetry 1.1.12
- Docker 20.10.12
- Make 3.81
- Init environment, which will help you init poetry and install dependencies, it will also copy a new
.env
file.
make init
- Install pre-commit hook, it will run
make ci-bundle
to ensure code quality when you commit.
poetry run pre-commit install
- Run migrate command to use alembic upgrade database.
make migrate
- Enter the environment and start developing
poetry shell
- Start related components of API service
make service_up
- run test to make sure project work correctly, this project use
pytest
andpyytest-cov
for testing
make test
- Start development API service, the service will run at
http://localhost:8000
cd api && poetry run uvicorn app:APP --reload --host 0.0.0.0
- This project uses
black
,isort
,flake8
,pylint
for formatting and linting, you can customize these settings in the setup.cfg file.
make format
make lint
- Add Redis cache
- User Docker multiple stage build
- arashi87 (arasi27676271@gmail.com)