Metadata-Version: 2.5
Name: fastapi-nest-cli
Version: 0.1.0
Summary: NestJS-style project and resource scaffolding for FastAPI
License: MIT
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: typer>=0.9
Description-Content-Type: text/markdown

# fastapi-cli

NestJS-style scaffolding for FastAPI.

```bash
pip install -e .

fastapi-cli new my-api            # create a new project
cd my-api
pip install -r requirements.txt

fastapi-cli g resource users      # generate app/modules/users/*
fastapi-cli generate resource users   # same thing
uvicorn app.main:app --reload
```

## Generated project

```
my-api/
├── app/
│   ├── main.py
│   ├── core/config.py
│   └── modules/
│       └── users/
│           ├── controller.py   # APIRouter (routes)
│           ├── service.py      # business logic
│           ├── repository.py   # data access (in-memory by default)
│           ├── schema.py       # pydantic models
│           └── model.py        # domain model
├── requirements.txt
└── .gitignore
```

`app/router.py` is the main router (`api_router`), included by `app/main.py`.
`g resource <name>` registers the new router there automatically (via the
`# fastapi-cli:imports` / `# fastapi-cli:routers` markers). Run it from the
project root, i.e. the folder created by `new`.
