Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.72 KB

README.md

File metadata and controls

47 lines (36 loc) · 1.72 KB

FastAPI starter

This repository is to be used as a starter for FastAPI based Python applications.

Features

Prerequisites

Project Structure

  .
  ├── app                     # Contains code base.
  │   ├── apps                # Contains python subpackages for each registered app
  │       ├── `app_name`
  │       │   ├── api         # Contains API endpoints declaration
  │       │   ├── dtos        # Contains DTO declarations
  │       │   └── use_cases   # Contains this app's use cases
  │       └── routes.py       # Registers all routers from all applications
  │   ├── core                # Configs and settings, logging, etc
  │   └── lib                 # Contains reusable base/abstract classes, helpers, etc
  ├── docker                  # Contains docker related files
  ├── tests                   # Tests
  └── ...

Useful commands

  • poetry install- creates virtualenv and installs project dependencies
  • poetry lock- updates poetry.lock
  • poetry update- updates packages locally and updates poetry.lock

Project tasks list (uses taskipy to execute, example: poetry run task mypy-lint)

  • ruff - runs ruff on a project files
  • tests - runs tests
  • mypy-lint - run mypy lint
  • ruff-lint - runs ruff check (to use in CI/CD)
  • format-and-lint- shortcut to run ruff and mypy