Skip to content

betaflag/react-push-notification-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a simple Push Notification demo using NodeJS and React

Server

The server uses Express and web-push libraries.

To configure the server, you need to run npx web-push generate-vapid-keys and add the keys to /server/.env.local.

VAPID_PUBLIC=<vapid public key>
VAPID_PRIVATE=<vapid private key>

Note: The server saves the browser subscriptions in memory based on a very naive identification process. While it makes this demo simpler, it's not suitable for a real application.

Running the server

cd server
npm install
npm start

Client

The client demonstrate how to receive push notification in a Create-React-App application.

cd client
npm install
npm start

About

A simple push server and client demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published