Skip to main content
Browse our collection of examples and code samples to learn Supabase patterns and best practices. All examples are production-ready and include complete source code.

Authentication Examples

OAuth, MFA, magic links, and more

Database Examples

Queries, relations, RLS, and triggers

Storage Examples

File uploads, image transforms, and CDN

AI Examples

Vector search, embeddings, and AI integrations

Example Repository Structure

All examples are available in our GitHub repository organized by feature:
examples/
├── auth/              # Authentication examples
├── database/          # Database operations
├── storage/           # File storage
├── realtime/          # Real-time features
├── ai/                # AI and vectors
├── edge-functions/    # Edge Functions
├── user-management/   # User profiles
└── todo-list/         # Todo applications

Full-Stack Applications

A complete todo application with authentication, database operations, and RLS.Features:
  • User authentication
  • CRUD operations
  • Row Level Security
  • Real-time updates
Tech Stack: Next.js, TypeScript, Tailwind CSSView on GitHub
User profile management with avatar uploads and authentication.Features:
  • Email/password auth
  • Profile management
  • Avatar uploads
  • Storage integration
Tech Stack: Next.js App Router, Server ActionsView on GitHub
Real-time chat application with channels and presence.Features:
  • Real-time messaging
  • Multiple channels
  • Online presence
  • Message history
Tech Stack: Next.js, Realtime subscriptionsView on GitHub

Framework-Specific Examples

By Use Case

Authentication

Email/Password

Basic email and password authentication

OAuth

Google, GitHub, and social providers

Magic Links

Passwordless authentication

MFA

Multi-factor authentication

Phone Auth

SMS-based authentication

SSO

Enterprise single sign-on

Database

CRUD Operations

Create, read, update, delete

Relations

Join tables and foreign keys

RLS Policies

Row level security

Triggers

Database triggers

Functions

Postgres functions

Full-Text Search

Search functionality

Storage

File Upload

Basic file uploads

Image Transform

On-the-fly transformations

Resumable Upload

Large file uploads

Private Files

Access control

CDN

Global distribution

Metadata

File metadata

Running the Examples

Prerequisites

  1. A Supabase account (sign up here)
  2. Node.js 16+ or Flutter 3+ installed
  3. Basic knowledge of the framework

Setup Steps

1

Clone the repository

git clone https://github.com/supabase/supabase.git
cd supabase/examples/[example-name]
2

Install dependencies

npm install
# or
flutter pub get
3

Configure environment

Copy .env.example to .env.local and add your Supabase credentials:
NEXT_PUBLIC_SUPABASE_URL=your-project-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
4

Run the database migrations

Most examples include SQL files. Run them in your Supabase SQL Editor.
5

Start the development server

npm run dev
# or
flutter run

Community Examples

Explore examples built by the community:

Contributing

Want to contribute an example? We welcome contributions!
  1. Fork the Supabase repository
  2. Create your example in the appropriate directory
  3. Include a comprehensive README
  4. Submit a pull request
See our Contributing Guide for details.

Get Help

Discord Community

Join our Discord for help and discussion

GitHub Discussions

Ask questions and share ideas

Documentation

Read the full documentation

Tutorials

Follow step-by-step tutorials