Firebase and Supabase Tutorial
Learn Firebase and Supabase step by step: 31 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Backend as a Service
- What Is a Backend as a Service? Learn what a Backend as a Service replaces, what you trade away, how pricing and lock-in work, and how this track teaches Firebase and Supabase.
- Firebase vs Supabase: Choosing Compare Firebase and Supabase side by side: NoSQL vs Postgres, open source vs proprietary, features, costs and migration, with a scoring checklist.
- Creating Projects and Using the SDKs Create a Firebase and a Supabase project, install the SDKs, understand public keys versus secrets, use environment variables and run local emulators.
Authentication
- Email and Password Sign-In Sign users up and in with email and password in Firebase Auth and Supabase Auth: verification, password reset, sessions, errors, plus a runnable stand-in.
- OAuth Providers, Magic Links and JWTs Add Google and GitHub sign-in, magic links and OTP codes, then learn how JWT access tokens, refresh tokens and expiry work, with a runnable JWT stand-in.
- Users, Roles and Custom Claims Store profile data safely, give users roles with Firebase custom claims or Supabase app_metadata, create profile triggers, and link accounts.
Firebase Cloud Firestore
- Firestore Data Model Learn how Cloud Firestore stores data: documents, collections, subcollections, field types, references, IDs and size limits, with a runnable stand-in store.
- Reading and Writing Documents Create, read, update and delete Firestore documents. Learn merge, serverTimestamp, increment, arrayUnion, batched writes and transactions with a runnable stand-in.
- Queries, Indexes and Pagination Learn Firestore where, orderBy and limit, why compound queries need composite indexes, how startAfter cursors paginate, and how to live without joins.
- Realtime Listeners and Offline Support Use Firestore onSnapshot for live updates, understand the local cache, pending writes and unsubscribing, count listener cost, and enable offline persistence.
- Firebase Realtime Database Learn the Firebase Realtime Database JSON tree: flatten data, write with set, update and push, listen to child events, query, and detach callbacks.
Supabase Postgres Database
- Supabase and Postgres Fundamentals Learn what a Supabase project really is: a Postgres database. Create tables, primary and foreign keys, use the SQL editor, and keep schema as code with CLI migrations.
- Querying with supabase-js Read and write your Supabase Postgres data from JavaScript: select, insert, update, delete, upsert, filters, order, range, joins, RPC calls and error handling.
- Supabase Realtime and Postgres Changes Use Supabase Realtime channels for database change events, broadcast messages and presence, and learn how publications and RLS affect who hears what.
Security Rules and Row Level Security
- Firestore Security Rules Write Firestore Security Rules that protect your data: match paths, request.auth, resource.data, write validation, why rules are not filters, and testing.
- Row Level Security Policies Protect Supabase tables with Postgres Row Level Security: enable RLS, write select, insert, update and delete policies, using vs with check, and avoid leaks.
- Security Pitfalls in Both Platforms Avoid the classic Firebase and Supabase security mistakes: exposed keys, open rules and policies, missing validation, App Check, rate limits and an audit checklist.
Storage and Functions
- File Storage and Uploads Upload and serve files with Cloud Storage for Firebase and Supabase Storage: buckets, public vs private, signed URLs, access rules, limits and resizing.
- Cloud Functions and Edge Functions Run trusted backend code with Firebase Cloud Functions and Supabase Edge Functions: triggers, secrets, cold starts, webhooks, idempotency and retries.
- Hosting, Deploying and Environments Deploy a frontend with Firebase Hosting or next to Supabase, keep dev, staging and production projects apart, automate CI deploys and control costs.
Data Modeling and Patterns
- Modeling Data: Documents vs Tables Model the same app as Firestore documents and as Postgres tables, and learn denormalization, counters, fan-out writes and how to migrate a data shape.
- Multi-Tenant and Team Apps Build team apps where each organization's data is isolated: memberships, roles per org, invitations, billing seats, Firestore rules and Postgres RLS.
- Search, Aggregations and Analytics Count and sum in Firestore, run Postgres full-text and fuzzy search in Supabase, know when to use external search or BigQuery, and use SQL views.
- Analytics, Crashlytics and Performance Monitoring Log Firebase Analytics events, set user properties, mark conversions, build funnels and audiences, and learn Crashlytics, Performance Monitoring and Remote Config.
Real-World Projects
- Project: Realtime Todo App Build a realtime, per-user todo app with auth, live sync and optimistic UI, designed around a storage adapter that works with Firebase or Supabase.
- Project: Chat App with Presence Design a chat app with rooms, messages, presence, pagination and security rules or RLS, with read-only SDK code and a runnable stand-in chat engine.
- Project: Blog with Auth, Storage and Roles Build a blog backend with editor and admin roles, image uploads and a publish workflow, in both Firebase and Supabase, with a runnable permission engine.
- Project: SaaS Starter with Teams Design a SaaS backend on Firebase or Supabase: teams, invitations, plan limits and webhook-driven subscriptions, with runnable idempotent webhook code.
Practice and Review
- Practice Exercises with Solutions Twelve hands-on exercises on security rules, RLS policies, queries, data modeling and auth tokens, each with a runnable stand-in solution you can edit.
- Interview Questions Prepare for backend interviews with short answers on Firebase vs Supabase, security rules, RLS, scaling, costs, modeling, realtime and auth, plus code demos.
- Firebase and Supabase Cheat Sheet A side-by-side cheat sheet of everyday tasks in the Firebase and Supabase SDKs, the CLI commands you need and a security checklist, with two small demos.