Prerequisites
Supabase Account
Create a free account at supabase.com
Supabase CLI
Installed via npm (included in Jet’s devDependencies)
Quick Reference
Common Supabase CLI commands:Initial Setup
Set project ID
Update This distinguishes your project from others on the same machine.
supabase/config.toml with a unique project ID:Start Supabase locally
- Postgres database on port 54322
- API server on port 54321
- Studio (dashboard) on port 54323
- Inbucket (email testing) on port 54324
First start takes a few minutes to download Docker images.
Local Development
Accessing Services
- Studio Dashboard
- Email Testing
- API
Open http://localhost:54323 to access:
- Table editor
- SQL editor
- Authentication users
- Storage buckets
- Edge functions
Database Migrations
Jet includes pre-built migrations insupabase/migrations/:
Creating Migrations
Testing with Seed Data
Create seed data insupabase/seed.sql:
npx supabase db reset.
Linking a Remote Project
Connect your local development to a production Supabase project:Create Supabase project
- Go to app.supabase.com
- Create a new project
- Note your project reference ID (from Settings → General)
Edge Functions
Supabase Edge Functions are serverless TypeScript functions that run on Deno.Creating Edge Functions
Calling Edge Functions from Angular
Authentication Setup
Jet includes pre-configured authentication flows.Email Configuration
- Local Development
- Production
Emails are caught by Inbucket at http://localhost:54324.No configuration needed.
OAuth Providers
Enable OAuth providers insupabase/config.toml:
Storage Setup
Jet includes a pre-configuredavatars storage bucket.
Using Storage in Angular
Role-Based Access Control (RBAC)
Jet includes RBAC setup in13_rbac.sql.
App Roles
Checking User Roles
Removing RBAC
If you don’t need RBAC:- Delete
supabase/migrations/13_rbac.sql - Remove role checks from code
- Reset database:
npx supabase db reset
Removing Supabase
To remove Supabase completely:Remove Supabase code
Remove:
- Supabase injection tokens
- Auth services and guards
- Profile services
- Storage references
Troubleshooting
Supabase won't start
Supabase won't start
Check if Docker is running:If Docker isn’t running, start Docker Desktop.If ports are in use:
Migrations fail
Migrations fail
Check migration syntax:Reset and try again:
Authentication not working
Authentication not working
- Check environment variables are correct
- Verify site_url in
supabase/config.toml: - Check emails in Inbucket for confirmation links
RLS policies blocking access
RLS policies blocking access
Test with RLS disabled temporarily:Then add proper policies:
Best Practices
Always use RLS
Always use RLS
Enable Row Level Security on all tables:Never disable RLS in production.
Use migrations for all schema changes
Use migrations for all schema changes
Never make schema changes directly in production. Always:
- Create migration locally
- Test with
npx supabase db reset - Push to production with
npx supabase db push
Version control migrations
Version control migrations
Commit all migration files to Git. This ensures:
- Reproducible database schema
- Easy rollbacks
- Team synchronization
Use enums for consistency
Use enums for consistency
Define Supabase references in enums: