This is a simple Push Notification demo using NodeJS and React
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.
cd server
npm install
npm start
The client demonstrate how to receive push notification in a Create-React-App application.
cd client
npm install
npm start