> ## 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.

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

## 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**](https://docs.bloom.diy/app-structure.md) for a detailed breakdown of what each file does.

## Running Locally

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

### Prerequisites

Install these tools before getting started:

> [card] [Bun](https://bun.sh)
>
> Fast JavaScript runtime and package manager. Install with `curl -fsSL https://bun.sh/install | bash`

> [card] [Convex CLI](https://docs.convex.dev/getting-started)
>
> Backend runtime for your Convex functions. Install with `bun add -g convex`

### Setup Steps

**1. 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
```

**2. Install dependencies**

Install all packages for the monorepo:

```bash theme={null}
bun install
```

**3. 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.

**4. 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

## 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.

**1. Create a Convex account**

Sign up at [**convex.dev**](https://convex.dev) if you don't have an account.

**2. Create a new project**

From the Convex dashboard, create a new project. This gives you a fresh deployment URL.

**3. 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.

**4. Update environment variables**

Update your `.env` file with the new deployment details from your Convex dashboard.

> [!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.

## 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 |

> [tab] 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] 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 →**](https://docs.bloom.diy/github-sync.md)

## What's Next?

> [card] [App Structure](https://docs.bloom.diy/app-structure.md)
>
> Understand how your exported code is organized

> [card] [GitHub Sync](https://docs.bloom.diy/github-sync.md)
>
> Set up bidirectional sync for ongoing development


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.