Skip to main content

Generate FastAPI projects based on database schema.

Project description

🚀 FastAPI-Forge

⚡ UI Based FastAPI Project Generator

Define your database models through a UI, select services, and get a complete production-ready containerized project with tests and endpoints!

🔥 Features

🖌️ UI Power

  • 🖥️ NiceGUI-based interface for project design
  • 📊 Visual model creation and configuration
  • ✅ Checkbox additional services to be integrated
  • 🚀 Quick-add common fields
  • ⚙️ One-click project generation

⚡ Auto-Generated Components

  • 🗄️ SQLAlchemy Models
  • 📦 Pydantic Schemas
  • 🌐 RESTful Endpoints (CRUD + more)
  • 🧪 Comprehensive Test Suite (pytest)
  • 🏗️ DAOs (Database Access Objects)
  • 🏭 Factory Boy Test Factories
  • 🐳 Docker Compose Setup

🎛️ Advanced Features

  • 🎚️ Custom Enum support as data types
  • 📥 YAML project import/export
  • 🐘 Convert existing databases into FastAPI projects via connection string!
    • Basically lets you quickly create an API for any database.

🔄 CI/CD Automation

  • ⚙️ GitHub Workflows for automated testing and linting
    • 🧪 Runs pytest suite
    • ✨ Executes code formatting checks
    • ✅ Ensures code quality before merging

🧩 Optional Integrations

Category Technologies
Messaging RabbitMQ
Caching Redis
Task Queues Celery, TaskIQ
Auth JWT Authentication
Monitoring Prometheus
Storage S3
Migrations Alembic

Much more to come!

UI for designing your API projects

UI Interface

Generated project example

Generated Project Structure

✅ Requirements

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

🚀 Quick Start

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 # Builds and runs your project along with additional services
  • 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

--conn-string

Load an existing Postgres database schema:

fastapi-forge start --conn-string=postgres://user:pass@localhost/db_name

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.10.1.tar.gz (131.2 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.10.1-py3-none-any.whl (110.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastapi_forge-0.10.1.tar.gz
Algorithm Hash digest
SHA256 0582cbe88b12ca03da71ae3e06abcf5818e0e632d09f70205ec806c4ba026b4b
MD5 b0eb86afde6671d7ba88bb559f51736e
BLAKE2b-256 3a153e38c51795fa60d61242d0c39b66272e6cf7cc615870b634ae0835eb7911

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fastapi_forge-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b6cc769fbd511ab3dfd0ec72af629eba4543e57de9f69ec721bc334bb660d2b9
MD5 ee289577912e1a38b1e2a14117fb4a60
BLAKE2b-256 b0e18fa6455fe4a84ef7ac8e3452dbe87621d5379e7ec37ee023f7420850309f

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