> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kazzle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Build and publish

> Building apps with the AI, iterating on a live preview, and deploying to production.

## Creating an app

Two ways:

* **Ask the AI** - describe what you want in a thread and the AI builds it
* **New app button** - click **+** in the Drive sidebar and choose **New app**

The AI picks a starting template based on what you ask for:

| Template  | What you get  | Use when you need                      |
| --------- | ------------- | -------------------------------------- |
| `ui`      | React web app | A web app, dashboard, landing page     |
| `process` | HTTP server   | An API, webhook handler, scheduled job |

## One app, one branch

Each app is a single git checkout on `main`. There are no separate drafts, no branch switching, no merge step. Every edit lands on `main` as a commit; publishing is just "deploy the current `main`".

## The build cycle

1. The AI writes code directly on `main`
2. The AI starts the dev server. You see a live preview.
3. You iterate by chat: "move the chart to the sidebar", "add a dark theme"
4. The dev server hot-reloads after each edit
5. When ready, publish

## Publishing

Publishing deploys the current `main` commit. There is no separate production branch — the most recently published commit on `main` is what's live.

When you publish to the catalog for others to install, your app receives a user identity token on launch, an install key for its backend, and install/uninstall webhooks. See [Publishing](/apps/publishing).

## Caching, updates, and offline

Desktop and mobile only open your app URL in a normal browser view. They do **not** clear browser caches, force network-only loads, or pick a different cache policy for public vs private apps.

Your web app owns caching:

* HTTP `Cache-Control` headers for documents and assets
* Optional service worker / PWA setup (templates ship `vite-plugin-pwa` with auto-update)
* Whether a new build activates immediately, reloads once, or waits for the next open
* Offline fallback for the latest activated build

When Kazzle sees a new published version for an open app tab, it asks the registered service worker to check for an update (`registration.update()`). Apps without a service worker ignore that check and keep using their own HTTP cache headers.

Published apps can therefore open instantly from cache, pick up a new build without a hard refresh, and keep the latest build available offline.

## Deploying

After publishing, deploy to get a live URL:

* **Remote apps** deploy to Kazzle's cloud and get a public URL
* **Local apps** install on your computer. The UI loads directly, and the process part runs a dev server.

## Realtime apps

For apps that need instant local reads and offline support, the AI:

1. Creates a database
2. Turns on realtime sync
3. Builds a two-part app: UI (React + sync client) and Process (token endpoint + sync upload)
4. Wires credentials through the [vault](/work/vault)

See [Realtime sync](/apps/sync) for how it works.

## Landing pages

Landing pages are UI-only apps. No backend, no database. Describe the page and the AI builds it, deploys it, and gives you a live URL. To use a custom domain, point your domain or subdomain at the deployed app URL.
