Metadata-Version: 2.4
Name: fastapp-new
Version: 0.0.4
Summary: Create a new FastApp project in one command
Project-URL: Homepage, https://github.com/taehalim/fastapp-new
Project-URL: Documentation, https://github.com/taehalim/fastapp-new
Project-URL: Repository, https://github.com/taehalim/fastapp-new
Project-URL: Issues, https://github.com/taehalim/fastapp-new/issues
Project-URL: Changelog, https://github.com/taehalim/fastapp-new/release-notes.md
Author: taeha
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.12
Requires-Dist: rich-toolkit>=0.15.1
Requires-Dist: rich>=13.7.1
Requires-Dist: typer>=0.24.1
Requires-Dist: typing-extensions>=4.12.2
Description-Content-Type: text/markdown

# fastapp-new

Create a new FastApp project in one command.

## How to use

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) following their guide for your system.

Run:

```bash
uvx fastapp-new awesomeapp
```

This will create a new project `awesomeapp` with a full-stack FastAPI app, configured with uv.

Enter the directory:

```bash
cd awesomeapp
```

Run the development server:

```bash
uv run fastapi dev
```

Open your browser and go to `http://localhost:8000` to see your new FastApp project running.

### Existing directory

If you want to create a new FastApp project in an existing directory, run the command without a project name:

```bash
uvx fastapp-new
```

## Generated Stack

- `app/main.py` - FastAPI app assembly and `app.frontend()`
- `app/routes.py` - HTMX partial routes and JSON API routes
- `app/components.py` - htpy server-side HTML components
- `frontend/` - static HTML/CSS frontend served by FastAPI
- `tests/` - starter pytest coverage for the generated app
- `AGENTS.md` - coding-agent instructions for working on the generated project
- `knowledge/` - OKF-style stack references and official documentation links
- `pyproject.toml` - managed by `uv`

## Agent-ready projects

Generated projects include `AGENTS.md` and an OKF-style `knowledge/` directory
so coding agents can quickly understand how to run, modify, test, and deploy the
app. `AGENTS.md` stays focused on project rules and commands, while
`knowledge/stack/` contains official documentation links and stack-specific
notes for FastAPI, htmx, htpy, optional Modal deployment, Logfire, uv, and
AGENTS.md.

## Observability with Logfire

Logfire is optional. Passing `--logfire` installs `logfire[fastapi]`,
instruments the generated FastAPI app, and configures telemetry with
`send_to_logfire="if-token-present"` so data is sent only when Logfire
credentials or `LOGFIRE_TOKEN` are present.

For production, set `LOGFIRE_TOKEN` as an environment variable or deployment
platform secret.

## Deploy

The generated project supports FastAPI Cloud by default.

Deploy to FastAPI Cloud:

```bash
uv run fastapi deploy
```

## Optional Modal Deployment

Passing `--modal` installs `modal`, writes `modal_app.py`, and adds Modal
commands to the generated project docs:

```bash
uvx fastapp-new awesomeapp --modal
```

Then deploy to Modal:

```bash
uv run modal serve modal_app.py
uv run modal deploy modal_app.py
```

## Positioning

`fastapi-new` creates a minimal general-purpose FastAPI project. `fastapp-new`
is positioned for app development where FastAPI owns both sides of the product:
static frontend serving, HTMX interactions, and JSON endpoints live in one
Python project without a Node build step. Server-rendered HTML fragments are
generated with htpy instead of raw string concatenation.

## License

This project is licensed under the terms of the MIT license.
