Metadata-Version: 2.4
Name: fastapp-new
Version: 0.0.9
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/blob/main/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 small FastAPI app with a browser UI, tests, and deployment paths
included.

## 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 creates a new project `awesomeapp` with a FastAPI app, a public app shell,
htmx HTML routes, starter tests, and uv-managed dependencies.

![Generated FastApp starter page](docs/screenshot.png)

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 the current directory, run the command without a project name:

```bash
uvx fastapp-new
```

The current directory must be empty. If you intentionally want to initialize in
a non-empty current directory, pass `--force`:

```bash
uvx fastapp-new --force
```

You can also pass an existing empty directory:

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

### Skip installation

To write the project files and dependency metadata without resolving or
installing packages:

```bash
uvx fastapp-new awesomeapp --no-install
```

Then install dependencies when you are ready:

```bash
cd awesomeapp
uv sync
```

## Generated Stack

- `app/main.py` - FastAPI app assembly and `app.frontend()`
- `app/routers/api.py` - `/api/*` JSON API routes
- `app/routers/html.py` - htmx HTML routes
- `app/components/cards.py` - htpy server-side HTML components
- `public/` - app shell, vendored htmx, and static assets served by FastAPI
- `tests/` - starter pytest coverage for the generated app
- `AGENTS.md` - project instructions for automated coding tools
- `pyproject.toml` - managed by `uv`

## Project Context

Generated projects include `AGENTS.md` with local commands, project rules, and
official documentation links that are useful when the app changes. If you want a
larger OKF-style reference bundle, generate with `--knowledge`.

## Optional Add-ons

Generated projects start with FastAPI, htpy, vendored htmx 4.0.0-beta5,
pytest, and uv. Logfire, Modal, and the expanded knowledge bundle are optional
add-ons that can be enabled when the project is created.

Create with Logfire:

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

Logfire uses `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.

Create with Modal:

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

Create with the expanded knowledge bundle:

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

## Deploy

The generated project supports FastAPI Cloud by default.

Deploy to FastAPI Cloud:

```bash
uv run fastapi deploy
```

## Positioning

`fastapi-new` creates a minimal general-purpose FastAPI project. `fastapp-new`
is positioned for app development where FastAPI owns the Python API and serves
the public app shell in one project without a Node build step. HTMX interactions
and JSON endpoints live beside server-rendered HTML fragments generated with
htpy instead of raw string concatenation.

## License

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