A deep dive into Supabase's architecture - how they're building Firebase-like features using enterprise-grade open source tools, from their PostgreSQL-first approach to their clever use of PostgREST and real-time subscriptions.
Welcome to Code2Cast! I'm your host, and today we're diving into Supabase - a project that's been making waves as the open source alternative to Firebase. But here's the thing - it's not just another Firebase clone. They're taking a completely different architectural approach that's honestly pretty brilliant.
Right! What caught my attention immediately is their tagline: 'The Postgres Development Platform.' Not 'database-as-a-service' or 'backend-as-a-service' - they're positioning PostgreSQL as the foundation for everything.
Exactly. And when you dig into their architecture, you see why. Instead of building everything from scratch, they're composing proven open source tools. Take PostgREST - this is genius - it automatically turns any PostgreSQL database into a RESTful API. So your database schema becomes your API spec.
That's wild. So you design your tables, add some row-level security policies, and boom - you've got a production API with authentication and authorization built right in. No writing controllers or routes.
And then for real-time subscriptions, they're using this Elixir server called Realtime that taps into Postgres's built-in replication stream. So when data changes in your database, it automatically broadcasts JSON over WebSockets to authorized clients. The database is literally driving the real-time features.
I love how they chose Elixir for that piece. Elixir's actor model is perfect for managing thousands of WebSocket connections. Looking at the codebase, I see they've got GoTrue handling JWT-based auth, Kong as their API gateway, and even pg_graphql for auto-generated GraphQL APIs.
The team behind this is impressive too. Joshen Lim leads with over 4,600 commits, followed by Jonathan Summers-Muir and Paul Copplestone who's one of the founders. What I found fascinating in their recent commits is how much AI integration they're adding.
Yeah, their Studio dashboard - that's the management interface built in Next.js - has AI SDK packages for OpenAI, Amazon Bedrock, and even Model Context Protocol support. They're not just building a database platform, they're making it AI-first.
And the developer experience is thoughtfully designed. It's a pnpm + Turborepo monorepo with shared UI components built on Radix UI and shadcn patterns. They've got a 'catalog' system in their workspace config to keep dependencies in sync across all packages. Very clean setup.
What really stands out is their commitment to open source. They have official client libraries for JavaScript, Flutter, Swift, and Python, plus community libraries for C#, Go, Kotlin, Ruby, and more. The modular approach means each client library can focus on specific features - PostgREST for data, GoTrue for auth, Realtime for subscriptions.
That modular architecture is brilliant because it means they can innovate on individual components without breaking everything else. And since everything is open source, you can self-host the entire stack or just use their hosted platform.
It's like they looked at Firebase and said 'What if we built this with 30 years of PostgreSQL reliability, plus the best open source tools for each layer?' The result is pretty compelling - you get Firebase's developer experience with none of the vendor lock-in.
That's a wrap on Supabase! If you're looking for a backend solution that combines PostgreSQL's power with modern developer experience, definitely check out their GitHub repo. The architecture alone is worth studying. Thanks for joining us on Code2Cast - we'll see you next time!