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
Generateto 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_forge-0.5.1.tar.gz.
File metadata
- Download URL: fastapi_forge-0.5.1.tar.gz
- Upload date:
- Size: 113.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54707e84a79f33b9ab850659ad4b71be14942e63d9e1fdfacc26335d7c3da874
|
|
| MD5 |
e147ccd0a15e1a6d10dc59e4853c3965
|
|
| BLAKE2b-256 |
6dfedb20e2bbcaf5629eb4aee9a98c5787cc5baa952c2e1a5a5026d553d64784
|
File details
Details for the file fastapi_forge-0.5.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_forge-0.5.1-py3-none-any.whl
- Upload date:
- Size: 77.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d906a81cf498253c59f023d6ca7795ba083d2d2029f7cf05aa705a12fe3deaa
|
|
| MD5 |
5cc7c0ff008e4965709ddbe609001c0f
|
|
| BLAKE2b-256 |
c240e927b8211bb8199debb317aa69a928de16f38a189c7a1170ab9dc658b37f
|