GitHunt
EL

eliasposen/fast-api-async-task-boilerplate

FastAPI / PonyORM / Python rq boilerplate project

FastAPI-PonyORM-RQ Boilerplate

โš ๏ธ ๐Ÿ”ง ๐Ÿ‘ท Work in Progress ๐Ÿ‘ท ๐Ÿ”ง โš ๏ธ

Overview

Boilerplate project for a microservice that is easy to extend with new endpoints that trigger asynchronous and synchronous actions.

Stack

Goals ๐Ÿš€

  • FastAPI authentication/authorization via OAuth2 & JWT token
  • Sample public and private endpoints
  • Retrieve async task info by UUID via task endpoint
  • Sample async task implementation with associated POST endpoint
  • User roles
  • User management via endpoints
  • SSO via SAML 2.0
  • Dockerfile and docker-compose configurations
  • K8s/Helm deployment specs and charts
  • Usage and extension documentation

Installation

Environment

conda create -n boilerpate python=3.10
conda activate boilerpate
poetry install

(Assumes all following command are within boilerpate virtual environment)

Database

Configure PostgreSQL database variables in .env. The microservice expects the database to exist and for the database user to have access.

Githooks

pre-commit install

Start Webserver

source .env
uvicorn app.api.main:app --reload

Swagger documentation served at http://localhost:8000/docs

Start RQ Worker

rq worker

Create User

Create user via CLI. Run following for help message

python -m scripts.create_user --help