Skip to main content

fast-backend-builder

fast-backend-builder is a project generator and manager for FastAPI with Tortoise ORM & Aerich.

💡 FastAPI Backend Builder – A lightweight library to help you quickly scaffold and build FastAPI projects.


📌 Overview

fast-backend-builder is designed for rapid web application development with FastAPI.
It comes bundled with tools and integrations to help developers create well-structured, maintainable, and production-ready FastAPI applications in no time.

The goal is to provide a one-stop solution to accelerate prototyping and simplify production deployment.

🔗 Source Code: GitHub Repository


✨ Features

  • 🚀 CRUD Base with GraphQL (Strawberry) – Auto-generate and manage CRUD endpoints with GraphQL support
  • 🔐 Authentication with JWT – Built-in secure authentication and token management
  • Redis Integration – Caching, sessions, and queue support with Redis
  • 📂 File Storage with MinIO – Easy file upload and attachment handling
  • 🔗 ESB Integrations – Simplified enterprise service bus support
  • 📬 BullMQ Integration – Notifications and queue management out of the box


🚀 Quick Start

Create FastAPI App for more visit https://fastapi.tiangolo.com/

⚙️ Installation

pip install fast-backend-builder

🚀 Setting Up a Custom User Model in FastAPI with Tortoise ORM + FastAPI-Builder

This guide explains how to create a package module for your User model, extend it from AbstractUser, configure it in Tortoise ORM, and generate GraphQL + migrations.


📂 Project Structure

myapp
  ├── mymodel_package
     ├── __init__.py
     └── models
         └── user.py
  ├── config
     ├── __init__.py
     └── tortoise.py
  ├── main.py
  └── ...

👤 1. Create Your Custom User Model

Inside mymodel_package/models/user.py:

from fast_backend_builder.models.base_models import AbstractUser


class User(AbstractUser):
    """Custom application user model extending AbstractUser."""
    pass

⚙️ 2. Set Your User Model in main.py (your main FastAPI file)

At the top of your main.py (before any model imports):

from fast_backend_builder.utils.config import set_user_model
from mymodel_package.models.user import User

# Register the User model so fast_backend_builder can resolve it
set_user_model(User, "models.User")

🗄️ 3. Create Tortoise ORM Config

Inside config/tortoise.py:

from decouple import config

db_url = f"postgres://{config('DB_USER')}:{config('DB_PASSWORD')}@{config('DB_HOST')}:{config('DB_PORT')}/{config('DB_NAME')}"

TORTOISE_ORM = {
    "connections": {"default": db_url},
    "apps": {
        "models": {
            "models": [
                "fast_backend_builder.models",   # built-in models
                "mymodel_package.models",    # your custom models
                "aerich.models",             # migration tracking
            ],
            "default_connection": "default",
        },
    },
    "use_tz": True,  # Enable timezone-aware datetimes
    "timezone": "Africa/Dar_es_Salaam",  # Set to EAT (Dar es Salaam)
}

🔧 4. Generate CRUD APIs via GraphQL

Run the following to scaffold GraphQL CRUD APIs:

# For your custom User model
graphql gen:crud-api user_management --module-package=mymodel_package.models --model User

# For fast_backend_builder built-in models
graphql gen:crud-api user_management --module-package=fast_backend_builder.models --model Group,Permission,Headship
graphql gen:crud-api workflow --module-package=fast_backend_builder.models --model Workflow,WorkflowStep,Transition,Evaluation

For your Models

# 
graphql gen:crud-api <module-name> --model Model1,Model2,Model3

# generating graphql schemas with attachments

graphql gen:crud-api <module-name> --model ModelName --with-attachment

# generating graphql schemas with transitions

graphql gen:crud-api <module-name> --model ModelName --with-transition

📦 5. Initialize Aerich (DB migrations)

# Initialize Aerich with your Tortoise ORM config
aerich init -t config.tortoise.TORTOISE_ORM

# Create initial migration & database tables
aerich init-db

📖 Documentation

Coming soon...


🤝 Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.


📜 License

This project is licensed under the Other/Proprietary License.

Thanks

Thanks for all the contributors that made this library possible, also a special mention to Japhary Juma, Shija Ntula and Juma Nassoro.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fast_backend_builder-0.1.3.56.tar.gz (71.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fast_backend_builder-0.1.3.56-py3-none-any.whl (91.2 kB view details)

Uploaded Python 3

File details

Details for the file fast_backend_builder-0.1.3.56.tar.gz.

File metadata

  • Download URL: fast_backend_builder-0.1.3.56.tar.gz
  • Upload date:
  • Size: 71.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for fast_backend_builder-0.1.3.56.tar.gz
Algorithm Hash digest
SHA256 0d5169b559db79060b8a22c4459f2b7e711472e11d1c287879423d78abf01608
MD5 af2e444f408107c17b2ad1f1b97346e3
BLAKE2b-256 dec28749eee97655cbf8d8d9977d4f522db5eda5004e19cd5cdaa464146abc2e

See more details on using hashes here.

File details

Details for the file fast_backend_builder-0.1.3.56-py3-none-any.whl.

File metadata

File hashes

Hashes for fast_backend_builder-0.1.3.56-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d2c4d30928b00fc0532b43a10cfc43c3d1096afb9692a5801d8411002f24e5
MD5 401eb319e38e5d7fd8cf1cde988ef56c
BLAKE2b-256 af4bdb9432431cbf4db9f6657046f672c3abe69345923e5edc063426ed4f1dc6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.3.56 This release

2 files

0.1.3.55

2 files

0.1.3.54

2 files

0.1.3.53

2 files

0.1.3.52

2 files

0.1.3.51

2 files

0.1.3.50

2 files

0.1.3.49

2 files

0.1.3.48

2 files

0.1.3.47

2 files

0.1.3.46

2 files

0.1.3.45

2 files

0.1.3.44

2 files

0.1.3.43

2 files

0.1.3.42

2 files

0.1.3.41

2 files

0.1.3.40

2 files

0.1.3.39

2 files

0.1.3.38

2 files

0.1.3.37

2 files

0.1.3.36

2 files

0.1.3.35

2 files

0.1.3.34

2 files

0.1.3.33

2 files

0.1.3.32

2 files

0.1.3.31

2 files

0.1.3.30

2 files

0.1.3.29

2 files

0.1.3.28

2 files

0.1.3.27

2 files

0.1.3.26

2 files

0.1.3.25

2 files

0.1.3.24

2 files

0.1.3.23

2 files

0.1.3.22

2 files

0.1.3.21

2 files

0.1.3.20

2 files

0.1.3.19

2 files

0.1.3.18

2 files

0.1.3.17

2 files

0.1.3.16

2 files

0.1.3.15

2 files

0.1.3.14

2 files

0.1.3.13

2 files

0.1.3.12

2 files

0.1.3.11

2 files

0.1.3.10

2 files

0.1.3.9

2 files

0.1.3.8

2 files

0.1.3.7

2 files

0.1.3.6

2 files

0.1.3.5

2 files

0.1.3.4

2 files

0.1.3.3

2 files

0.1.3.2

2 files

0.1.3.1

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page