Environment Configuration
FindU currently uses a single production Supabase project. This guide explains how to configure your local development environment to connect to the production database.Current Architecture
Environment Files
Each repository has its own environment configuration:Web App (.env)
iOS App (Secrets.xcconfig)
Matching Algorithm (.env)
Data Scraping (.env)
Getting Credentials
From Supabase Dashboard
- Log into Supabase Dashboard
- Select the FindU production project
- Go to Settings → API
- Copy:
- Project URL → Use in all
SUPABASE_URLfields - Anon/Public Key → Use for
SUPABASE_ANON_KEY - Service Role Key → Use for
SUPABASE_SERVICE_KEY(keep secret!)
- Project URL → Use in all
From GitHub Secrets
If you have access to GitHub organization secrets:- Go to Organization Settings → Secrets
- View the production secrets
- Use these exact values in your local environment files
Working with Production
Since we’re using production directly:Best Practices
- Always use test accounts when developing features
- Never delete or modify real user data
- Be careful with bulk operations that could affect many users
- Test thoroughly before deploying changes
- Monitor logs for any issues
Creating Test Data
Service Configuration
Railway Services
All services deploy automatically from the main branch:- Web App: https://findu-web-production.up.railway.app
- Matching API: https://findu-matching-production.up.railway.app
- Data Scripts: Scheduled jobs for data updates
Supabase Features
- Database: PostgreSQL with RLS enabled
- Auth: Email, Apple, and Google sign-in
- Storage: Public bucket for school images
- Edge Functions: Serverless functions for specialized tasks
CI/CD Integration
GitHub Actions use organization secrets:Standard Secret Names
SUPABASE_URLSUPABASE_ANON_KEYSUPABASE_SERVICE_KEYRAILWAY_TOKENCOLLEGE_SCORECARD_API_KEYFIRECRAWL_API_KEYOPENAI_API_KEY
Local Development Tips
Using Supabase CLI
Database Migrations
Safety Guidelines
1
Use test accounts
Create dedicated test accounts:
2
Backup before major changes
3
Test migrations locally
4
Monitor after deployment
- Check Supabase logs
- Monitor Railway deployments
- Watch for user reports
Troubleshooting
Connection refused errors
Connection refused errors
Check that:
- Your Supabase project is active (not paused)
- Credentials are correct
- You’re using the right key type (anon vs service)
RLS policy errors
RLS policy errors
Some operations require service role key:
- Bulk updates
- Admin operations
- Data migrations
Environment variable not found
Environment variable not found
Make sure:
- File is named correctly (.env, not .env.local)
- You’ve restarted the development server
- Variables use correct naming convention
Security Notes
- Never commit environment files - They’re gitignored for a reason
- Rotate credentials regularly - Especially if exposed
- Use service keys sparingly - Only for admin operations
- Monitor access logs - Watch for suspicious activity
Next, learn about database operations to understand the schema, or check out the architecture overview to see how all components work together.