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

# Preview & Build Behavior

> Understanding how the preview environment works

Kleap builds a **static Astro site**. There's no long-running dev server or
sandbox to manage — here's how preview, builds, and publishing actually work.

## Where Your Files Live

Your site's files are stored and managed by Kleap. That managed copy is the
source of truth — the AI edits it, and every preview and publish builds from it.
You don't run or maintain a separate environment.

## Preview

When you make a change, Kleap runs a **real, ephemeral build** of your Astro
site and shows the result in the editor's preview pane.

* The preview reflects your latest changes after each build
* It's for you, inside the editor — not a public URL
* Nothing to "wake up" or restart; there's no idle timeout to hit

<Info>
  For a permanent, public URL, your site is [published automatically](/features/publishing)
  to `https://your-app.kleap.io`.
</Info>

## Publishing

Publishing is **automatic**. When a generation finishes, Kleap builds your site
and deploys it to a global edge network at `https://your-app.kleap.io` with free
SSL. You don't have to click deploy for it to go live.

## What's Preserved

| Always saved        | Notes                                |
| ------------------- | ------------------------------------ |
| All your code files | Managed by Kleap, saved continuously |
| Version history     | Roll back to any previous version    |
| Stored data         | If you use Kleap Database            |
| Form submissions    | Land in your dashboard's Data panel  |

Because there's no persistent dev server, there's no in-memory app state to
lose between sessions — the site is rebuilt fresh each time.

## Preview vs Production

| Aspect      | Preview (in editor) | Production (kleap.io)         |
| ----------- | ------------------- | ----------------------------- |
| **URL**     | In-editor only      | Permanent, public             |
| **Uptime**  | Built on demand     | 24/7 on a global edge network |
| **Access**  | You only            | Public                        |
| **Purpose** | Development         | Live users                    |
| **Build**   | Ephemeral build     | Deployed static build         |

## Common Questions

<AccordionGroup>
  <Accordion title="Is there a dev sandbox I need to keep running?">
    No. Astro sites don't use a long-running sandbox. Kleap builds your site on
    demand for preview and automatically on publish.
  </Accordion>

  <Accordion title="Will I lose my code?">
    No. Your files are managed by Kleap and saved continuously, with full version
    history.
  </Accordion>

  <Accordion title="Why doesn't my preview match the live site yet?">
    The preview shows your latest local changes. The live site updates when the
    automatic publish build finishes.
  </Accordion>

  <Accordion title="Where is my data stored?">
    If you added Kleap Database, your data lives there independently of any build.
    Form submissions land in your dashboard's Data panel.
  </Accordion>
</AccordionGroup>

<Card title="Publishing Your App" icon="cloud-arrow-up" href="/features/publishing">
  How your site goes live at your-app.kleap.io
</Card>
