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

# Exporting Code

> Download your Bloom app as a ZIP file to run locally or host elsewhere.

Export your Bloom app to get the complete source code as a ZIP file. Once exported, you can run it locally, deploy it to your own infrastructure, or continue development in your preferred IDE.

<Info>
  Code export is available on **Starter plans and above**.
  [**View pricing →**](https://bloom.diy/pricing)
</Info>

## Downloading Your Code

Click the **Download as ZIP** button in your app's workspace to export the full codebase.

The export includes everything you need to run your app independently:

* Complete monorepo structure
* Expo frontend (`apps/default/`)
* Convex backend (`packages/backend/`)
* All dependencies and configuration files
* Environment variable template (`.env.example`)

<Note>
  See [**App Structure**](/app-structure) for a detailed breakdown of what each file does.
</Note>

## Running Locally

After downloading, you can run your app on your own machine.

### Prerequisites

Install these tools before getting started:

<CardGroup cols={2}>
  <Card title="Bun" icon="bolt" href="https://bun.sh">
    Fast JavaScript runtime and package manager. Install with `curl -fsSL https://bun.sh/install | bash`
  </Card>

  <Card title="Convex CLI" icon="terminal" href="https://docs.convex.dev/getting-started">
    Backend runtime for your Convex functions. Install with `bun add -g convex`
  </Card>
</CardGroup>

### Setup Steps

<Steps>
  <Step title="Unzip and open the project">
    Extract the ZIP file and open the folder in your terminal or IDE:

    ```bash theme={null}
    unzip your-app.zip
    cd your-app
    ```
  </Step>

  <Step title="Install dependencies">
    Install all packages for the monorepo:

    ```bash theme={null}
    bun install
    ```
  </Step>

  <Step title="Set up environment variables">
    Copy the example environment file:

    ```bash theme={null}
    cp .env.example .env
    ```

    Then fill in the required values:

    ```bash theme={null}
    CONVEX_DEPLOYMENT=your-deployment-name
    EXPO_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud
    EXPO_PUBLIC_CONVEX_SITE_URL=https://your-deployment.convex.site
    ```

    <Tip>
      You can find these values in your [**Convex dashboard**](https://dashboard.convex.dev) after creating a project.
    </Tip>
  </Step>

  <Step title="Start the development server">
    Run both the frontend and backend:

    ```bash theme={null}
    bun run dev
    ```

    This starts:

    * **Expo dev server** for the mobile/web app
    * **Convex dev server** for the backend functions
  </Step>
</Steps>

## Setting Up Your Own Convex Backend

If you want to run your app completely independently from Bloom, you'll need to create your own Convex project.

<Steps>
  <Step title="Create a Convex account">
    Sign up at [**convex.dev**](https://convex.dev) if you don't have an account.
  </Step>

  <Step title="Create a new project">
    From the Convex dashboard, create a new project. This gives you a fresh deployment URL.
  </Step>

  <Step title="Deploy your functions">
    From your project directory, deploy the backend:

    ```bash theme={null}
    cd packages/backend
    bunx convex deploy
    ```

    Follow the prompts to link your local project to your Convex deployment.
  </Step>

  <Step title="Update environment variables">
    Update your `.env` file with the new deployment details from your Convex dashboard.
  </Step>
</Steps>

<Warning>
  When using your own Convex deployment, you'll need to configure your own OAuth credentials for authentication. See the [**Convex Auth documentation**](https://docs.convex.dev/auth) for setup instructions.
</Warning>

## Export vs GitHub Sync

Both options give you access to your code, but they serve different purposes.

| Feature               | Export (ZIP)                              | GitHub Sync                       |
| --------------------- | ----------------------------------------- | --------------------------------- |
| **Plan required**     | Starter+                                  | Premium+                          |
| **One-time download** | Yes                                       | No                                |
| **Ongoing sync**      | No                                        | Yes                               |
| **Bidirectional**     | No                                        | Yes                               |
| **Best for**          | Snapshots, archiving, independent hosting | Active development, collaboration |

<Tabs>
  <Tab title="When to Export">
    **Use ZIP export when you want to:**

    * Archive a version of your app
    * Move to fully self-hosted infrastructure
    * Share code with someone outside your team
    * Create a backup before major changes
  </Tab>

  <Tab title="When to Use GitHub Sync">
    **Use GitHub Sync when you want to:**

    * Continue developing in Bloom and your IDE
    * Collaborate with a team using Git workflows
    * Maintain version history with commits
    * Set up CI/CD pipelines

    [**Learn more about GitHub Sync →**](/github-sync)
  </Tab>
</Tabs>

## What's Next?

<CardGroup cols={2}>
  <Card title="App Structure" icon="folder-tree" href="/app-structure">
    Understand how your exported code is organized
  </Card>

  <Card title="GitHub Sync" icon="github" href="/github-sync">
    Set up bidirectional sync for ongoing development
  </Card>
</CardGroup>
