Supabase Realtime Chat
supabase/supabase ↗ ·★ 107.2k ·TypeScript ·Apache-2.0
Realtime chat pattern built from Supabase's Postgres, Auth and Realtime platform rather than a standalone maintained demo repository.
Overview
Supabase Realtime Chat is best read as a deployment pattern rather than a dedicated standalone repository. The tracked repo is the main Supabase monorepo, whose README describes Supabase as a Postgres development platform with Auth, generated APIs, Realtime subscriptions, Functions, Storage and client libraries. A chat app is one practical way to use those pieces together.
The example is also a clear lesson in doing direct-to-database frontends safely. Because the React client connects to Supabase with a public anon key, Row Level Security policies are what actually decide who can read and write each row. Studying how the policies are written here is the best way to understand the Supabase security model before you apply it to a real app, where getting RLS right is non-negotiable.
Architecturally there is no custom server to deploy for the basic pattern. Supabase hosts the database, authentication, APIs and realtime layer, and your frontend can be a static React build. That means you ship the UI to a free static host such as Netlify or Cloudflare Pages and point it at your Supabase project. Use the official Supabase docs and examples for exact SQL and policy details.
Highlights
- ✓ Live messages via Supabase Realtime over Postgres changes
- ✓ Row Level Security so users only access what they're allowed to
- ✓ Supabase Auth, REST/GraphQL APIs and client libraries documented in the main repo
- ✓ Use as a pattern for a static frontend, not as a dedicated maintained chat starter
Best for
- →Learning the Supabase Realtime + RLS pattern
- →Adding live chat or presence to an existing app
- →Demos that need a managed backend without running a server
Getting started
- 1 Create a Supabase project and model a messages table in Postgres
- 2 Enable Realtime subscriptions on that table and write strict RLS policies
- 3 Use the Supabase JavaScript client with your project URL and anon key
- 4 Deploy your static frontend to Netlify, Cloudflare Pages or another static host
FAQ
Supabase Realtime streams Postgres row changes to subscribed clients over WebSockets. When a row is inserted into the messages table, every connected client receives it instantly — no polling.
Because the frontend talks to Supabase directly with a public anon key, RLS policies are what enforce who can read and write rows. They are the real security boundary, not the client code.
No custom backend is required for the basic pattern. Supabase hosts Postgres, Auth, APIs and Realtime; your frontend can be a static app pointed at your Supabase project.
Deployment guides
Deploy Supabase Realtime Chat for free
Free-tier platforms that can host this project. Pick one and ship it.