Skip to content

Template for python backend project using FastAPI+TortoiseORM+poetry+aerich

License

Notifications You must be signed in to change notification settings

waketzheng/fastapi-tortoise-poetry-template

Repository files navigation

fastapi-tortoise-poetry-template

Python Versions Mypy coverage Ruff CI Coverage Status

Template for python backend project using FastAPI+TortoiseORM+poetry+aerich

Inspired by full-stack-fastapi-template

Technology Stack and Features

  • FastAPI for the Python backend API.
    • 🧰 TortoiseORM for the Python SQL database interactions (ORM).
    • 🔍 Pydantic, used by FastAPI, for the data validation and settings management.
  • ✅ Tests with Pytest.

Quickstart

poetry shell
poetry install
# For MySQL: poetry install -E mysql
# For PostgreSQL: poetry install -E postgres
aerich init-db
python app.py

How To Use It

You can just fork or clone this repository and use it as is.

✨ It just works. ✨

How to Use a Private Repository

If you want to have a private repository, GitHub won't allow you to simply fork it as it doesn't allow changing the visibility of forks.

But you can do the following:

  • Create a new GitHub repo, for example my-backend-project.
  • Clone this repository manually, set the name with the name of the project you want to use, for example my-backend-project:
git clone [email protected]:waketzheng/fastapi-tortoise-poetry-template.git my-backend-project
  • Enter into the new directory:
cd my-backend-project
  • Set the new origin to your new repository, copy it from the GitHub interface, for example:
git remote set-url origin [email protected]:octocat/my-backend-project.git
  • Add this repo as another "remote" to allow you to get updates later:
git remote add upstream [email protected]:waketzheng/fastapi-tortoise-poetry-template.git
  • Push the code to your new repository:
git push -u origin master

About

Template for python backend project using FastAPI+TortoiseORM+poetry+aerich

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages