# How ExaSpark works

> See how one plain-English conversation builds your interface, backend APIs, database schema, permissions, and deployment pipeline together — safely isolated between Preview and Live.

- Canonical: https://exaspark.ai/docs/how-exaspark-works/

## One conversation, one coordinated stack

Building real software is hard because every visible feature depends on invisible plumbing. A single `"Book a class"` button requires a responsive form, input validation, a logged-in user session, an API endpoint, a relational database table, role permissions, and often a Stripe webhook.

When tools generate frontend screens separately from backend logic, those layers drift out of sync quickly. Buttons submit fields the database does not have, or admin pages expose records because server-side permission checks were never wired.

ExaSpark solves this by treating your entire product as one coordinated project. When you ask for a feature in plain English, the Agent updates the interface, server routes, **Cloud** database schema, permission checks, and payment hooks together in the same turn.

## Inside a single build turn

Rather than guessing blindly in one pass and handing you broken files, the Agent works through an explicit build-and-verify loop on every turn while streaming live progress in chat.

*Figure: From plain-English request to verified preview: the Agent inspects project state, plans full-stack changes, updates UI and backend together, verifies runtime health, and saves a checkpoint.*

1. **Inspect current project state** — Before editing anything, the Agent reads your existing screens, design tokens, **Cloud** database schema, active user roles, uploaded attachments, and prior decisions in the thread.
2. **Plan the vertical slice** — It translates your request into concrete UI changes, API routes, database columns or relationships, and permission rules. If an open business trade-off needs your call, it posts a short choice card.
3. **Update frontend and backend together** — It generates or modifies pages, components, server endpoints, authentication rules, and Stripe checkout handlers so every layer matches the new contract.
4. **Build and self-verify in Preview** — It compiles the updated project, boots it in your isolated **Preview** environment, inspects runtime output, and fixes build or wiring issues automatically before returning control.
5. **Save an atomic checkpoint** — Once **Preview** is healthy, ExaSpark records a clean turn checkpoint so you can review the result, continue iterating, or roll back with one click on **Undo**.

## How project context and memory carry across turns

One of the biggest questions builders ask is how ExaSpark remembers earlier choices on turn 15 without needing a giant recap every time. The answer is that ExaSpark grounds every turn in live project truth, not fragile chat summaries alone.

### Live project artifacts as source of truth

Whenever you send a follow-up request, the Agent does not guess what your app looks like from old messages. It reads your actual codebase, current **Cloud** tables, configured sign-in providers, saved **Design Canvas** tokens, and Stripe product configuration directly.

That means if you edit a headline with click-to-edit, rename a record in **Cloud**, or upload fresh product images via **+**, the very next chat turn automatically reflects those real changes.

### Cross-mode continuity

Project context also carries across all six [build modes](https://exaspark.ai/docs/modes/). A palette and typography scale locked on **Design** flow directly into **App** or **Web** code. Later, switching to **Image**, **Video**, or **Slides** automatically inherits your product name, pricing tiers, and brand imagery without re-explaining your business.

### Keeping context crisp on complex builds

Even with automatic grounding, huge unfocused prompts blur intent. Scoping each turn to one clear milestone — and verifying **Preview** before moving on — keeps your architecture clean across dozens of turns. See [Multi-turn best practices](https://exaspark.ai/docs/multi-turn-best-practices/) for proven sequencing patterns.

## What runs automatically vs when the Agent asks

A good collaborator handles routine engineering plumbing silently and pauses only when a decision changes how your business operates. ExaSpark draws a clear boundary between automatic execution and explicit builder approval.

| Decision area | Handled automatically | Requires your input or approval | Why this boundary exists |
| --- | --- | --- | --- |
| **Cloud infrastructure** | HTTPS hosting, SSL certificates, routing, asset caching, and database provisioning | Connecting a custom domain's DNS records at your registrar | Removes server boilerplate while keeping domain ownership in your registrar |
| **Schema & API wiring** | Creating tables, foreign keys, validation, and matching API routes from plain English | Naming specific fields or business rules that affect customer workflows | Prevents tedious boilerplate without guessing your business logic |
| **Product trade-offs** | Sensible layout spacing, error states, and responsive breakpoints | Clarifying **choice cards** (guest vs login checkout, cancellation windows, pricing intervals) | Keeps you in charge of rules that impact users and revenue |
| **Visual identity** | Applying locked design tokens consistently across newly added pages | Choosing a winning concept on **Design Canvas** or attaching brand files | Gives you creative direction without manually styling every button |
| **Live production & money** | Running **Preview** builds and Stripe **Test mode** verification | Clicking **Publish**, switching Stripe to **Live**, or approving **Pro** ad proposals | Ensures real visitors, real cards, and real ad spend never change without consent |

## Two safety nets: checkpoints and environment isolation

Fast iteration only works when mistakes are cheap to reverse and impossible to leak to real customers. ExaSpark separates those protections into two independent layers.

### Turn-level checkpoints (Undo)

Every completed Agent turn saves a complete restore point for your project code and configuration. If an experiment heads in the wrong direction — or if you decide a newly added feature complicates the screen — clicking **Undo** restores the exact prior state in one click.

Undo is much cleaner than asking `"Please put everything back the way it was"` because it avoids accumulating leftover edits or stray styling overrides.

### Strict Preview vs Live isolation

Your project always maintains two completely separate runtime worlds so building never collides with paying customers:

```text
[ Your Agent Turns ] ──► [ PREVIEW ENVIRONMENT ]
                         • Updates immediately after every turn
                         • Isolated Preview database & test accounts
                         • Stripe Test mode (fake cards, $0 charged)
                         • 1-click Undo across turn checkpoints
                                   │
                    Explicit click on "Publish"
                                   ▼
                         [ LIVE ENVIRONMENT ]
                         • Served on .exaspark.app or your custom domain
                         • Protected production database & real users
                         • Stripe Live mode (real cards & bank payouts)
                         • Immutable release history with 1-click rollback
```

Because **Preview** and **Live** never share database rows or payment modes, you can reset test tables, add new columns, and test failed checkouts freely after launch. Live visitors see zero changes until you click **Publish** — and every published release stays in history for instant 1-click rollback if needed. See [Preview vs Live](https://exaspark.ai/docs/preview-vs-live/).

## Real code, real portability

Although you steer ExaSpark in plain English, your project is never trapped inside a closed no-code template. Every screen, API handler, and configuration lives as real, readable source code.

- **Inspect anytime.** Open the **Code** tab in Web Studio or the Desktop App to read generated files, trace routes, and verify configuration directly.
- **Export to GitHub.** Connect the **Official GitHub App** to push your repository cleanly into your own GitHub account for version control, code review, or external CI workflows. See [Code & GitHub App](https://exaspark.ai/docs/code-and-github/).
- **Continue locally when needed.** Engineering teams can pull exported code into local editors alongside the Desktop App while keeping full ownership of their intellectual property. See [Security & ownership](https://exaspark.ai/docs/security-and-ownership/).

> **Note:** Think of ExaSpark as a full-stack workspace that speaks plain English at the front door and produces real cloud software underneath — with clear checkpoints, strict environment isolation, and full code ownership.

## Next steps

- [Working with the Agent](https://exaspark.ai/docs/working-with-the-agent/) — Combine chat, choice cards, click-to-edit, Undo, and Ask AI to fix.
- [Multi-turn best practices](https://exaspark.ai/docs/multi-turn-best-practices/) — Sequence complex apps across clean, verified milestones.
- [Preview vs Live](https://exaspark.ai/docs/preview-vs-live/) — Deep dive into isolated databases, test sessions, and safe deployments.
- [Accounts & database](https://exaspark.ai/docs/accounts-and-data/) — Learn how sign-in providers, roles, and visual Cloud tables work.

## From the blog

- [How ExaSpark works](https://exaspark.ai/blog/how-exaspark-works/) — Follow one project from initial prompt to paying customers.
- [Frontend vs backend explained](https://exaspark.ai/blog/frontend-vs-backend/) — How screens, APIs, and databases work together in real apps.
- [Why AI-built apps stall after launch](https://exaspark.ai/blog/why-ai-built-apps-stall-after-launch/) — What separates prototypes from software that runs a business.
