A command-line tool to scaffold and bootstrap FastAPI projects quickly.
Project description
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 |
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!
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 fapier-0.1.9.tar.gz.
File metadata
- Download URL: fapier-0.1.9.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79e7830bc36803dce6f76ec6cb50dd729b14689768bddc7cfbbb3b9a0620318f
|
|
| MD5 |
1baf8f72545a1a37bfd33c12b690f505
|
|
| BLAKE2b-256 |
f80fb64d1b3562c3753a8aad9d72bdd067cba990cec2f33514cd41da1e413195
|
File details
Details for the file fapier-0.1.9-py3-none-any.whl.
File metadata
- Download URL: fapier-0.1.9-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8834432f28a87853bcae2872f936eae247b4f1d15d16a0c0a615f80cd04f711c
|
|
| MD5 |
d16e8626dfc0bc6434b3f220afd2cda5
|
|
| BLAKE2b-256 |
eaf33055847583b04fed3bcbe7c34322870af11531c6a81405e907b564248554
|