Skip to main content

Generate FastAPI projects based on database schema.

Project description

FastAPI-Forge

🚀 Build Production-Ready FastAPI Projects — Fast, Scalable, and Hassle-Free!

FastAPI-Forge lets you go from database schema to a fully functional FastAPI-based project in minutes — no boilerplate, no hassle. With its clean, intuitive UI, you can define your Postgres or MySQL models and easily add optional services like Redis, message brokers, task queues, Prometheus, authentication, Elasticsearch, and more! It automatically generates everything you need — routes, DAOs, DTOs, models, and tests — following best practices in a scalable, easy-to-maintain project architecture.

Stop boilerplating. Start building.


✅ Requirements

  • Python 3.12+
  • UV
  • Docker and Docker Compose (for running the generated project)

🚀 Installation

Install FastAPI-Forge:

pip install fastapi-forge

🛠 Usage

Start the project generation process:

fastapi-forge start
  • A web browser will open automatically.
  • Define your database schema and service specifications.
  • Once done, click Generate to build your API.

To start the generated project and its dependencies in Docker:

make up
  • The project will run using Docker Compose, simplifying your development environment.
  • Access the SwaggerUI/OpenAPI docs at: http://localhost:8000/docs.

⚙️ Command Options

Customize your project generation with these options:

--use-example

Quickly spin up a project using one of FastAPI-Forge’s prebuilt example templates:

fastapi-forge start --use-example

--no-ui

Skip the web UI and generate your project directly from the terminal — perfect for headless environments or CLI-first workflows:

fastapi-forge start --no-ui

--from-yaml

Load a custom YAML configuration and either generate the project immediately (with --no-ui) or review and adjust it in the UI:

fastapi-forge start --from-yaml=~/path/to/config.yaml

🧑‍💻 Examples

Use an Example Template

fastapi-forge start --use-example

Generate a Project Without the UI

fastapi-forge start --no-ui

Generate a Project from a YAML Configuration

fastapi-forge start --from-yaml=~/Documents/project-config.yaml

Combine Options

Load a YAML config and skip the UI:

fastapi-forge start --from-yaml=~/Documents/project-config.yaml --no-ui

🧰 Using the Makefile

The generated project includes a Makefile to simplify common dev tasks:

Start the Application

make up

Run Tests

Tests are automatically generated based on your schema — no need to write them from scratch. Once the app is running (make up):

make test

Run Specific Tests

make test-filter filter="test_name"

Format and Lint Code

Keep your code clean and consistent:

make lint

📦 Database Migrations with Alembic

If you chose Alembic for migrations during project setup, these commands will help manage your database schema:

Generate a New Migration

make mig-gen name="add_users_table"

Apply All Migrations

make mig-head

Apply the Next Migration

make mig-up

Roll Back the Last Migration

make mig-down

Project details


Download files

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

Source Distribution

fastapi_forge-0.3.6.tar.gz (87.5 kB view details)

Uploaded Source

Built Distribution

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

fastapi_forge-0.3.6-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_forge-0.3.6.tar.gz.

File metadata

  • Download URL: fastapi_forge-0.3.6.tar.gz
  • Upload date:
  • Size: 87.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastapi_forge-0.3.6.tar.gz
Algorithm Hash digest
SHA256 5f6c1cdff447617400990f46af18e003fb9f44fab364d0c8b458ca9fb07dc717
MD5 8558ebf0abb680c561582cfe63bcbcba
BLAKE2b-256 a574bbeb92fc4982f6cdc055d91bb91e7e7e905b8e89ab24a9621d3402dfc8d2

See more details on using hashes here.

File details

Details for the file fastapi_forge-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: fastapi_forge-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for fastapi_forge-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 dcc31cf33ca092340b58f701e5eba8924db3d438b0c3da79bd8c946a7e4a5046
MD5 707fa04c31e7ab30c92bbad1ae56dada
BLAKE2b-256 348f4cc1c4e9d2a70a559b501fad3f3653bae9b4316052dc8d75c51a811d8b52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page