# Supabase

[**Supabase**](https://supabase.com/) is an open-source Firebase alternative with an array of functions available out of the box.&#x20;

Using Supabase you can do the following:

* Build application: admin panel, internal tool, customer portal, or dashboard
* Manage your Supabase data: update, batch edit
* Build [workflow or automation](https://docs.jetadmin.io/user-guide/workflow) on top of your database

To Integrate Jet with Supabase and build your first app, follow our guide:

{% embed url="<https://www.youtube.com/watch?v=aZ0oPbFGVBU>" %}

### Step 1: Set up your Backend on Supabase <a href="#step-1-set-up-your-backend-on-supabase" id="step-1-set-up-your-backend-on-supabase"></a>

* On the [Supabase dashboard](https://app.supabase.com/), click `New project` and set the name to your **Project**

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F0ejYkUa7If3IVNJwIDd3%2Fcreate-project-supabase-01-4d5930cd172cfc466c97c604b3e1e135.png?alt=media&#x26;token=5a2e7cbf-4ddc-4f4a-ae5e-129183813cd8" alt=""><figcaption></figcaption></figure>

* Create a new table by clicking on the Create Table option on the side navigation.
* Supabase provides many ways fill the tables with data, from writing queries or creating schemas using UI to simply uploading CSV files.&#x20;

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FwOMDjhanWkEOQh6DRXET%2Fcreate-table-supabase-02-28784eb3dee81672533685563971e45b.png?alt=media&#x26;token=3f32b93f-eafe-43b5-8c3e-32124d39bd4a" alt=""><figcaption></figcaption></figure>

### Step 2: Connect the database to Jet Admin <a href="#step-2-connect-the-database-to-appsmith" id="step-2-connect-the-database-to-appsmith"></a>

* Open up the database connection information section under Project Settings in Supabase.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FrtqRbsqggl6aKY05XoZl%2Fsupabase.jpg?alt=media&#x26;token=42f8e95c-a136-4ebe-b705-9e85f525dfad" alt=""><figcaption></figcaption></figure>

Choose a **Supabase** database from the list of available data sources in Jet Admin:

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FZR99Xjl2h7MVJc39v93q%2F123.jpg?alt=media&#x26;token=0640944e-d72c-47b5-9b1b-42c3810d193d" alt=""><figcaption></figcaption></figure>

The quickest way to integrate database is **Instant Connection** (**localhost** is not valid, use [**Docker**](https://docs.jetadmin.io/user-guide/integrations/database-resources/docker-installation) or [**Python**](https://docs.jetadmin.io/user-guide/integrations/database-resources/python-app-installation) integration instead). We encrypt all data and credentials that go through our servers using an HTTPS connection.

You'll need to fill out the following form:

![](https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LQ08RFAKZvFADEiXKFy%2F-MjZ3LfsU1ZReomd0nUz%2F-MjZ7Fjw5kkgeXm89izK%2Fimage.png?alt=media\&token=533b380b-ce3d-41f2-8a29-30690e500c59)

| Name              | Description                                                                                                                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Host              | The IP address or hostname (db.example.com) of where your database instance resides. Note, `localhost` and **`127.0.0.1` are not valid!** Make sure it is accessible from these IPs: `95.179.253.121` |
| User              | Username for this database                                                                                                                                                                            |
| Password          | Password for this database                                                                                                                                                                            |
| Database Name     | The name of the database you would like to interact with.                                                                                                                                             |
| Database Port     | Port to connect to. By default PostgreSQL: 5432                                                                                                                                                       |
| PostgreSQL Schema | Your database schema (`optional`)                                                                                                                                                                     |
| Extra Parameters  | Extra parameters, ex. charset=utf8 (`optional`)                                                                                                                                                       |

Now you're **ready to go!** The only thing that's left is to build an actual app on top of the data you brought in from Supabase

### Step3: Build an app on Jet Admin

Let's build Custom CRM using Jet Admin that allows everyone to **track** Opportunities: Value Deals, Deal Statuses, **update** Deals, and **send Slack notifications** when a Deal data is changed.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FJgBGDdpmGcvwgpTtaMDH%2FOpportunityDashboard.png?alt=media&#x26;token=a044846f-1344-4674-9f5e-f72187366ff2" alt=""><figcaption><p>Custom CRM</p></figcaption></figure>

#### 3.1 Configure Data Types

Go to your Data (in the data section) that was successfully imported from Supabase in previous steps and update **Field Types** to make your app look nice and polished.&#x20;

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FOyf6717cZm02W4PtLLoG%2Fimage.png?alt=media&#x26;token=e73c98d4-8d35-42ef-85ea-6dd955f5b685" alt=""><figcaption></figcaption></figure>

#### 3.2 Build App's UI

Create a new Page, drag-and-drop components to the canvas and connect these components with your Data.

#### Drag-and-drop UI components to the Canvas

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FghfXYb2xl5YfgVcWGAnM%2Fzsrxhdcsr.gif?alt=media&#x26;token=bce0b47e-e89f-4111-b74b-d469fccdb5be" alt=""><figcaption></figcaption></figure>

#### Connect Data and Bind Componentsim

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FONkxqsToD1XHqWkwC1bR%2Fxfkcj.gif?alt=media&#x26;token=49f49c24-d1f3-49fd-995f-269eae9b081c" alt=""><figcaption></figcaption></figure>

#### Configure UI components

Then fetch data from relevant collections in each UI component, using panel on the right

{% hint style="info" %}
Note that each type of UI component might require different configuration. For the reference, see the [components section](https://docs.jetadmin.io/user-guide/design-and-structure/components)
{% endhint %}

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FpHA0Yn7XwfIb2RZCqq4I%2Fdxhtcfty.JPG?alt=media&#x26;token=fa4ab304-e71f-45c9-8bef-7e5f41646351" alt=""><figcaption></figcaption></figure>

#### Enable filtering

Then select the Filter component and click "Bind" then choose the Kanban from the list - this will link the filter component and the kanban component so that any filter added will be applied to the kanban.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F0NnbrYU6xEwmFXHJSIMq%2Fdtxjfgy.JPG?alt=media&#x26;token=9a02ba67-48e1-4593-958c-6d5ffabd9d20" alt=""><figcaption></figcaption></figure>

After this, add as many filters as you need - they all will have logical AND between them

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F5w59rHD4Z7OXYyRL1tSG%2FScreenshot%20(203).png?alt=media&#x26;token=a81d3da5-b5c2-499e-8d04-45119825f2ad" alt=""><figcaption></figcaption></figure>

#### Add record updating

To be able to change various fields from our Opportunities collection (that is fetched through the Kanban UI component) we've already added a Form component.

Now we need to make this form update a record that we selected in the Kanban on the left. To do this, we'll need to:&#x20;

**a)** Generate the form and&#x20;

**b)** Bind our form to the Kanban

Now, connect the form to our Opportunities collection and set what the Form will do (Update a record):

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FwCjAx9FmtQ3adwMbtljQ%2Fdxtjcvy.gif?alt=media&#x26;token=586a4820-e84a-420f-9743-51fc527073b2" alt=""><figcaption></figcaption></figure>

Follow up with binding the Form and finally, generating it

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F7ZfqDPkzomAwkKIMfXF1%2Fzxjncvgybu.gif?alt=media&#x26;token=e9f0a3b8-058f-461a-930c-49d36594cc76" alt=""><figcaption></figcaption></figure>

Now, we're halfway through. The only thing left is to make our app send notifications when we adit the Opportunity

#### Send notifications

To configure the notifications in Slack we'll need to create an **Automation** with data change in Opportunities collection as a trigger. You can find Automations in **the left panel**:

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FDpLAV0Ag2zQzJmZvNYJK%2FScreenshot%20(205).png?alt=media&#x26;token=fb54490f-86f7-4c36-8993-38e3b09f7c38" alt=""><figcaption></figcaption></figure>

Then create **a trigger and an action** as it's shown on this GIF:

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FGnmbUuKltFmff4voVV8E%2Fgkvu78.gif?alt=media&#x26;token=957280be-bfb6-46f8-8fce-a8a9ccc1ec65" alt=""><figcaption></figcaption></figure>

Then withing the *f* `Formula` modal we can fetch **dynamic values** into our message and **customize** it using powerful Excel-like formulas

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FXKHD8bR97yGAz8wKXdRr%2FScreenshot%20(204).png?alt=media&#x26;token=8e5a09fb-4ab9-4be0-8236-26c1c35884b1" alt=""><figcaption></figcaption></figure>

Here's an example of a message that informs about the `Status` change in the `Opportunities` collection&#x20;

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FrNWq9D61YdLGqhUHYFg4%2Ffxjchf.JPG?alt=media&#x26;token=91ebcc42-e5a7-4eeb-b9cd-c9b31d0bf48e" alt=""><figcaption></figcaption></figure>

#### 3.3 Share your app with teammates

Finally, go to Share -> Invite with Link (or use other invite options) to invite end-users and your team

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FZdyCKCFnrqf98Nadjj5i%2Fszrhxdcgt5.gif?alt=media&#x26;token=fe25a675-4d2a-444f-b06a-4bc8a4f3abf1" alt=""><figcaption></figcaption></figure>
