Metadata-Version: 2.4
Name: fastapi_assist
Version: 0.1.2
Summary: Production-ready FastAPI project scaffolding with async ORM, migrations, Docker, logging, and modular app architecture.
Author: Ankit Prajapati
License: MIT
Project-URL: Homepage, https://github.com/Ankitp2002/fastapi_assist
Project-URL: Repository, https://github.com/Ankitp2002/fastapi_assist
Project-URL: Issues, https://github.com/Ankitp2002/fastapi_assist/issues
Keywords: fastapi,python,cli,scaffolding,fastapi-cli,tortoise-orm,aerich,docker,backend,api
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Framework :: FastAPI
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typer
Requires-Dist: aiofiles
Requires-Dist: aiomysql
Requires-Dist: click
Requires-Dist: cython
Requires-Dist: dotenv
Requires-Dist: fastapi
Requires-Dist: jinja2
Requires-Dist: openpyxl
Requires-Dist: orjson
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: pydantic[email]
Requires-Dist: pydantic-settings
Requires-Dist: python-multipart
Requires-Dist: setuptools
Requires-Dist: tortoise-orm[aiomysql]<2,>=1.1
Requires-Dist: uvicorn
Requires-Dist: uvicorn-worker
Requires-Dist: xlsxwriter
Requires-Dist: aerich[toml]<1,>=0.10
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: typer; extra == "dev"
Dynamic: license-file

# FastAssist

**A production-ready FastAPI project foundation — scaffold, configure, and start building.**

FastAssist is a developer-focused CLI toolkit that generates a **complete, well-structured FastAPI project** with modular applications, async database integration, migrations, logging, Docker support, and reusable application components.

Instead of spending hours creating the same project structure, configuring databases, setting up migrations, writing boilerplate, and preparing Docker files, FastAssist gives you a **ready-to-serve project foundation**.

> **You create the project. FastAssist creates the foundation. You build the business logic.**

---

## ✨ Why FastAssist?

Starting a FastAPI application from scratch often requires setting up:

- Project architecture
- Application modules
- Configuration management
- Environment variables
- Database connection
- Async ORM
- Database migrations
- Logging
- Error handling
- Rate limiting
- Models
- Schemas
- Views
- Routers
- Docker
- Docker Compose
- Deployment scripts

FastAssist automates this repetitive setup.

With a few CLI commands, you get a complete project structure that is ready for development and can be run using Docker without manually configuring the container environment.

---

# 🚀 Quick Start

## 1. Install FastAssist

```bash
pip install fastapi-assist
```

## 2. Initialize your project

```bash
fa_assist init project my_project
```

FastAssist creates the complete project architecture, configuration, database setup, logging, Docker setup, and supporting utilities.

## 3. Add an application

```bash
fa_assist add app users
```

That's it.

Your project is ready for you to start adding your business logic.

---

# 🏗️ Generated Project Architecture

A project generated by FastAssist follows a modular structure designed for scalable FastAPI applications.

```text
my_project/
│
├── configuration/
│   ├── config.py
│   ├── custom_error.py
│   ├── db.py
│   ├── logger.py
│   ├── rate_limit.py
│   └── server.py
│
├── apps/
│   ├── __init__.py
│   ├── constants.py
│   ├── db_operations.py
│   ├── https_response.py
│   ├── models.py
│   ├── reg_models.py
│   ├── reg_routers.py
│   ├── schemas.py
│   ├── utils.py
│   │
│   └── users/
│       ├── __init__.py
│       ├── models.py
│       ├── schemas/
│       │   └── __init__.py
│       ├── views/
│       │   ├── __init__.py
│       │   └── api_users_view.py
│       ├── constants.py
│       ├── dependencies.py
│       ├── enums.py
│       ├── internal_api_calls.py
│       └── utils.py
│
├── credential/
├── independent_scripts/
├── logs/
│
├── main.py
├── .env
│
├── Dockerfile
├── .docker-compose.yaml
├── docker_setup.sh
├── deployment.sh
│
└── ...
```

The generated architecture can be extended as your application grows.

---

# 🧩 Multi-App Architecture

FastAssist is designed for applications that contain multiple business domains.

For example:

```text
apps/
├── users/
├── authentication/
├── products/
├── orders/
├── payments/
└── notifications/
```

Each application gets its own isolated structure for:

- Models
- Schemas
- Views
- Constants
- Enums
- Dependencies
- Utilities
- Internal API operations

This keeps large FastAPI projects modular and maintainable.

Create an application with:

```bash
fa_assist add app products
```

No need to manually create the directories and boilerplate files.

---

# 🗄️ Async Database with Tortoise ORM

FastAssist comes with an async database foundation using **Tortoise ORM**.

The generated project includes database configuration and integration so you can define your models without manually building the entire database layer.

Example:

```python
from tortoise import fields
from tortoise.models import Model


class User(Model):
    id = fields.IntField(pk=True)
    name = fields.CharField(max_length=100)
    email = fields.CharField(
        max_length=255,
        unique=True,
    )
```

The architecture is designed around asynchronous FastAPI applications and async database operations.

---

# 🔄 Database Migrations with Aerich

FastAssist integrates **Aerich** for managing Tortoise ORM migrations.

Your workflow becomes:

```text
Create / Update Model
        ↓
Create Migration
        ↓
Apply Migration
        ↓
Continue Development
```

Typical Aerich commands:

```bash
aerich migrate
```

```bash
aerich upgrade
```

This provides a clean way to version and apply database schema changes as your project evolves.

---

# 🐳 Docker Ready

**Don't worry about Docker setup. FastAssist handles the foundation for you.**

Every generated project includes Docker-related files such as:

```text
Dockerfile
.docker-compose.yaml
docker_setup.sh
deployment.sh
```

This allows your FastAPI application to be containerized without manually creating the initial Docker configuration.

The goal is simple:

```text
Generate Project
       ↓
Configure Environment
       ↓
Start Docker
       ↓
Run FastAPI
```

You can use Docker for consistent development, testing, and deployment environments.

---

# 📝 Automatic Logging

FastAssist provides centralized logging configuration as part of the generated project.

Instead of configuring logging separately for every project, the generated architecture provides a common logging foundation.

This can be used for:

- Application logs
- API activity
- Errors
- Debugging
- Database-related events
- Production diagnostics

Logs can be organized through the generated `logs/` directory.

---

# ⚙️ Configuration Management

The generated project includes a dedicated configuration layer.

```text
configuration/
├── config.py
├── db.py
├── logger.py
├── rate_limit.py
├── server.py
└── custom_error.py
```

This keeps infrastructure-related configuration separate from application business logic.

Environment-specific values can be managed through `.env`.

---

# 🧱 Built-in Application Foundation

When you create an application:

```bash
fa_assist add app users
```

FastAssist generates the common building blocks automatically.

```text
users/
├── models.py
├── constants.py
├── enums.py
├── dependencies.py
├── internal_api_calls.py
├── utils.py
│
├── schemas/
│   └── __init__.py
│
└── views/
    ├── __init__.py
    └── api_users_view.py
```

You don't need to repeatedly create these files for every application.

Simply add your own business logic.

---

# 🎯 Developer Experience

FastAssist is built around one simple idea:

> **Remove repetitive setup, not engineering decisions.**

You still control your:

- Database models
- Business rules
- API design
- Validation
- Authentication
- Application logic
- Database queries
- Infrastructure decisions

FastAssist simply gives you the foundation.

---

# 🔥 Before FastAssist

A typical new FastAPI project may require:

```text
Create directories
       ↓
Create configuration
       ↓
Configure environment
       ↓
Configure database
       ↓
Install/configure ORM
       ↓
Configure migrations
       ↓
Configure logging
       ↓
Create application modules
       ↓
Create models
       ↓
Create schemas
       ↓
Create views
       ↓
Create routers
       ↓
Configure Docker
       ↓
Configure Docker Compose
       ↓
Write startup scripts
       ↓
Finally start development
```

A lot of this work is repetitive.

---

# ⚡ With FastAssist

```bash
pip install fa-assist

fa_assist init project my_project

fa_assist add app users
```

Then:

```text
        FastAssist
            │
            ▼
┌─────────────────────────┐
│ Complete Project Setup  │
├─────────────────────────┤
│ FastAPI                 │
│ Async ORM               │
│ Migrations              │
│ Logging                 │
│ Configuration           │
│ Models                  │
│ Schemas                 │
│ Views                   │
│ Routers                 │
│ Docker                  │
│ Deployment Foundation   │
└─────────────────────────┘
            │
            ▼
     Your Business Logic
```

---

# 🛠️ Example Workflow

Create a project:

```bash
fa_assist init project ecommerce
```

Create applications:

```bash
fa_assist add app users
fa_assist add app products
fa_assist add app orders
```

Your project can then evolve into:

```text
ecommerce/
│
├── configuration/
│
├── apps/
│   ├── users/
│   ├── products/
│   └── orders/
│
├── logs/
├── credential/
├── independent_scripts/
│
├── Dockerfile
├── .docker-compose.yaml
├── deployment.sh
└── main.py
```

From this point, your primary job is to implement the actual product requirements.

---

# 📦 Installation

```bash
pip install fa-assist
```

### Development installation

Clone the repository and install development dependencies:

```bash
pip install -e ".[dev]"
```

---

# 💻 Requirements

- Python **3.10+**
- FastAPI
- Tortoise ORM
- Aerich
- Uvicorn
- Docker _(for containerized execution)_

---

# 🧪 Development

Install the development dependencies:

```bash
pip install -e ".[dev]"
```

Run tests:

```bash
pytest
```

Development tooling includes:

- `pytest`
- `pytest-asyncio`
- `httpx`
- `ruff`

---

# 🖥️ CLI

## Initialize a project

```bash
fa_assist init project <project_name>
```

Example:

```bash
fa_assist init project my_project
```

## Add an application

```bash
fa_assist add app <app_name>
```

Example:

```bash
fa_assist add app users
```

---

# 🗺️ Roadmap

FastAssist is actively designed to evolve into a broader FastAPI development toolkit.

Potential future features include:

- [ ] CRUD generators
- [ ] Authentication scaffolding
- [ ] JWT authentication
- [ ] Automatic API generation
- [ ] Schema generators
- [ ] Celery integration
- [ ] Redis integration
- [ ] Background task scaffolding
- [ ] Docker environment customization
- [ ] Production deployment templates
- [ ] Testing scaffolding
- [ ] API documentation customization
- [ ] Additional project templates
- [ ] More CLI development utilities

---

# 🤝 Contributing

Contributions, ideas, and improvements are welcome.

If you find a bug or have an idea for improving FastAssist, feel free to open an issue or submit a pull request.

Before submitting changes, run:

```bash
pytest
```

---

# 📄 License

FastAssist is released under the **MIT License**.

---

# FastAssist

### Build FastAPI applications, not boilerplate.

```bash
pip install fa-assist

fa_assist init project my_project

fa_assist add app users
```

**Scaffold → Configure → Build.**

Your project foundation is ready.

**Now build your business logic.**
