Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Replit 8 min read How-to mediumAdept

Making a Real-Time Chat App with Supabase on Replit

A real-time public chat app can be built with a Vue 3 and Tailwind CSS frontend on Replit backed by Supabase's hosted Postgres. The walkthrough creates a messages table via SQL, enables replication-based real-time events, and wraps the supabase-js client in a Vue composable. That composable handles paginated message loading by range, INSERT subscriptions for live updates, and inserts for sending. Users are identified only by a random username stored in localStorage, and older messages load when the list is scrolled to the top.

Assumes: Vue Composition APIJavaScript async/awaitbasic SQL

Related posts

  • Flutter Tutorial: building a Flutter chat app

    Supabase mediumAdept

    A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase_flutter SDK instead of a custom API. The walkthrough creates profiles and messages tables in Postgres with username validation constraints, adds the messages table to the supabase_realtime publication for live updates, initializes the Supabase client, routes users via a splash page based on auth session, and defines Dart data models plus a registration page. Authentication and row-level security are deferred to a second part.

  • Postgres Realtime location sharing with MapLibre

    Supabase mediumAdept

    Live location sharing is built by having a Telegram bot running in a Supabase Edge Function (grammY on Deno) capture edited-location updates and write them to Postgres through a PL/pgSQL RPC. The RPC looks up the user's active session and stores the coordinates as a PostGIS point. A React/Next.js client subscribes to Supabase Realtime postgres_changes INSERT events, filtered by event_id, and renders markers with react-map-gl and MapLibre GL JS over a Protomaps basemap served from Supabase Storage.

  • Realtime: Multiplayer Edition

    Supabase mediumAdept

    Supabase Realtime's Broadcast and Presence features are now generally available, with every feature organized around Channels that also carry Postgres change events. Broadcast is ephemeral pub/sub that bypasses the database, which suits things like cursor positions. Presence syncs shared state to new joiners and drops users automatically when they disconnect. Realtime originally chose logical replication over LISTEN/NOTIFY because NOTIFY payloads are capped at 8,000 bytes. It now runs as a globally distributed Elixir cluster on Fly, using Phoenix PubSub for Broadcast and the delta-CRDT-based Phoenix Tracker for Presence, and supabase-js examples show both features in use.

  • Cal.com launches Expert Marketplace built with Next.js and Supabase.

    Supabase mediumAdept

    Cal.com's open-source Platform Starter Kit for building expert marketplaces runs on Next.js and Supabase, having switched from SQLite to Postgres via Prisma shortly before launch once file storage was needed. Prisma connects through Supavisor using a pooled transaction-mode URL plus a direct session-mode URL, and its multiSchema feature keeps app tables out of the PostgREST-exposed public schema. Profile images upload to Supabase Storage via server-generated signed upload URLs, which works alongside Auth.js rather than Supabase Auth, and a custom Next.js Image loader serves resized images. A Vercel integration syncs environment variables and can provision a project with migrations and seeds in one click.

  • Building a Realtime Trello Board with Supabase and Angular

    Supabase mediumAdept

    A Trello-style board clone built on Supabase, Angular and Tailwind, with boards, lists and cards stored in Postgres tables. Access is secured with Row Level Security policies backed by a security-definer function that returns the current user's boards. Triggers auto-link new boards to their creator and mirror auth users into a public users table, and setting replica identity full lets realtime subscriptions see deleted rows. The Angular side covers magic link sign-in through an RxJS BehaviorSubject auth service, routing, and realtime updates, with full source on GitHub.

The quest for software engineering knowledge.

Look:
Layout: