Simple example of PWA made in React
Example Todo app, based on Progressive Web App concept and React framework.
yarn install
.env
file with proper variablesYou need to generate your our VAPID keys. To see how to do it using web-push
library see it's docs.
To add VAPID public key for front-end application, you need to set REACT_APP_VAPID_PUBLIC_KEY
variable. Each variable which should be used in React app, needs to have REACT_APP_
according to Create React App docs.
yarn run start
and go to http://localhost:3000
yarn run build
yarn run start:server
and go to http://localhost:3001
Node server serves static files from /build
directory, so it's possible to test Service Worker here.
yarn run lighthouse <url>
See results in lighthouse-report.html file.