Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fapier-0.1.6.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fapier-0.1.6-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file fapier-0.1.6.tar.gz.

File metadata

  • Download URL: fapier-0.1.6.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fapier-0.1.6.tar.gz
Algorithm Hash digest
SHA256 ce77057f0fdf7bafe7794a144d3ec051c32c9c2d1cf3b3560bbaf23502a2db16
MD5 1adf322ff4754ff9cec35b00132782ee
BLAKE2b-256 93f59246d48215d5e07d41d00ab763d2cafd93fb6124ff0a80940a2d366a6000

See more details on using hashes here.

File details

Details for the file fapier-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fapier-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for fapier-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 1a2259a00ba17fe3a276291b3ce38e65180b814a813d10024e3499f36e9b211e
MD5 ce61e50ccb62b82ba4c7459cf28ffa6e
BLAKE2b-256 b92eccd1ec9e5c13c4fa4ee0e9455a63796451b086e902a6b7818f64c95594c6

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