Metadata-Version: 2.4
Name: fastapi-fastio
Version: 0.1.2
Summary: Opinionated FastAPI project scaffolding CLI for services, monoliths, and monorepos.
Project-URL: Homepage, https://github.com/goloodev/fastio
Project-URL: Repository, https://github.com/goloodev/fastio
Project-URL: Issues, https://github.com/goloodev/fastio/issues
Author-email: goloodev@gmail.com
License: MIT
License-File: LICENSE
Keywords: cli,fastapi,microservices,monolith,scaffold,template,uv
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Code Generators
Requires-Python: >=3.11
Requires-Dist: click>=8.1.0
Requires-Dist: jinja2>=3.1.4
Requires-Dist: pydantic>=2.8.2
Requires-Dist: rich>=13.7.1
Requires-Dist: typer>=0.12.5
Description-Content-Type: text/markdown

# fastio

`fastio` is an opinionated Python CLI that generates FastAPI projects for three shapes:

- single service
- modular monolith
- monorepo microservices

It is designed around your standards:

- Python + FastAPI
- `uv`
- Alembic
- SQLAlchemy
- Swagger at `/docs`
- SQLAdmin
- Celery + Redis
- clean architecture
- thin routers
- business logic in `services/`
- versioned APIs under `/api/v1`

## Install

### Local development
```bash
uv sync
uv run fastio --help
```

### Editable install
```bash
uv pip install -e .
fastio --help
```

## Quick start

Create a CRUD service:

```bash
uv run fastio create my-service --mode service --blueprint crud-service
```

Create a user service:

```bash
uv run fastio create user-service --mode service --blueprint user-service
```

Create a modular monolith:

```bash
uv run fastio create my-app --mode monolith
```

Create a monorepo:

```bash
uv run fastio create platform --mode monorepo
```

## Publishing to PyPI

The project includes a GitHub Actions publish workflow using PyPI Trusted Publishing.
PyPI’s docs recommend Trusted Publishing via OIDC because it avoids long-lived API tokens, and a pending publisher can create a new project on first release. Also note that a pending publisher does **not** reserve the name before first publish.

## Commands

### `fastio create`

Generate a new FastAPI project.

```bash
fastio create NAME [OPTIONS]
```

**Arguments:**
- `NAME` - Project directory name (required)

**Options:**
- `--mode {service,monolith,monorepo}` - Project shape (default: service)
- `--blueprint {base,crud-service,user-service}` - Project template (default: base for monolith/monorepo, crud-service for service)
- `--database {sqlite,postgres}` - Database backend (default: sqlite)
- `--sqlalchemy {sync,async}` - SQLAlchemy mode (default: sync, async for user-service)
- `--sqladmin/--no-sqladmin` - Include SQLAdmin (default: enabled)
- `--celery/--no-celery` - Include Celery + Redis (default: enabled)
- `--docker/--no-docker` - Include Dockerfile (default: enabled)
- `--tests/--no-tests` - Include test suite (default: enabled)
- `--ci/--no-ci` - Include GitHub Actions CI workflow (default: enabled)
- `--output-dir, -o` - Output directory (default: current directory)
- `--interactive` - Interactive mode with prompts for all options

**Blueprints:**
- `base` - Minimal FastAPI project with core structure
- `crud-service` - Full CRUD API with models, schemas, and services
- `user-service` - User management service with authentication, OAuth, and FastAPI-Users

### `fastio version`

Display the installed version.

```bash
fastio version
```

## Usage Examples

### Interactive mode
```bash
uv run fastio create my-project --interactive
```

### CRUD service with PostgreSQL
```bash
uv run fastio create my-api --mode service --blueprint crud-service --database postgres
```

### Async monolith
```bash
uv run fastio create my-app --mode monolith --sqlalchemy async
```

### Minimal service without extras
```bash
uv run fastio create my-service --mode service --no-celery --no-sqladmin
```

### Monorepo with custom output
```bash
uv run fastio create platform --mode monorepo --output-dir ./projects
```
