Skip to main content

FastAPI Project Generator CLI

A CLI tool that scaffolds FastAPI projects with optional database and API structure.


✅ Features

Feature Description
Generate FastAPI project Creates a full FastAPI folder structure
Optional Database SQLite, PostgreSQL (Async), or MongoDB
Redis & Caching Optional integrated Redis support
JWT Authentication Scaffold a full Auth system (JWT + Password Hashing)
WebSockets Integrated WebSocket support & boilerplates
Background Tasks Support for Celery or Arq workers
Mail Service Integrated FastAPI-Mail support
fapi run Automatically detect entry point & run with uvicorn
fapi add commands Easily add routes, models, schemas, crud, services

📂 Project Output Structure

When everything is enabled:

project_name/
 ├─ app/
 │  ├─ main.py
 │  ├─ core/
 │  │   ├─ config.py      # Core config with .env loading
 │  │   ├─ database.py    # DB connection (SQLAlchemy Async or MongoDB)
 │  │   └─ security.py    # JWT & Auth logic
 │  ├─ models/
 │  │   └─ user.py
 │  ├─ schemas/
 │  │   └─ user.py
 │  ├─ crud/
 │  │   └─ user.py
 │  ├─ services/
 │  │   ├─ email.py       # Mail service
 │  │   └─ passwordHash.py
 │  ├─ api/
 │  │   ├─ ws/            # WebSocket routes
 │  │   ├─ deps.py        # DI for Auth
 │  │   └─ router.py      # Main router
 │  ├─ tasks/             # Worker logic (Celery/Arq)
 │  └─ __init__.py
 ├─ .fastapi              # internal flag to detect project
 ├─ .env                  # Generated with configured keys
 ├─ requirements.txt
 └─ .venv/

🧰 Installation

Clone Repo

pip install fapier

or

pipx install fapier

Requires Python 3.10+


Usage

Create a project

fapi create myProject

Advanced Options

fapi create myProject --db postgres --is-async --redis --auth jwt --websockets --tasks celery --mail --routes
Option Flag Description
Database --db sqlite, postgres, or mongodb
Async --is-async Enable async mode for SQLAlchemy
Redis --redis Add Redis integration
Auth --auth Scaffold JWT Auth (jwt)
WebSockets --websockets Add WebSocket boilerplates
Tasks --tasks celery or arq
Mail --mail Add Mail Service

Add new components

fapi add route product
fapi add model product --schema --crud
fapi add service payment
fapi add schema product
fapi add crud product

🚀 Run the project

Just navigate into your project and run:

fapi run

This automatically detects the virtual environment and runs the project using uvicorn app.main:app --reload.


📌 Roadmap

Feature Status
Basic FastAPI scaffold ✅ Done
PostgreSQL & MongoDB ✅ Done
Async DB Support ✅ Done
JWT Authentication ✅ Done
Redis & WebSockets ✅ Done
Background Workers ✅ Done
fapi run command ✅ Done
Publish on PyPI ✅ Done
fapi add commands ✅ Done
Alembic migrations 🔜 Planned
Docker support 🔜 Planned

🤝 Contributing

Pull requests are welcome! 👐


⭐ If you like this tool, give the repo a star!

Metadata

Release files for fapier 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fapier 0.1.11
File Size Uploaded
fapier-0.1.11.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fapier 0.1.11
File Interpreter ABI Platform
fapier-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 40.7 kB

Release files / fapier-0.1.11.tar.gz

Download URL fapier-0.1.11.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f0806f9782642f6e87ccbfe84a77f7f812484f102293003e887cdd0313dc62
BLAKE2b-256 checksum
How to use checksums
99dfeb61e5cecb3650ea0083bf61bbcf60577fd2111ef3b8ffff92db6cc07e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / fapier-0.1.11-py3-none-any.whl

Download URL fapier-0.1.11-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
168b3e83d22afe83599637a86d1047c0fef08bd88ad49778aa7c7b391cf06e50
BLAKE2b-256 checksum
How to use checksums
0fde9521c8fc6681720ef73769ea0df964857b6b764ef2b9049407bc42ac5d4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

1 release file

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release 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