Metadata-Version: 2.4
Name: fastbackend-fastapi
Version: 0.1.0
Summary: FastAPI runtime adapter for FastBackend framework
Home-page: https://github.com/darula-hpp/uigen/tree/main/fastbackend
Author: FastBackend Team
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.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.110.0
Requires-Dist: pydantic[email]>=2.0.0
Requires-Dist: sqlalchemy>=2.0.0
Requires-Dist: uvicorn>=0.27.0
Requires-Dist: email-validator>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: ruff>=0.3.0; extra == "dev"
Requires-Dist: black>=24.0.0; extra == "dev"
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# @fastbackend/fastapi

FastAPI runtime adapter for the FastBackend framework. Reads IR from `.fastbackend/ir.json` and dynamically creates routes in memory at startup.

## Installation

```bash
pip install fastbackend-fastapi
```

## Usage

```python
from fastbackend_fastapi import create_app

app = create_app()
```

Then run with uvicorn:

```bash
uvicorn main:app --reload
```

Or use the CLI:

```bash
fastbackend generate  # Generate IR and OpenAPI
fastbackend dev       # Start development server
```

## Architecture

Routes exist **only in memory** (never written to disk). The runtime:

1. Loads IR from `.fastbackend/ir.json`
2. Dynamically creates CRUD endpoints for each entity
3. Dynamically creates relationship endpoints
4. Registers custom endpoints from `app/custom/`
5. Supports endpoint overrides via `@fastbackend.override()` markers

## Components

- `Runtime` - Orchestrates initialization
- `CRUDEngine` - Dynamic CRUD route creation
- `RelationshipEngine` - Dynamic relationship routes
- `ValidationEngine` - Dynamic Pydantic models
- `QueryEngine` - Pagination, filtering, sorting, search
