Supabase is an open-source backend-as-a-service. It gives you a PostgreSQL database, authentication, file storage, real-time subscriptions, and auto-generated APIs β all from a dashboard. No backend code required for basic CRUD apps.
Think of it as the open-source alternative to Firebase, but built on PostgreSQL instead of a proprietary NoSQL database.
What you get
When you create a Supabase project, you instantly get:
- PostgreSQL database β full SQL, not a limited NoSQL store
- REST API β auto-generated from your tables
- Auth β email/password, OAuth (Google, GitHub, etc.), magic links
- Storage β file uploads with access control
- Real-time β subscribe to database changes via WebSockets
- Edge Functions β serverless functions (Deno)
How it works
Create a table in the dashboard (or with SQL), and Supabase auto-generates an API:
import { createClient } from '@supabase/supabase-js';
const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
);
// Read
const { data: posts } = await supabase
.from('posts')
.select('*')
.order('created_at', { ascending: false });
// Insert
await supabase.from('posts').insert({ title: 'Hello', body: 'World' });
// Auth
await supabase.auth.signInWithOAuth({ provider: 'github' });
// Real-time
supabase
.channel('posts')
.on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'posts' },
(payload) => console.log('New post:', payload.new))
.subscribe();
Supabase vs. Firebase
| Supabase | Firebase | |
|---|---|---|
| Database | PostgreSQL (SQL) | Firestore (NoSQL) |
| Open source | Yes | No |
| Self-hostable | Yes | No |
| Pricing | Generous free tier | Pay-as-you-go |
| Querying | Full SQL, joins, aggregates | Limited NoSQL queries |
| Vendor lock-in | Low (itβs just PostgreSQL) | High |
When to use Supabase
Good fit: MVPs, side projects, full-stack apps that need auth + database + storage without building a custom backend. Especially good if you want SQL and relational data.
Not ideal: apps that need complex server-side logic (use a custom backend), or if you need Firebase-specific features like Firebase Cloud Messaging.
See also: PostgreSQL cheat sheet | What is an API?