← Winnitude! Search  ·  Reader Mode (1242 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 79 LINKS

GitHub - supabase/multiplayer.dev

Repository navigation

multiplayer.dev
Public

About

multiplayer.dev

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy Activity Custom properties

Stars

15 stars

Watchers

1 watching

Forks

5 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


90 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
app app    
components components    
hooks hooks    
lib lib    
.env.example .env.example    
.gitignore .gitignore    
README.md README.md    
components.json components.json    
eslint.config.mjs eslint.config.mjs    
middleware.ts middleware.ts    
migrate.sql migrate.sql    
next.config.ts next.config.ts    
package-lock.json package-lock.json    
package.json package.json    
postcss.config.mjs postcss.config.mjs    
profile.json profile.json    
tsconfig.json tsconfig.json    

Repository files navigation

multiplayer.dev

The open source demo app for Supabase Realtime . Open multiplayer.dev in a few browser tabs to see other visitors' cursors, who is online, and a shared chat, all delivered over Realtime.

What this demo shows

  • Presence - the avatar stack in the top corner shows who is currently online. Realtime tracks each connection and notifies everyone else when someone joins or leaves, even if they drop unexpectedly.
  • Broadcast - cursor positions and emoji reactions are sent as short-lived Broadcast messages that fan out to everyone in the room without being stored in the database.
  • Broadcast from Database - chat messages are inserted into a Postgres table, and a trigger calls realtime.send to broadcast each one to the room. See migrate.sql and the Broadcast from Database docs .
  • Broadcast Replay - the chat channel is private and asks Realtime to replay recent messages, so you see recent history when you join or reconnect. Replayed messages are shown dimmed.
  • Authorization - private channels are checked against Row Level Security policies on realtime.messages. See the Realtime Authorization docs .

Getting started

  1. Create a Supabase project and run migrate.sql in the SQL editor to set up the chat table, trigger, and policies.

  2. Copy .env.example to .env.local and fill in your project URL and API key (find them in your project's API settings).

  3. Install dependencies and start the dev server:

    npm install
    npm run dev

Learn more

About

multiplayer.dev

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy Activity Custom properties

Stars

15 stars

Watchers

1 watching

Forks

5 forks Report repository

Sponsor this project

Used by

Contributors

Languages