Skip to content

About

PWA sharing example

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

logo

PWA sharing exmaple

https://pwa-sharing.pages.dev

Features

  • Install to web app How
    • Fake install prompt
    • Rich install
  • Install & update service worker How
    • No page active enter website automatic reload to install & active new service worker
    • Have active page, every 10sec detect update & show update banner click to update
    • Unregister servic worker
    • Parallel precache files
  • Notifiaction How
    • Catch notification by service worker
    • Click notification to open web app or website in browser
    • Click notification redirect to /home page
    • Can update installed app unreadCount
    • Unsubscribe notification

Quick start

  • Install dependencies

    prepare will trigger after install finish, create vapid for notification service

    npm install
  • Generate https certs (PWA requirement)

    gen:cert will create certs under /cert folder

    npm run install:mkcert
    npm run gen:cert
  • Run website on localhost
    npm run dev
  • Another terminal Run service

    notification server, allow user subscribe & send notification

    npm run dev:server
  • Open website on https://localhost:5173 (default, might change)

    notification service will run on https://localhost:8080

Auto update service worker

Simulate Production

  • build website & using hono as web server & notification server
    npm run preview
  • Open website on https://localhost:8080
  • Another terminal Update client code & rebuild website to simulate production update service worker
    npm run build:dev

Generate icons

Explain

How to make website installable

How to install and update sw

How to implement notification

About

PWA sharing example

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages