Supabase — The Open Source Firebase Alternative
Supabase is an open-source backend platform built on Postgres. It provides a complete backend — database, authentication, real-time subscriptions, storage, edge functions, and vector embeddings — with instant APIs and a generous free tier.
What it is
Supabase is an open-source backend platform built on PostgreSQL. It bundles a relational database, authentication, real-time subscriptions, object storage, edge functions, and vector embeddings into a single service with auto-generated REST and GraphQL APIs.
It targets developers who want Firebase-like convenience without vendor lock-in. Because the foundation is Postgres, you keep full SQL access, row-level security, extensions, and the ability to migrate to any Postgres host.
How it saves time or tokens
Supabase eliminates the need to wire up separate services for auth, file uploads, and real-time messaging. A single supabase init && supabase start gives you a local dev environment with all services running. The auto-generated APIs mean you skip writing boilerplate CRUD endpoints entirely.
For AI workflows, the pgvector extension enables vector similarity search directly inside your existing Postgres database, avoiding a separate vector store.
How to use
- Install the Supabase CLI with
npm install -g supabase, then runsupabase initandsupabase startto launch a local instance. - Connect from your application using the Supabase client library and your project URL plus anon key.
- Define tables, row-level security policies, and edge functions through the dashboard or SQL migrations.
Example
import { createClient } from '@supabase/supabase-js'
const supabase = createClient(
'https://your-project.supabase.co',
'your-anon-key'
)
// Query data
const { data } = await supabase
.from('posts')
.select('*')
.limit(10)
// Auth
await supabase.auth.signUp({
email: 'user@example.com',
password: 'secure-password'
})
// Real-time subscription
supabase
.channel('posts')
.on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'posts' },
(payload) => console.log('New post:', payload.new)
)
.subscribe()
Related on TokRepo
- Database tools -- Database management and query tools for AI workflows
- Self-hosted tools -- Self-hostable infrastructure for development teams
Common pitfalls
- Row-level security (RLS) is disabled by default on new tables. Without enabling RLS and defining policies, your data is publicly accessible through the auto-generated API.
- The anon key is meant for client-side use with RLS. Never use the service_role key in frontend code as it bypasses all security policies.
- Real-time subscriptions require enabling replication on the specific tables you want to listen to. Forgetting this step means no events are broadcast.
Frequently Asked Questions
Supabase uses PostgreSQL as its database instead of Firestore, giving you full SQL, joins, and relational modeling. It is open-source and self-hostable, while Firebase is proprietary and GCP-only. Supabase provides row-level security natively, whereas Firebase uses separate security rules. The tradeoff is that Supabase has fewer managed services for mobile-specific features like push notifications.
Yes. Supabase provides Docker Compose files for self-hosting all components: Postgres, GoTrue (auth), Realtime, Storage, and PostgREST. You can run the full stack on any server or Kubernetes cluster. The self-hosted version has the same features as the hosted platform.
Yes. Supabase includes the pgvector extension for storing and querying vector embeddings directly in PostgreSQL. You can use it for semantic search, RAG pipelines, and recommendation systems without a separate vector database.
Supabase Auth (GoTrue) supports email/password, magic links, phone OTP, and over 20 OAuth providers including Google, GitHub, Apple, and Azure. It also supports SAML SSO for enterprise use cases.
Supabase is used in production by thousands of companies. The hosted platform provides automatic backups, point-in-time recovery, connection pooling via PgBouncer, and monitoring. For high-availability self-hosted deployments, you manage Postgres replication yourself.
Citations (3)
- Supabase GitHub— Supabase is an open-source Firebase alternative built on PostgreSQL
- Supabase Vector Docs— pgvector extension for vector similarity search
- Supabase Auth Docs— GoTrue handles authentication with 20+ OAuth providers
Related on TokRepo
Discussion
Related Assets
Cucumber.js — BDD Testing with Plain Language Scenarios
Cucumber.js is a JavaScript implementation of Cucumber that runs automated tests written in Gherkin plain language.
WireMock — Flexible API Mocking for Java and Beyond
WireMock is an HTTP mock server for stubbing and verifying API calls in integration tests and development.
Google Benchmark — Microbenchmark Library for C++
Google Benchmark is a library for measuring and reporting the performance of C++ code with statistical rigor.