Supabase Setup Guide
This guide covers setting up Supabase for the Traceo platform, including database configuration, authentication, and security settings.Prerequisites
- Supabase account (https://supabase.com)
- Supabase CLI installed (
npm install -g supabase) - PostgreSQL client (
psql) for migration execution
Project Setup
1. Create Supabase Project
- Log in to Supabase Dashboard
- Click “New Project”
-
Configure:
- Organization: Select or create
- Name:
traceo-production(ortraceo-staging) - Database Password: Generate a strong password (save this!)
- Region: Choose closest to your users
- Pricing Plan: Pro recommended for production
- Wait for project provisioning (~2 minutes)
2. Get Connection Details
From Project Settings > Database:Database Setup
1. Run Migrations
2. Using Supabase CLI (Alternative)
3. Verify RLS
Authentication Setup
1. Configure Auth Providers
In Supabase Dashboard > Authentication > Providers:Email/Password
- Enable “Email” provider
- Configure:
- Confirm email: Yes (production)
- Secure email change: Yes
- Custom SMTP (recommended for production)
Google OAuth
- Create OAuth credentials in Google Cloud Console
- Add authorized redirect URI:
https://[PROJECT-REF].supabase.co/auth/v1/callback - Copy Client ID and Secret to Supabase
Microsoft OAuth
- Register app in Azure Portal
- Add redirect URI:
https://[PROJECT-REF].supabase.co/auth/v1/callback - Copy Application ID and Secret to Supabase
2. Configure Email Templates
In Authentication > Email Templates:- Confirm signup: Customize welcome email
- Reset password: Customize reset flow
- Magic link: Optional passwordless auth
3. Configure URL Settings
In Authentication > URL Configuration:Security Configuration
1. API Settings
In Project Settings > API:- JWT Expiry: 3600 (1 hour) recommended
- Enable Row Level Security: Already enabled via migrations
- Realtime: Enable only if needed
2. Database Security
3. Connection Pooling
For production, use Supavisor (Supabase’s connection pooler):Environment Configuration
Production .env
Development .env
Client Integration
Python (MCP Server / Engine)
TypeScript (Web Client)
Monitoring
1. Database Metrics
In Supabase Dashboard > Database > Reports:- Monitor query performance
- Track connection usage
- Review slow queries
2. Auth Metrics
In Supabase Dashboard > Authentication > Users:- Monitor sign-ups
- Track failed logins
- Review user sessions
3. Logs
Backup & Recovery
Automatic Backups (Pro Plan)
- Point-in-time recovery: Up to 7 days
- Daily backups: Retained for 7 days
Manual Backup
Troubleshooting
RLS Issues
Connection Issues
Migration Rollback
Next Steps
- Run migrations on your Supabase project
- Configure authentication providers
- Set up environment variables in your deployment platform
- Test RLS policies with the seed data
- Configure monitoring alerts