Metadata-Version: 2.4
Name: fastapi-clean-scaffold
Version: 0.1.0
Summary: A generic CLI tool to scaffold production-ready FastAPI projects based on clean architecture.
Author: Vraj Makvana
Keywords: fastapi,scaffold,boilerplate,cli,generator,sqlalchemy,alembic
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# FastAPI Boilerplate Generator (`fastapi-scaffold`)

A production-ready, highly flexible CLI tool and Python package for automatically generating FastAPI project structures based on clean architecture best practices.

Features out of the box:
- **Flagship Architecture (`fastapi-clean`)**: FastAPI, SQLAlchemy 2.0 (ORM), Alembic migrations, Repository Pattern, Services Layer, Pydantic v2, JWT Auth, and prebuilt `fastapi-response-handler` integration.
- **Smart Template Substitution**: Auto-configures project names, slug strings, database URLs, and generates cryptographically secure JWT keys.
- **Generic & Extensible**: Support custom local or git templates (`--template`), Docker support (`--docker`), and CI/CD GitHub Actions (`--github-actions`).
- **Interactive Wizard**: Run `fastapi-scaffold init` to interactively construct your project setup.

---

## ⚡ Installation

Install locally in editable mode:
```bash
pip install -e .
```

Or install from source:
```bash
pip install .
```

---

## 🚀 Quick Start

### 1. Scaffold a New Project
```bash
fastapi-scaffold create my_awesome_app --db-name my_awesome_db --docker
```
Or use the shorter aliases:
```bash
py-scaffold create my_awesome_app
# or
lala-cli create my_awesome_app
```

### 2. Interactive Wizard Mode
```bash
fastapi-scaffold init
```

### 3. List Available Templates
```bash
fastapi-scaffold list-templates
```

---

## 📂 Generated Project Architecture (`fastapi-clean`)

```text
├── alembic/                # Alembic configuration scripts
├── app/
│   ├── api/                # API Routers & Controllers
│   ├── common/             # Helper utilities
│   ├── core/               # App configuration, logging, exceptions, JWT auth
│   ├── db/                 # Database base class, session, models, seeds, & alembic versions
│   ├── repository/         # Data Access Layer (Repository pattern)
│   ├── schema/             # Pydantic schemas
│   ├── services/           # Business logic layer
│   └── main.py             # FastAPI entrypoint
├── .env.dev                # Development environment secrets
├── .env.prod               # Production environment secrets
├── alembic.ini             # Database migration config
├── Dockerfile              # Container manifest (optional)
├── docker-compose.yml      # Service composition (optional)
├── requirements.txt        # Prebuilt dependencies (including fastapi-response-handler)
└── README.md
```

---

## 🔧 CLI Options

```text
usage: fastapi-scaffold create [-h] [--db-name DB_NAME] [--template TEMPLATE]
                               [--db-type {postgres,sqlite}] [--docker]
                               [--github-actions] [--no-input] [--force]
                               [--output-dir OUTPUT_DIR]
                               [project_name]

positional arguments:
  project_name          Name of the project to create

options:
  -h, --help            show this help message and exit
  --db-name DB_NAME     Database name (default: <project_slug>_db)
  --template TEMPLATE   Template to use ('fastapi-clean', 'fastapi-minimal', or a path/URL)
  --db-type {postgres,sqlite}
                        Database backend type
  --docker              Add Dockerfile and docker-compose.yml
  --github-actions      Add GitHub Actions CI workflow
  --no-input            Run in non-interactive mode using default options
  --force, -f           Overwrite output directory if it already exists
  --output-dir, -o OUTPUT_DIR
                        Target directory to scaffold into
```
