For example, can I create a PWA under example.com/todo-app
, another one under example.com/time-tracking-app
, and have each as a completely separate app that can be "installed" with a different icon on the home screen, have its own separate notifications, etc.?
There is no requirement for a PWA to be a SPA. In fact, many pages like news sites or web shops are much better suited as multi page applications. When building a multi page PWA, be sure to: Load the ServiceWorker with a scope that covers the entire site.
PWAs run in browsers, like websites. But PWAs also have access to app features; for example: A PWA can still work when the device is offline. PWAs can be installed on the operating system.
You can do it if each separate PWA has:
navigator.serviceWorker.register('/sw.js', {scope: './todo-app/'})
and navigator.serviceWorker.register('/sw.js', {scope: './time-tracking-app/'})
In general I'd advise against doing this because if you make any mistakes later on with scopes you'll have issues that will be very hard to debug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With