Overview
Supabase is an open-source Firebase alternative that provides a complete backend solution for your Superun applications. It offers a PostgreSQL database, authentication, real-time subscriptions, and storage - all accessible through a simple API.What is Supabase
Supabase provides everything you need to build a full-stack application:- PostgreSQL Database: A powerful, open-source relational database
- Authentication: Built-in user management with multiple providers
- Real-time Subscriptions: Listen to database changes in real-time
- Storage: File upload and management
- Edge Functions: Serverless functions for custom logic
- Auto-generated APIs: REST and GraphQL APIs generated from your database schema
Key Benefits
- Rapid Development: Get a full backend up and running in minutes
- Real-time Features: Built-in real-time subscriptions for live updates
- Scalable: Built on PostgreSQL, scales from prototype to production
- Open Source: No vendor lock-in, self-hostable if needed
- Developer Experience: Excellent tooling and documentation
Getting Started
1. Create a Supabase Project
- Go to supabase.com and sign up
- Click “New Project”
- Choose your organization and enter project details
- Select a region close to your users
- Set a strong database password
- Click “Create new project”
2. Get Your Project Credentials
Once your project is created, you’ll need:- Project URL: Found in Settings → API
- Anon Key: Public key for client-side operations
- Service Role Key: Secret key for server-side operations (keep this secure!)
3. Configure Supabase in Superun
In your Superun project:- Go to Settings → Integrations
- Find Supabase and click Connect
- Enter your Project URL and Anon Key
- Click Save
Database Setup
Creating Tables
You can create tables in two ways:Using the Supabase Dashboard
- Go to your Supabase project dashboard
- Navigate to Table Editor
- Click New Table
- Define your table schema
- Set up Row Level Security (RLS) policies
Using SQL
Row Level Security (RLS)
Enable RLS to secure your data:Authentication
Setting Up Authentication
- Go to Authentication → Settings in your Supabase dashboard
- Configure your site URL (your Superun app URL)
- Enable desired authentication providers
Available Providers
- Email/Password: Traditional email and password authentication
- Magic Links: Passwordless authentication via email
- OAuth Providers: Google, GitHub, Twitter, Discord, etc.
- Phone: SMS authentication
Using Authentication in Your App
Superun automatically generates authentication components:User Management
Database Operations
Reading Data
Creating Data
Updating Data
Deleting Data
Real-time Subscriptions
Listen to database changes in real-time:File Storage
Uploading Files
Downloading Files
Edge Functions
Create serverless functions for custom logic:Best Practices
Security
- Always enable RLS on your tables
- Use service role key only on the server side
- Validate data on both client and server
- Use environment variables for sensitive data
Performance
- Use select() to limit returned columns
- Implement pagination for large datasets
- Use indexes on frequently queried columns
- Consider using views for complex queries
Development
- Use TypeScript for better type safety
- Create database migrations for schema changes
- Test your RLS policies thoroughly
- Use the Supabase CLI for local development
Common Patterns
User Profiles
Data Relationships
Search Functionality
Troubleshooting
Common Issues
Q: I’m getting permission denied errors A: Check your RLS policies. Make sure they allow the operations you’re trying to perform. Q: Real-time subscriptions aren’t working A: Ensure you’re subscribed to the correct channel and that RLS policies allow the user to see the data. Q: File uploads are failing A: Check your storage bucket policies and file size limits. Q: Authentication isn’t working A: Verify your site URL is correctly configured in the Supabase dashboard.Migration from Other Services
From Firebase
- Firestore → PostgreSQL: Use Supabase’s JSON columns for document-like data
- Firebase Auth → Supabase Auth: Similar API, easy migration
- Firebase Storage → Supabase Storage: Compatible S3 API
From Other Databases
- MySQL → PostgreSQL: Use Supabase’s migration tools
- MongoDB → PostgreSQL: Restructure data into relational format
Need Help?
Check our FAQ for common Supabase integration questions and troubleshooting tips.

