The PWA ticket JavaScript architecture
Similar to the Podstr application, the PWA ticket app utilizes a combination of third-party libraries and application-specific JavaScript.
The following screenshot shows how the JavaScript files are organized in the source code:

The custom service worker logic or workflow utilizes different libraries to render content on the client. The two third-party libraries are localForage
for IndexedDB
interactions and Mustache
to render markup.
localForage
(https://localforage.github.io/localForage/) is another IndexedDB
wrapper. It provides a simple interface that mimics localStorage
. The main difference is that localForage
supports promises, making it asynchronous.
There are three polyfils
, and these are Object.assign
, Promise
, and Fetch
.
Each page uses a few application-specific libraries: api
and push-mgr
, and common application modules. Each page has a page-specific script to drive the user experience.
The application module handles the common UI components, which...