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

# Connect an existing project

> Connect an existing Supabase project to your Rocket.new app - share a database across multiple apps.

export const LlmsDirective = () => <blockquote className="llms-directive">
    For the complete documentation index, see <a href="/llms.txt">llms.txt</a>.
    For a lightweight markdown version of this page, append .md to the URL.
  </blockquote>;

<LlmsDirective />

<Info>
  Connect multiple Rocket projects to the same Supabase database or reuse an existing backend you already have. This guide covers when sharing a database makes sense, best practices for shared setups, and how to connect an existing project.
</Info>

## Why share a Supabase database

Sharing a single Supabase project across Rocket apps is useful when you want to:

* Power multiple frontends (e.g., customer site and admin panel) with the same data.
* Keep authentication, storage, and APIs consistent across builds.
* Test new UI designs without duplicating your backend.

Already using Supabase? You can bring that database into Rocket and focus entirely on the UI.

## Best practices

<Info>
  Rocket connects to your entire Supabase project, but only uses what you tell it to. Clear prompts lead to cleaner builds.
</Info>

* **Start with your schema**
  In your first prompt, mention the tables and fields you need.
  **Example:**

* Table: **Users** → Fields: *Name, Email, Date joined*

* Table: **Orders** → Fields: *Order ID, Status, Amount*

* **Describe your setup**
  If your database is already live, say so. Rocket will not auto-detect the schema unless you explain it.

* **List the pages you want**
  Tell Rocket exactly what you need.

**Example:**

```plaintext wrap theme={null}
Create a Users page showing Name and Email, and an Orders page showing Status and Amount.
```

* **One project, one purpose**
  Keep Rocket projects focused. For example:

* One for your user-facing app

* One for your internal dashboard

* **When Rocket generates scripts**
  Only push the script if you want to update the actual database.

* **Push when:** You are adding new fields or tables.

* **Do not push when:** Your schema already includes everything you need.

* **If multiple apps share the database**
  Database changes affect every connected Rocket project. If one app adds a field, others can access it, but you will need to update those UIs separately.

<br />

**Example scenario:**

1. In App A, you prompt:

```plaintext wrap theme={null}
Add a Phone number field to user profiles.
```

2. Supabase now has a new field: **Phone number**.
3. App B also connects to this database, but does not yet show the field.
4. In App B, prompt Rocket:

```plaintext wrap theme={null}
Update Users page to show Phone number.
```

* **Try it in a test project first**
  Exploring ideas? Connect to a test Supabase project before making changes to production.

<Tip>
  The more clearly you describe your schema and goals, the better Rocket can build what you need.
</Tip>

## Use an existing Supabase project in Rocket

<Steps>
  <Step title="Start a new task in Rocket">
    From your Rocket dashboard, create a new task. Start blank or use a template.

    You are taken to the Rocket workspace for your new task once it is created.
  </Step>

  <Step title="Connect your existing Supabase project">
    1. When prompted, choose **Supabase** as your database provider.
    2. Log in to your Supabase account.
    3. Select the project you want to link from the list.

    <Note>
      You can connect to a Supabase project used by another Rocket app or one created outside Rocket.
    </Note>

    Rocket confirms your Supabase project is connected.
  </Step>

  <Step title="Start building your UI in Rocket">
    Rocket uses your existing schema, tables, and auth settings.
    You can now design pages and components without touching the database.

    Your app shows live data from your Supabase project.
  </Step>
</Steps>

## Troubleshooting

### 1. I do not see my Supabase project in Rocket

After signing in to Supabase, the project list is empty.

* Make sure you are signed in to the correct Supabase account.

### 2. Changes in one Rocket project affect another

Updating the database in one Rocket project instantly affects another.

* This is expected behavior when projects share a database.
* To isolate changes, connect each Rocket project to a separate Supabase project.

<Card icon="database" horizontal title="One database, multiple projects">
  Share data, streamline your builds, and redesign faster by connecting Rocket apps to the same Supabase database.
</Card>
