Ga naar inhoud

Kabisa PWA architecture

General

The application is converted to a PWA web application that can be installed on the user's device.

This means that the following data must be cached during installation: * All Javascript files * All Images * All HTML files

Database

With the exception of user setup choices and some statistics, the data for the application is static data, it does not change during the lifetime of the application.

There is not so much data: the largest table (AssocData contains only ~7000 records. Other tables contain at the most a couple of 100 records.

Therefore it makes sense to convert the data to static JSON structures which are interpreted by the browser.

Images

A large part of the application logic is devoted to selecting images from a list of images. These images were stored in a database. This can be converted to images on disk (i.e. in the browser cache), with additional metadata stored in memory.

Note

since the browser cache can be limited in size and can be cleared/deleted, it can be necessary to store the images in IndexDB nonetheless, to ensure the data is available at all times. This step would then need to be done during installation of the service worker.