This document provides a comprehensive guide to set up the Supabase backend for the Ell-ena project. Follow these steps to get your backend up and running quickly.
- Prerequisites
- Installing Supabase CLI
- Setting Up Supabase Project
- Configuring Environment Variables
- Deploying Database Schema
- Setting Up Authentication
- Deploying Edge Functions
- Troubleshooting
Before you begin, ensure you have the following installed:
- Node.js and npm: Download from nodejs.org
- Docker: Required for local development. Download Docker Desktop
- Git: To clone the repository
The Supabase CLI is essential for managing your Supabase projects locally and deploying to production.
-
If you don't have Scoop installed, install it first:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser irm get.scoop.sh | iex
-
Add the Supabase bucket and install the CLI:
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git scoop install supabase
-
Verify the installation:
supabase --version
-
If you don't have Homebrew installed, install it first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install the Supabase CLI:
brew install supabase/tap/supabase
-
Verify the installation:
supabase --version
npm install -g supabase- Visit app.supabase.com and sign up for an account if you don't have one.
- After signing up, you'll be directed to the dashboard.
- Click on "New Project" button.
- Enter a name for your project (e.g., "Ell-ena").
- Create a strong database password and store it securely.
- Choose a region closest to your users.
- Click "Create new project".
The project creation will take a few minutes. Once completed, you'll be redirected to the project dashboard.
-
Authenticate the CLI with your Supabase account:
supabase login
This will open a browser window where you need to authorize the CLI.
-
Navigate to your project directory:
cd path/to/Ell-ena -
Initialize Supabase in your project (if not already initialized):
supabase init
-
Link your local project to the remote Supabase project:
supabase link --project-ref YOUR_PROJECT_REF
Replace
YOUR_PROJECT_REFwith your project reference ID found in the Supabase dashboard URL.
-
Copy the
.env.examplefile to create a new.envfile:cp .env.example .env
-
Get your Supabase credentials from the project dashboard:
- Go to Settings > API in your Supabase dashboard
- Copy the URL, anon key, and service role key
-
Update your
.envfile with these values:SUPABASE_URL=<YOUR_SUPABASE_URL> SUPABASE_ANON_KEY=<YOUR_SUPABASE_ANON_KEY> SUPABASE_SERVICE_ROLE_KEY=<YOUR_SUPABASE_SERVICE_ROLE_KEY> -
For the GEMINI_API_KEY:
- Visit Google AI Studio
- Create an API key and add it to your
.envfile
-
Obtain your VEXA_API_KEY:
- Go to https://vexa.ai/.
- Click on the "Get Started" button.
- Login using your Google account.
- Once logged in, navigate to the API section to generate your API key.
- Copy the API key and paste it into the appropriate configuration file or environment variable in your project.
The project includes SQL scripts in the sqls directory that define the database schema, tables, functions, and policies.
Run the following commands in sequence to deploy all SQL scripts:
supabase db pushIf you encounter any issues or prefer to run the scripts manually, you can execute them directly in the SQL editor:
-
Go to the SQL Editor in your Supabase dashboard.
-
Execute the SQL scripts in the following order:
# User authentication and teams 01_user_auth_schema.sql 02_user_auth_policies.sql # Task management 03_task_schema.sql # Ticket management 04_tickets_schema.sql # Meetings and transcriptions 05_meetings_schema.sql 06_meeting_transcription.sql 07_meetings_processed_transcriptions.sql 08_meetings_ai_summary.sql 09_meeting_vector_search.sql 10_generate_missing_embeddings.sql
Each script creates specific tables, functions, or sets up row-level security policies.
Supabase provides built-in authentication. The project uses email-based authentication with OTP (One-Time Password) codes and Google OAuth.
- Open your Supabase Dashboard → Authentication → Providers → Email
- Ensure the following options are enabled:
- ✅ Enable Email Signups
- ✅ Enable Email Confirmations
- ✅ Secure Email Change
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services → Credentials
For Android:
- Click Create Credentials → OAuth client ID
- Application type: Android
- Name:
Ell-ena Android - Package name:
org.aossie.ell_ena - Get SHA-1 certificate fingerprint:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android - Paste the SHA-1 fingerprint
- Click Create and copy the Client ID
For iOS:
- Click Create Credentials → OAuth client ID
- Application type: iOS
- Name:
Ell-ena iOS - Bundle ID:
org.aossie.ellena(fromios/Runner.xcodeproj) - Click Create and copy the Client ID
For Web (Required by Supabase):
- Click Create Credentials → OAuth client ID
- Application type: Web application
- Name:
Ell-ena Web - Authorized redirect URIs:
https://YOUR_PROJECT_REF.supabase.co/auth/v1/callback- Replace
YOUR_PROJECT_REFwith your Supabase project reference
- Replace
- Click Create and copy both Client ID and Client Secret
OAuth Consent Screen:
- Go to OAuth consent screen
- User Type: External
- Fill in required fields:
- App name: Ell-ena
- User support email: Your email
- Developer contact: Your email
- Save and continue
- Go to Authentication → Providers → Google
- Toggle Enable Sign in with Google to ON
- Client ID (for OAuth): Paste Web Client ID
- Client Secret (for OAuth): Paste Web Client Secret
- Skip nonce check: Toggle ON
- Click Save
- Go to Authentication → URL Configuration
- Under Redirect URLs, add:
io.supabase.ellena://login-callback/ - Click Save
- Go to Authentication → Emails in your Supabase project.
- Under the Magic Link and Confirm Signup section, click Edit Template.
- Replace the default content with the following HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Your Verification Code</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f6f8;
margin: 0;
padding: 40px;
}
.container {
max-width: 480px;
margin: auto;
background-color: #ffffff;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
text-align: center;
}
.otp {
font-size: 36px;
font-weight: bold;
letter-spacing: 8px;
margin: 20px 0;
color: #57ad03;
}
.message {
font-size: 16px;
color: #333333;
}
.footer {
margin-top: 40px;
font-size: 12px;
color: #888888;
}
</style>
</head>
<body>
<div class="container">
<h2>Verify Your Email</h2>
<p class="message">
Use the 6-digit code below to verify your email address:
</p>
<div class="otp">{{ .Token }}</div>
<p class="message">
This code will expire in a few minutes. Please do not share it with anyone.
</p>
<div class="footer">© Ellena App. All rights reserved.</div>
</div>
</body>
</html>- Click Save to update your email template.
- Go to Authentication → URL Configuration.
- Set the Site URL to your application's URL.
- Add any additional redirect URLs if needed.
The project requires the following environment variables. Do NOT expose server-only secrets in the client app.
SUPABASE_URLSUPABASE_ANON_KEY
SUPABASE_SERVICE_ROLE_KEYSUPABASE_DB_URLGEMINI_API_KEYVEXA_API_KEYEDGE_INTERNAL_SECRET(if used for internal auth gating)
supabase secrets set SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
supabase secrets set SUPABASE_DB_URL=your-db-url
supabase secrets set GEMINI_API_KEY=your-gemini-api-key
supabase secrets set VEXA_API_KEY=your-vexa-api-key
supabase secrets set EDGE_INTERNAL_SECRET=your-internal-secret
# Local Testing the functions (optional)
supabase functions serve --allow-env --env-file .env
## Deploying Edge Functions
The project uses Supabase Edge Functions for serverless functionality. Deploy them using the CLI:
```bash
# Deploy all functions
supabase functions deploy
# Or deploy specific functions
supabase functions deploy fetch-transcript
supabase functions deploy generate-embeddings
supabase functions deploy get-embedding
supabase functions deploy search-meetings
supabase functions deploy start-bot
supabase functions deploy summarize-transcription-
CLI Authentication Issues
- Run
supabase loginagain to refresh your authentication.
- Run
-
Database Migration Errors
- Check for syntax errors in your SQL files.
- Ensure you're running migrations in the correct order.
-
Edge Function Deployment Failures
- Verify that your function code is valid.
- Check for any missing dependencies.
- Ensure your Supabase project has the necessary permissions.
-
Connection Issues
- Verify your environment variables are correctly set.
- Check if your IP is allowed in the Supabase dashboard.
If you encounter issues not covered in this guide:
->>> Join the conversation on the AOSSIE Ell-ena Discord channel!
- Check the Supabase Documentation
- Visit the Supabase GitHub Repository
- Join the Supabase Discord Community
After setting up your backend:
- Connect your frontend application using the Supabase client.
- Set up continuous integration for automated deployments.
- Configure monitoring and alerts for your production environment.
This guide should help you get started with the Ell-ena backend.