edd34 / fast-api-sqlalchemy-template

Dockerized web application on FastAPI, sqlalchemy1.4, PostgreSQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async template on FastAPI and SQLAlchemy 1.4

GitHub issues GitHub forks GitHub stars GitHub license

Description

Production-ready dockerized async REST API on FastAPI with SQLAlchemy and PostgreSQL

Key Features

  • tests on pytest with automatic rollback after each test case
  • db session stored in Python's context variable
  • configs for mypy, pylint, isort and black
  • Alembic for DB migrations
  • CI with Github

After git clone run

task -l  # list of tasks with descriptions

Prepare virtual environment

python3 -m venv venv
source venv/bin/activate
poetry install

Poetry

Poetry is python package manager.

Poetry resolve dependencies and conflicts in package and make it fast.

Basic usage

  • poetry lock lock dependencies
  • poetry update lock, update and install dependencies
  • poetry install for install dependencies from pyproject.toml
  • poetry add <package> for adding dependency with check on conflicts
  • poetry remove <package> for remove
  • poetry self update update poetry

Task

Task is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make.

Basic usage

  • task -l - list of tasks with descriptions
  • task -a - list of all tasks

About

Dockerized web application on FastAPI, sqlalchemy1.4, PostgreSQL

License:MIT License


Languages

Language:Python 93.6%Language:Shell 2.4%Language:Dockerfile 2.3%Language:Mako 1.6%