Strategy for Custom PWA Generator, including Playcanvas

I’m currently developing my first offline capable PWA which integrates a PC-project.
It took my a while to wrap my head around the PWA stuff (Service Workers …) but now it works.
As some parts of the development are a bit tedious, I thought about writing my own PWA Generator.
I don’t use any JS/PWA-Frameworks, and usually write small php scripts to automate tasks.
(like creating a lists of files to be cached by the service worker)).
A similar approch is used here:

Here are my initial thoughts on such a workflow, but as I don’t have much experience in Webdevelopment / Deployment maybe you have some feedback / ideas on it or even better workflows:

Local / Serperated PHP Project (PWA-Generator -> pwa-generator/):
Function “Edit PWA” -> Json-Editor für Manifest.json (Theme / Background Color and so on)
Function “Create File-List” -> Read in files under pwa-generator/app/ and update Service Worker Cache list

Function “Update Playcanvas Project”:
Use Rest API -> Download App: Get Download-Url -> Download & unzip Project File
(pwa-generator/app/pc)

Function “Deploy”:
Upload all Files under pwa-generator/app to Live Environment (by SFTP for example)
(app.client-domain.com)

2 Likes

We’ve setup a very similar workflow for a current project. We have a build step that pulls the latest checkpoint from PC, it then runs through the config for any glbs which it compresses with Draco and compresses them. It also creates basis files.from.all the textures and multiple resolutions.

Pwa works well as service workers intercept network fetches

2 Likes

Thanks for the insight. Draco compression is a good tip, I haven’t used it before but seem worth checking out.

1 Like