Skip to content

A chat room example built on Pusher for real-time messaging

Notifications You must be signed in to change notification settings

fire015/pusher-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pusher Chat

A chat room example built on Pusher for real-time messaging.

Uses presence channels to allow multiple users to chat at the same time and client events to communicate directly without a middle-man server running (except for auth).

Built on Node.js for the backend and React for the frontend.

Example chat

Setup

Sign up to Pusher and create a free account.

Enable client events in app settings.

Install

Backend:

cd backend
npm install
cp .env.default .env
nano .env # fill in the Pusher config
npm start

Frontend (run in a seperate tab):

cd frontend
npm install
cp .env .env.local
nano .env.local # fill in the Pusher config
npm run dev

Visit http://localhost:5173/ (open multiple browser tabs to simulate multiple users).

Persistence

If you need to persist messages, add a webhook in Pusher (triggered by client events) and point to the backend server /pusher/webhook endpoint.

Check the lambda folder for an example of an AWS Lambda function that receives messages from a Pusher webhook and stores them in DynamoDB.

About

A chat room example built on Pusher for real-time messaging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published