Skip to main content

fastapi-init-cli 🚀

An interactive, production-ready CLI tool to scaffold modern FastAPI backends in seconds.

PyPI version Python versions License: MIT


✨ Features

  • Async-First & Sync Support: Async SQLAlchemy 2.0 (asyncpg, aiomysql, aiosqlite) or standard Sync.
  • Multiple Databases: PostgreSQL, MySQL, and SQLite.
  • Modular Authentication:
    • JWT (Access & Refresh tokens with Bearer auth)
    • Google OAuth 2.0 integration
    • OTP-based Email Verification
    • OTP-based Forgot & Reset Password flow
    • Secure bcrypt password hashing
  • Clean Architecture:
    • app/core/ (Pydantic v2 settings, database session dependency, security)
    • app/models/ (SQLAlchemy 2.0 models)
    • app/schemas/ (Pydantic v2 request/response schemas)
    • app/services/ (Clean business logic layer)
    • app/routes/ (Versioned FastAPI routers)
  • Database Migrations: Automatic async/sync Alembic migration setup.
  • Zero Runtime Lock-in: The scaffolded project is 100% standard FastAPI with no dependency on fastapi-init-cli.

📦 Installation

pip install fastapi-init-cli

🚀 Quickstart

Run the interactive CLI:

fastapi-init

(or fastapi-init-cli)

Interactive Walkthrough:

╭─────────────────────────────────────────────────────────────╮
│                        FastAPI Init                         │
│       Create a production-ready FastAPI backend in seconds.  │
╰─────────────────────────────────────────────────────────────╯

? Project / Folder name: backend
? Select database engine: PostgreSQL
? Select execution architecture: Async
? Do you want authentication? Yes
? Select authentication method: JWT + Google OAuth
? Do you want email verification? (OTP-based) Yes
? Do you want forgot-password functionality? (OTP-based) Yes
? Do you want database migrations with Alembic? Yes

Then start your new backend:

cd backend
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn app.main:app --reload

🛠️ Development & Contributing

  1. Clone the repository:

    git clone https://github.com/your-username/fastapi-init.git
    cd fastapi-init
    
  2. Install in editable mode with development dependencies:

    pip install -e ".[dev]"
    
  3. Run tests:

    pytest
    

📄 License

This project is licensed under the MIT License - see the LICENSE file for 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_init_cli-1.0.0.tar.gz (21.6 kB view details)

Uploaded Source

Built Distribution

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

fastapi_init_cli-1.0.0-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_init_cli-1.0.0.tar.gz.

File metadata

  • Download URL: fastapi_init_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 21.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for fastapi_init_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1c64c8e7ffdd9e8aa8498ccf3df71c6f69b4b5b5b51ebc4315a453fc1802e61a
MD5 2e4e97f2a53e4a7c89fb75f550244464
BLAKE2b-256 a6cb110bfee6858940ff30283c2429f3db8dd39319fd8f6a5077f5ea3a2b5b52

See more details on using hashes here.

File details

Details for the file fastapi_init_cli-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_init_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dfbdd347d6a5eb199e7e3dac5b9f2a38d1030dc52626f6d10620e08fdecd79a
MD5 3aa1e26fb99939b16824c6a0b184a85c
BLAKE2b-256 4f6ac439e087657f76b3024d756e4961111b7d43d05f631960b465d40ed8e013

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

This release

1.0.0 This release

2 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