Progressive web apps are mobile websites that are built using web technology, but it acts and looks like a mobile application. Recent improvements to the browser and the availability of service workers, as well as the Cache and Push APIs, have allowed web developers to allow users to install web applications on their home screen, receive push notifications, and even work offline.
Why use PWA?
Add Home screen icon to load the app fullscreen
Manages cache
App loads quicker
Ability to access with an inconsistent network connection.
Send push notifications
Periodic sync – Use the app offline and let it continue with the process when able to acquire a connection
Developing a basic PWA
*Progressive Web Apps must be served from a secure origin (https).
Select the type of service worker functionality for the app
Add the “Code for the website” at the bottom of the index file. This will register the service worker.
Create a js file in the root and replace ‘pwabuilder-sw.js’ with the name of the created file.
Add the “Service worker code” to the newly created js file.
You can test your service worker. (Chrome inspect → Application). Under application, you can find a tab name service worker.
Also, tick the Offline checkbox and you will be able to navigate through the site. (This will vary on your caching definition in service worker js file).
Here’s a lighthouse generated report on your mini-project of progressive web apps.