> For the complete documentation index, see [llms.txt](https://docs.eitherway.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eitherway.ai/documentation/engineering/backend-service-supabase-integration.md).

# Backend Service (Supabase Integration)

#### Overview

EitherWay integrates Supabase for instant backend provisioning. One click gives your application:

* Managed PostgreSQL database
* Authentication (email, OAuth, magic links)
* Storage buckets for files
* Real-time subscriptions
* Auto-generated REST and GraphQL APIs
* Row-level security

***

#### **Enabling Backend Service**

1. Click “Enable Backend” in the chat interface
2. Eitherway provisions a Supabase project
3. Credentials are securely stored and injected
4. Database schema is auto-generated from your requirements

***

#### **API Endpoints**

| Endpoint                                  | Purpose                   |
| ----------------------------------------- | ------------------------- |
| `GET /api/backend-service/status`         | Check provisioning status |
| `POST /api/backend-service/enable`        | Enable for an app         |
| `POST /api/backend-service/provision`     | Provision resources       |
| `POST /api/backend-service/schema/apply`  | Apply database schema     |
| `GET /api/backend-service/schemas/:appId` | Get current schema        |

***

#### **Database Tools**

The AI agent can:

* Create tables and relationships
* Set up row-level security policies
* Generate TypeScript types
* Create API endpoints automatically
* Set up real-time subscriptions

***

#### Storage Buckets

```
POST /api/backend-service/storage/bucket
{
"appId": "your-app-id",
"name": "user-uploads", "public": false
}
```
