Convert Figma logo to code with AI

supabase logosupabase

The open source Firebase alternative. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

71,327
6,799
71,327
481

Top Related Projects

Firebase Javascript SDK

Parse Server for Node.js / Express

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.

43,567

Your backend, minus the hassle.

62,681

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.

27,065

The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.

Quick Overview

Supabase is an open-source Firebase alternative that provides a suite of tools for building scalable and secure web and mobile applications. It combines PostgreSQL, real-time subscriptions, authentication, storage, and serverless functions to offer a comprehensive backend-as-a-service platform.

Pros

  • Easy to set up and use, with a user-friendly dashboard and extensive documentation
  • Built on top of PostgreSQL, offering powerful relational database capabilities
  • Provides real-time subscriptions out of the box, enabling live data updates
  • Offers a generous free tier for developers and startups

Cons

  • Limited customization options compared to building a backend from scratch
  • Potential vendor lock-in, as migrating away from Supabase can be challenging
  • Less mature ecosystem compared to Firebase, with fewer third-party integrations
  • Performance may vary depending on the complexity of queries and data volume

Code Examples

  1. Initializing Supabase client:
import { createClient } from '@supabase/supabase-js'

const supabase = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY')
  1. Inserting data into a table:
const { data, error } = await supabase
  .from('users')
  .insert({ name: 'John Doe', email: 'john@example.com' })
  1. Querying data with filters:
const { data, error } = await supabase
  .from('posts')
  .select('title, content')
  .eq('category', 'technology')
  .order('created_at', { ascending: false })
  1. Setting up real-time subscriptions:
const subscription = supabase
  .from('messages')
  .on('INSERT', (payload) => {
    console.log('New message:', payload.new)
  })
  .subscribe()

Getting Started

  1. Sign up for a Supabase account at https://supabase.com
  2. Create a new project and note your project URL and API key
  3. Install the Supabase client library:
    npm install @supabase/supabase-js
    
  4. Initialize the Supabase client in your application:
    import { createClient } from '@supabase/supabase-js'
    
    const supabase = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY')
    
  5. Start using Supabase features like database operations, authentication, and real-time subscriptions in your application.

Competitor Comparisons

Firebase Javascript SDK

Pros of Firebase

  • More mature and battle-tested platform with extensive documentation
  • Wider range of features, including ML Kit and Cloud Functions
  • Stronger integration with Google Cloud Platform services

Cons of Firebase

  • Vendor lock-in with Google's ecosystem
  • Less flexible pricing model, potentially more expensive for large-scale applications
  • Limited database querying capabilities compared to SQL-based solutions

Code Comparison

Firebase:

import { initializeApp } from 'firebase/app';
import { getFirestore, collection, addDoc } from 'firebase/firestore';

const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
await addDoc(collection(db, 'users'), { name: 'John', age: 30 });

Supabase:

import { createClient } from '@supabase/supabase-js';

const supabase = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');
const { data, error } = await supabase
  .from('users')
  .insert({ name: 'John', age: 30 });

Both Firebase and Supabase offer easy-to-use SDKs for web applications. Firebase uses a more modular approach, while Supabase provides a more streamlined API. Supabase's SQL-based structure allows for more complex queries and joins, which can be advantageous for certain applications. Firebase, however, offers real-time capabilities out of the box, which may require additional setup in Supabase.

Parse Server for Node.js / Express

Pros of Parse Server

  • More mature and battle-tested, with a longer history and larger community
  • Highly customizable and extensible through plugins and cloud functions
  • Self-hosted option provides greater control over data and infrastructure

Cons of Parse Server

  • Requires more setup and configuration compared to Supabase's instant deployment
  • Less integrated out-of-the-box features, especially for real-time functionality
  • Steeper learning curve for developers new to backend-as-a-service platforms

Code Comparison

Parse Server:

const express = require('express');
const ParseServer = require('parse-server').ParseServer;
const app = express();
const api = new ParseServer({
  databaseURI: 'mongodb://localhost:27017/dev',
  appId: 'myAppId',
  masterKey: 'myMasterKey',
  serverURL: 'http://localhost:1337/parse'
});
app.use('/parse', api);

Supabase:

import { createClient } from '@supabase/supabase-js';

const supabase = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');

const { data, error } = await supabase
  .from('your_table')
  .select('*');

The Parse Server code shows the setup of an Express server with Parse, while the Supabase code demonstrates the simplicity of creating a client and querying data. Supabase offers a more streamlined approach, while Parse Server provides more granular control over server configuration.

Blazing fast, instant realtime GraphQL APIs on your DB with fine grained access control, also trigger webhooks on database events.

Pros of GraphQL Engine

  • More mature and battle-tested in production environments
  • Supports multiple databases (PostgreSQL, MS SQL Server, BigQuery)
  • Advanced authorization and access control features

Cons of GraphQL Engine

  • Steeper learning curve, especially for complex setups
  • Less comprehensive out-of-the-box features compared to Supabase
  • Requires more configuration and setup for full functionality

Code Comparison

GraphQL Engine query:

query {
  users(where: {is_active: {_eq: true}}) {
    id
    name
    email
  }
}

Supabase query:

const { data, error } = await supabase
  .from('users')
  .select('id, name, email')
  .eq('is_active', true)

Both projects aim to simplify backend development, but they take different approaches. GraphQL Engine focuses on providing a powerful GraphQL API layer over existing databases, while Supabase offers a more comprehensive suite of tools including authentication, storage, and real-time subscriptions.

GraphQL Engine excels in scenarios requiring complex data relationships and fine-grained access control. It's particularly suitable for large-scale applications with diverse data sources.

Supabase, on the other hand, provides a more streamlined developer experience with its Firebase-like approach. It's ideal for rapid prototyping and projects that benefit from its integrated services.

Ultimately, the choice between these two depends on specific project requirements, team expertise, and desired development workflow.

43,567

Your backend, minus the hassle.

Pros of Appwrite

  • More flexible deployment options, including self-hosting on various platforms
  • Broader range of built-in features, including user authentication and storage
  • Extensive documentation and community-driven development

Cons of Appwrite

  • Steeper learning curve due to more complex architecture
  • Less focus on real-time capabilities compared to Supabase
  • Smaller community and ecosystem than Supabase

Code Comparison

Appwrite (User Authentication):

import { Appwrite } from 'appwrite';

const appwrite = new Appwrite();
appwrite.setEndpoint('https://[HOSTNAME_OR_IP]/v1');
appwrite.setProject('5df5acd0d48c2');

const account = appwrite.account;
account.create('email@example.com', 'password', 'Jane Doe')
    .then(response => console.log(response), error => console.log(error));

Supabase (User Authentication):

import { createClient } from '@supabase/supabase-js';

const supabase = createClient('https://your-project.supabase.co', 'your-anon-key');

const { user, error } = await supabase.auth.signUp({
  email: 'example@email.com',
  password: 'example-password',
});

Both Appwrite and Supabase offer powerful backend-as-a-service solutions, but they cater to slightly different needs. Appwrite provides more flexibility and features out-of-the-box, while Supabase focuses on simplicity and real-time capabilities. The choice between them depends on specific project requirements and developer preferences.

62,681

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.

Pros of Strapi

  • More flexible content modeling with custom content types and fields
  • Stronger focus on content management and editorial workflows
  • Better suited for headless CMS use cases with multiple frontend applications

Cons of Strapi

  • Requires more setup and configuration compared to Supabase's instant database
  • Less built-in real-time capabilities and database features
  • Steeper learning curve for developers new to Node.js and REST APIs

Code Comparison

Strapi API route example:

module.exports = {
  async find(ctx) {
    const entries = await strapi.services.article.find(ctx.query);
    return entries;
  },
};

Supabase query example:

const { data, error } = await supabase
  .from('articles')
  .select('*')
  .order('created_at', { ascending: false });

While both Strapi and Supabase offer powerful backend solutions, they cater to different use cases. Strapi excels as a headless CMS with robust content management features, while Supabase provides a more streamlined database and real-time API solution. The choice between them depends on project requirements, team expertise, and desired level of customization.

27,065

The Modern Data Stack 🐰 — Directus is an instant REST+GraphQL API and intuitive no-code data collaboration app for any SQL database.

Pros of Directus

  • More flexible data modeling with custom fields and relationships
  • Extensive built-in content management features
  • Self-hosted option for complete control over data and infrastructure

Cons of Directus

  • Steeper learning curve for developers
  • Less focus on real-time capabilities compared to Supabase
  • Smaller community and ecosystem

Code Comparison

Directus API request:

const response = await axios.get('https://api.directus.io/items/articles', {
  headers: { Authorization: 'Bearer YOUR_TOKEN' }
});

Supabase API request:

const { data, error } = await supabase
  .from('articles')
  .select('*');

Both Directus and Supabase are powerful open-source platforms for building data-driven applications. Directus excels in content management and flexibility, while Supabase offers a more developer-friendly experience with real-time capabilities and a PostgreSQL backend. The choice between them depends on specific project requirements, such as the need for advanced CMS features or real-time data synchronization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Supabase

Supabase is an open source Firebase alternative. We're building the features of Firebase using enterprise-grade open source tools.

  • Hosted Postgres Database. Docs
  • Authentication and Authorization. Docs
  • Auto-generated APIs.
  • Functions.
    • Database Functions. Docs
    • Edge Functions Docs
  • File Storage. Docs
  • AI + Vector/Embeddings Toolkit. Docs
  • Dashboard

Supabase Dashboard

Watch "releases" of this repo to get notified of major updates.

Watch this repo

Documentation

For full documentation, visit supabase.com/docs

To see how to Contribute, visit Getting Started

Community & Support

  • Community Forum. Best for: help with building, discussion about database best practices.
  • GitHub Issues. Best for: bugs and errors you encounter using Supabase.
  • Email Support. Best for: problems with your database or infrastructure.
  • Discord. Best for: sharing your applications and hanging out with the community.

How it works

Supabase is a combination of open source tools. We’re building the features of Firebase using enterprise-grade, open source products. If the tools and communities exist, with an MIT, Apache 2, or equivalent open license, we will use and support that tool. If the tool doesn't exist, we build and open source it ourselves. Supabase is not a 1-to-1 mapping of Firebase. Our aim is to give developers a Firebase-like developer experience using open source tools.

Architecture

Supabase is a hosted platform. You can sign up and start using Supabase without installing anything. You can also self-host and develop locally.

Architecture

  • Postgres is an object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
  • Realtime is an Elixir server that allows you to listen to PostgreSQL inserts, updates, and deletes using websockets. Realtime polls Postgres' built-in replication functionality for database changes, converts changes to JSON, then broadcasts the JSON over websockets to authorized clients.
  • PostgREST is a web server that turns your PostgreSQL database directly into a RESTful API
  • GoTrue is a JWT based API for managing users and issuing JWT tokens.
  • Storage provides a RESTful interface for managing Files stored in S3, using Postgres to manage permissions.
  • pg_graphql a PostgreSQL extension that exposes a GraphQL API
  • postgres-meta is a RESTful API for managing your Postgres, allowing you to fetch tables, add roles, and run queries, etc.
  • Kong is a cloud-native API gateway.

Client libraries

Our approach for client libraries is modular. Each sub-library is a standalone implementation for a single external system. This is one of the ways we support existing tools.

Language Client Feature-Clients (bundled in Supabase client)
Supabase PostgREST GoTrue Realtime Storage Functions
⚡️ Official ⚡️
JavaScript (TypeScript) supabase-js postgrest-js gotrue-js realtime-js storage-js functions-js
Flutter supabase-flutter postgrest-dart gotrue-dart realtime-dart storage-dart functions-dart
Swift supabase-swift postgrest-swift auth-swift realtime-swift storage-swift functions-swift
Python supabase-py postgrest-py gotrue-py realtime-py storage-py functions-py
💚 Community 💚
C# supabase-csharp postgrest-csharp gotrue-csharp realtime-csharp storage-csharp functions-csharp
Go - postgrest-go gotrue-go - storage-go functions-go
Java - - gotrue-java - storage-java -
Kotlin supabase-kt postgrest-kt gotrue-kt realtime-kt storage-kt functions-kt
Ruby supabase-rb postgrest-rb - - - -
Rust - postgrest-rs - - - -
Godot Engine (GDScript) supabase-gdscript postgrest-gdscript gotrue-gdscript realtime-gdscript storage-gdscript functions-gdscript

Badges

Made with Supabase

[![Made with Supabase](https://supabase.com/badge-made-with-supabase.svg)](https://supabase.com)
<a href="https://supabase.com">
  <img
    width="168"
    height="30"
    src="https://supabase.com/badge-made-with-supabase.svg"
    alt="Made with Supabase"
  />
</a>

Made with Supabase (dark)

[![Made with Supabase](https://supabase.com/badge-made-with-supabase-dark.svg)](https://supabase.com)
<a href="https://supabase.com">
  <img
    width="168"
    height="30"
    src="https://supabase.com/badge-made-with-supabase-dark.svg"
    alt="Made with Supabase"
  />
</a>

Translations

NPM DownloadsLast 30 Days