Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 1.27 KB

pwa.md

File metadata and controls

23 lines (14 loc) · 1.27 KB

back

Progressive Web App (PWA)

The Evento Portal is installable and offers a simple offline page when no internet connection is available. We use the vite-plugin-pwa that builds on Workbox to achieve this. The configuration is in vite.config.ts:

  • We define the Web Manifest with the appropriate colors and icons.
  • The ServiceWorker should pre-cache all necessary assets of the Evento Portal to render the base layout or "shell" (index.html, logo, icons and JavaScript files) but not the apps' files in public/apps.
  • When building the application with npm run build, the ServiceWorker is generated to dist/sw.js, containing the file paths to pre-cache.

Testing with ServiceWorker

To test the Evento Portal with the ServiceWorker locally, you have to serve the app with a valid SSL certificate using the following command (with browserstack as oAuthClientId in public/settings.js):

npm run preview:ssl

The application is served under https://bs-local.com:3000.

Offline Page

When no Internet connection is available (!navigator.onLine), the <bkd-content> component is rendering an offline message instead of the app's content.