2.5 KiB
2.5 KiB
Supabase Production Setup (No Docker)
This guide shows how to use Supabase production instance (no local Docker required).
Quick Start
Run Flutter with Supabase
cd old
./scripts/run-flutter-supabase.sh
This script:
- Reads
env.jsonfor Supabase credentials - Extracts
SUPABASE_URLandSUPABASE_ANON_KEY - Runs Flutter with
--dart-defineflags
Manual Run
If you prefer to run manually:
flutter run -d chrome \
--dart-define=SUPABASE_URL="https://yeqdxdocspsuexamljen.supabase.co" \
--dart-define=SUPABASE_ANON_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Configuration
Your Supabase credentials are stored in env.json:
{
"SUPABASE_URL": "https://yeqdxdocspsuexamljen.supabase.co",
"SUPABASE_ANON_KEY": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
How It Works
- Script reads env.json → Extracts Supabase credentials
- Flutter receives credentials → Via
--dart-defineflags - App initializes Supabase → Uses
String.fromEnvironment()to read credentials - Services use Supabase → All data operations go through Supabase client
Troubleshooting
"Missing SUPABASE_URL or SUPABASE_ANON_KEY"
Solution: Make sure you're running with the script:
./scripts/run-flutter-supabase.sh
Or manually pass the flags:
flutter run -d chrome \
--dart-define=SUPABASE_URL="<your-url>" \
--dart-define=SUPABASE_ANON_KEY="<your-key>"
Script Can't Read env.json
Make sure:
env.jsonexists in theold/directory- File contains valid JSON
- Has
SUPABASE_URLandSUPABASE_ANON_KEYkeys
Supabase Connection Errors
-
Check your Supabase project is active:
- Go to https://supabase.com/dashboard
- Verify your project is running
-
Verify credentials:
- Check
env.jsonhas correct values - Make sure anon key hasn't been rotated
- Check
-
Check network:
- Ensure you can access
https://yeqdxdocspsuexamljen.supabase.co
- Ensure you can access
Database Access
Your Supabase project has a PostgreSQL database. You can:
-
Access via Supabase Dashboard:
- Go to https://supabase.com/dashboard
- Select your project
- Use SQL Editor or Table Editor
-
Direct PostgreSQL connection:
- Connection string available in Supabase Dashboard → Settings → Database
- Use with psql or any PostgreSQL client
Next Steps
- ✅ Supabase is configured and ready
- ✅ Run
./scripts/run-flutter-supabase.shto start the app - ✅ App will connect to your production Supabase instance
No Docker needed! 🎉