AIvoices/supabase
2025-06-03 16:03:42 +01:00
..
migrations add pitch shift credit @RomanLut 2025-06-03 16:03:42 +01:00
.gitignore updated migration files 2025-04-17 17:23:50 +01:00
config.toml updated migration files 2025-04-17 17:23:50 +01:00
README.md update JWT_SECRET to JWT_SECRET_KEY 2025-04-23 12:53:53 +01:00
seed.sql replacing old name with elato 2025-05-01 12:57:35 +01:00
tables.png adding supabase readme 2025-04-21 13:19:13 +01:00

Supabase Setup and Usage Guide

Prerequisites for running Supabase:

  • Docker Desktop (or Docker Engine + Docker Compose on Linux)
  • Supabase CLI

Installation

  1. Install Supabase CLI

    # Using NPM
    npm install -g supabase
    
    # Using Homebrew (macOS)
    brew install supabase/tap/supabase
    
  2. Start Supabase locally

    # Navigate to your project
    cd ElatoAI
    
    # Start Supabase local development
    supabase start
    
  3. Verify installation The output should show local endpoints including:

Configuration

  1. Environment variables Add these to your .env.local and .env file in frontend-nextjs and server-deno respectively:
    SUPABASE_URL=http://127.0.0.1:54321
    SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
    JWT_SECRET_KEY=super-secret-jwt-token-with-at-least-32-characters-long
    

Tables chart

View a live chart of the tables and their relationships here

Supabase Tables Chart

Tables

  1. users - user details are stored here
  2. devices - device details (mac address, device name, etc) are stored here
  3. conversations - conversation details (start time, end time, etc) are stored here
  4. messages - all conversations and transcripts are stored here
  5. api_keys - api keys are stored here (not used for local development)
  6. languages - all supported languages are stored here

Development Workflow

  1. Make schema changes in Supabase Studio (http://127.0.0.1:54323)
  2. Generate migrations: supabase db diff -f <migration_name>
  3. Apply to local database: supabase migration up
  4. Push changes to production when ready

Deploying to your own supabase instance

  1. Create a new supabase project
  2. Copy the supabase url and anon key
  3. Paste them in the .env and .env.local file in the root of the project
  4. Link the project to the new supabase instance: supabase link --project-ref <project_ref>
  5. Run supabase db push --include-seed to push the changes to the local database and seed the database with the data in supabase/seed.sql

Stopping Supabase

supabase stop

For more details, visit the Supabase documentation.