/fastapi-template

FastAPI template with DDD design

Primary LanguagePythonBSD 2-Clause "Simplified" LicenseBSD-2-Clause

FastAPI Template Project

Installation

Install pyenv (optional step)

  1. install pyenv to system (if not)
  2. install python 3.12 with pyenv
  3. setup pyenv for use python 3.12 in project folder

Install project

  1. install poetry
  2. clone this project
  3. cd to project directory
  4. run:
poetry install --with dev

Start application (in dev mode)

In root folder of project:

poetry run uvicorn app.main:get_app --host 0.0.0.0 --port 8000 --reload --factory

Or separately:

poetry shell
uvicorn app.main:get_app --host 0.0.0.0 --port 8000 --reload --factory

How work with migrations:

source upgrade

alembic upgrade head