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

# Deployment

> How to deploy apps generated with Compyle

## Overview

When your Compyle generated project includes features such as **authentication**, **forms**, or **file uploads**, it requires a backend to handle data securely.

Compyle automatically generates the backend logic and structure you need.\
However, for now, you’ll still need to **host and manage** your backend manually.

<Callout type="info" icon="lightbulb" color="#3B82F6">
  We’re actively working on integrated backend hosting and one-click deployment within Compyle.\
  Until that’s released, this guide will walk you through deploying your website using <strong>Supabase</strong> and <strong>Vercel</strong>.
</Callout>

***

## Why Supabase?

We recommend **Supabase** as the backend platform for your projects. It’s fast to set up, integrates smoothly with **Next.js**, and provides all the essentials out of the box:

* Authentication (Email, Google, GitHub, and more)
* A fully managed PostgreSQL database
* Real-time APIs
* File storage
* Tight compatibility with Compyle-generated project

<Callout type="info" icon="bolt" color="#3B82F6">
  Supabase takes care of most backend complexity — what would normally take weeks can now be done in minutes.
</Callout>

***

## Setting Up Supabase

1. Go to [**supabase.com**](https://supabase.com).
2. Sign in with your **GitHub account**.
3. Click **New Project**.
4. Choose a project name, region, and database password.
5. Once created, open your **Supabase Dashboard**.

***

### Get Your API Keys

Inside your Supabase dashboard:

1. Open your project.
2. Click the **Connect** button at the top of the page.

<img className="block dark:hidden rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-connect-light.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=1f516e35721e2d182f72c36f21b51541" alt="Supabase Connect Light" width="607" height="73" data-path="deployment-images/supabase-connect-light.png" />

<img className="hidden dark:block rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-connect-dark.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=ab8c796c3093ef45298b8266802d6c5c" alt="Supabase Connect Dark" width="634" height="60" data-path="deployment-images/supabase-connect-dark.png" />

Copy the following values and keep them ready:

```bash theme={null}
NEXT_PUBLIC_SUPABASE_URL=your-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
```

<img className="block dark:hidden rounded-2xl" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-env-light.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=5f5a5bc70a0814318e48d52e7c87353a" alt="Supabase Environment Variables Light" width="1533" height="409" data-path="deployment-images/supabase-env-light.png" />

<img className="hidden dark:block rounded-2xl" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-env-dark.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=05f8b7defb199b5a80b53840cae9c855" alt="Supabase Environment Variables Dark" width="1531" height="427" data-path="deployment-images/supabase-env-dark.png" />

***

## Configure Your Database

If your compyle generated project collects user data (for example, login details, form responses, or uploaded files), you’ll need to create the database tables that your project expects.

1. Open your Supabase **project**.
2. Go to the **SQL Editor** in the sidebar.
3. In your project folder, locate the SQL files that define your database structure.
4. Copy each SQL file’s contents into the **Supabase SQL Editor**.
5. Click **Run** to execute each file.

<img className="block dark:hidden rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-sql-light.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=4c54b967230a9a7b601f47c04129b857" alt="Supabase SQL Editor Light" width="1878" height="883" data-path="deployment-images/supabase-sql-light.png" />

<img className="hidden dark:block rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/supabase-sql-dark.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=ee7ffed90b4ce0f0d5199e16c0ae6ed4" alt="Supabase SQL Editor Dark" width="1882" height="882" data-path="deployment-images/supabase-sql-dark.png" />

Once completed, your backend will be ready to connect to your Compyle app.

***

## Running Your Project

You can run your project in two ways:

1. **Locally** – ideal if you’re comfortable managing environment variables and local servers.
2. **Deployed** – through a hosting service like **Vercel**.

We recommend **Vercel** for most users, since it provides a simple, automated deployment process for Next.js apps.

<Callout type="note" icon="note" color="#8B5CF6">
  Use the Supabase keys you copied earlier when setting up <strong>Vercel Environment Variables</strong> during deployment.
</Callout>

***

## Deploying with Vercel

### Step 1 — Connect to Vercel

1. Go to [**vercel.com**](https://vercel.com).
2. Log in with your GitHub account.
3. Click **Add Project**.

<img className="block dark:hidden rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/project-light.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=bf14e943a593d1484b6a7fbb9c10ab50" alt="Vercel Project Setup Light" width="622" height="232" data-path="deployment-images/project-light.png" />

<img className="hidden dark:block rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/project-dark.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=5eb9531c9a02bac85b9e60f22c02bf82" alt="Vercel Project Setup Dark" width="622" height="232" data-path="deployment-images/project-dark.png" />

4. Select the repository generated by Compyle.

***

### Step 2 — Add Environment Variables

Before deploying, open the **Environment Variables** tab.

<img className="block dark:hidden rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/vercel-env-light.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=ce4e18bc860fef0ecae4e29445d1fb69" alt="Vercel Environment Variables Light" width="1174" height="760" data-path="deployment-images/vercel-env-light.png" />

<img className="hidden dark:block rounded-2xl my-4" src="https://mintcdn.com/compyle-01176785/KJ2BcQNrBoDXYyxX/deployment-images/vercel-env-dark.png?fit=max&auto=format&n=KJ2BcQNrBoDXYyxX&q=85&s=92e4dc743644bf642b77281710c79118" alt="Vercel Environment Variables Dark" width="1174" height="760" data-path="deployment-images/vercel-env-dark.png" />

Add the values you copied from Supabase:

```bash theme={null}
NEXT_PUBLIC_SUPABASE_URL=your-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
```

Then click **Deploy**.
Vercel will automatically build and deploy your full project.

***

## After Deployment

Your deployed app is now live — fully connected to Supabase.

It will:

* Handle user authentication
* Store and retrieve data securely
* Manage file uploads
* Run frontend and backend logic seamlessly

<Callout type="success" icon="check-circle" color="#10B981">
  That’s it! Compyle writes the code, Supabase powers the backend, and Vercel deploys your full-stack app — all in just a few steps.
</Callout>
