Metadata-Version: 2.4
Name: fastapi-smith
Version: 0.1.2
Summary: Interactive CLI to scaffold FastAPI projects with database, auth, admin, and more
Project-URL: Homepage, https://github.com/dhruvbhavsar0612/fastsql-project-setup
Project-URL: Repository, https://github.com/dhruvbhavsar0612/fastsql-project-setup
Project-URL: Documentation, https://github.com/dhruvbhavsar0612/fastsql-project-setup#readme
Project-URL: Issues, https://github.com/dhruvbhavsar0612/fastsql-project-setup/issues
Project-URL: Changelog, https://github.com/dhruvbhavsar0612/fastsql-project-setup/blob/main/CHANGELOG.md
Author-email: Dhruv Bhavsar <dhruvbhavsar0612@gmail.com>
Maintainer-email: Dhruv Bhavsar <dhruvbhavsar0612@gmail.com>
License: MIT
License-File: LICENSE
Keywords: admin,async,boilerplate,cli,cookiecutter,fastapi,mysql,postgresql,project-generator,scaffold,sqlalchemy,sqlite,template
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
Classifier: Topic :: Software Development :: Code Generators
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: jinja2>=3.1.0
Requires-Dist: questionary>=2.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == 'dev'
Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest-cov>=5.0.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.4.0; extra == 'dev'
Description-Content-Type: text/markdown

# fastapi-smith

[![PyPI version](https://badge.fury.io/py/fastapi-smith.svg)](https://badge.fury.io/py/fastapi-smith)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/dhruvbhavsar0612/fastsql-project-setup/actions/workflows/ci.yml/badge.svg)](https://github.com/dhruvbhavsar0612/fastsql-project-setup/actions/workflows/ci.yml)

Interactive CLI to scaffold production-ready FastAPI projects with database, authentication, admin panel, and more.

## Features

- **Interactive prompts** - Answer questions to customize your project
- **Production-ready** - Best practices baked in from the start
- **Highly configurable** - Choose your database, ORM, auth, and more
- **Modern tooling** - Ruff, mypy, pre-commit, GitHub Actions
- **Docker support** - Multi-stage Dockerfile and docker-compose included

## Installation

```bash
# Using uvx (recommended - no install needed)
uvx fastapi-smith

# Or install globally with uv
uv tool install fastapi-smith

# Or with pip
pip install fastapi-smith
```

## Quick Start

Simply run:

```bash
fastapi-smith
```

Follow the interactive prompts to configure your project. A new directory will be created with your complete FastAPI application.

```bash
cd my-project
uv sync
uv run uvicorn app.main:app --reload
```

## Configuration Options

### Project Basics
- Project name, description, author
- Python version (3.10, 3.11, 3.12, 3.13)

### Database & ORM
| Database   | Drivers                    | ORMs                              |
|------------|----------------------------|-----------------------------------|
| PostgreSQL | psycopg3 (async)           | SQLAlchemy 2.0, SQLModel          |
| MySQL      | asyncmy                    | SQLAlchemy 2.0, SQLModel          |
| SQLite     | aiosqlite                  | SQLAlchemy 2.0, SQLModel          |
| -          | -                          | Tortoise-ORM (any DB)             |

Migrations: **Alembic** (SQLAlchemy/SQLModel) or **Aerich** (Tortoise-ORM)

### Authentication
- **JWT** - JSON Web Tokens with refresh tokens
- **OAuth2** - Password flow with bearer tokens
- **Session** - Server-side sessions with cookies
- **None** - No authentication

### Admin Panel
- **SQLAdmin** - Beautiful admin interface for SQLAlchemy/SQLModel

### Caching
- **Redis** - Distributed caching
- **Memcached** - High-performance caching
- **In-memory** - Simple local caching

### Message Queue & Background Tasks
| Broker   | Task Queues                          |
|----------|--------------------------------------|
| RabbitMQ | Celery, Taskiq                       |
| Redis    | Celery, ARQ, Taskiq                  |
| -        | Built-in BackgroundTasks             |

### Logging & Monitoring
- **Loguru** - Modern logging with rich formatting
- **structlog** - Structured logging for production
- **Standard** - Python's built-in logging
- **Sentry** - Error tracking integration
- **Health checks** - Kubernetes-ready endpoints

### Development Tools
| Category        | Options                        |
|-----------------|--------------------------------|
| Package Manager | uv, pip                        |
| Linting         | Ruff, Black + isort            |
| Type Checking   | mypy (strict/standard), Pyrefly|
| Testing         | Pytest with async support      |
| Pre-commit      | Automated code quality hooks   |

### Deployment
- **Docker** - Multi-stage build with non-root user
- **docker-compose** - Full stack with DB, Redis, etc.
- **GitHub Actions** - CI/CD workflows

### AWS Integration
- **S3** - Object storage with boto3
- **SES** - Email service
- **ECR** - Container registry
- **ECS** - Container orchestration deployment

### Project Structure
```
my-fastapi-app/
├── app/
│   ├── __init__.py
│   ├── main.py              # FastAPI application
│   ├── config.py            # Settings with pydantic-settings
│   ├── database.py          # Database connection & session
│   ├── models/              # SQLAlchemy/SQLModel models
│   ├── schemas/             # Pydantic schemas
│   ├── routes/              # API route handlers
│   ├── services/            # Business logic
│   ├── core/                # Security, logging, caching
│   └── admin/               # SQLAdmin views
├── migrations/              # Alembic migrations
├── tests/                   # Pytest tests
├── .github/workflows/       # CI/CD pipelines
├── .env.example             # Environment template
├── pyproject.toml           # Dependencies & tool config
├── Dockerfile               # Multi-stage build
├── docker-compose.yml       # Local development stack
└── README.md                # Project documentation
```

## Development

```bash
# Clone the repo
git clone https://github.com/dhruvbhavsar0612/fastsql-project-setup.git
cd fastsql-project-setup

# Install dependencies
uv sync

# Run locally
uv run fastapi-smith

# Run tests
uv run pytest

# Type checking
uv run mypy src

# Linting
uv run ruff check src
```

## Contributing

Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Links

- [GitHub Repository](https://github.com/dhruvbhavsar0612/fastsql-project-setup)
- [Issue Tracker](https://github.com/dhruvbhavsar0612/fastsql-project-setup/issues)
- [Changelog](CHANGELOG.md)
