Skip to main content

Generate FastAPI projects based on database schema.

Project description

FastAPI-Forge

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

FastAPI-Forge lets you define your database models through a UI, letting you select additional optional services, and then generates a full working project for you, with tests and endpoints. The generated project follows best practices, in an easy-to-work with and scalable architecture. It will contain SQLAlchemy models of the database models you've defined in the UI, along with implementations of your selected services.


✅ 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:

fastapi-forge start --no-ui

--from-yaml

Load a custom YAML configuration (can be generated through the UI):

fastapi-forge start --from-yaml=~/path/to/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. 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.12.tar.gz (95.6 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.12-py3-none-any.whl (58.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_forge-0.3.12.tar.gz
  • Upload date:
  • Size: 95.6 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.12.tar.gz
Algorithm Hash digest
SHA256 d589e2eb8d4d22e6d8655b69d5d59691770d3cd7c2322bd611542da934b73607
MD5 1eaa28ed9db2e0e0cb786bfc0e24c11b
BLAKE2b-256 a1ddd3caea60901b79ea0706dcd020d89cffd5956023fcffe25a92f16ab341cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_forge-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 58.4 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.12-py3-none-any.whl
Algorithm Hash digest
SHA256 2383f3f2e2e7d69629e832b044905b46d6146c98b636956b5ffd47a7179d8399
MD5 ebc08c424224c3c1a35ada727f6314ac
BLAKE2b-256 aea33a530078c4a4a42cc8d897dec3caa6a54bcb092ac58a95be4e87019c7c5e

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