-
Notifications
You must be signed in to change notification settings - Fork 18
Add PWA using django-pwa #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @burgerga , many thanks for this great PR! The PWA installation worked great so for. Though, without caching, the PWA itself is not unlocking its full potential. Therefore, I've tinkered with offline caching and it seems to work fine so far. May have a look and play with it. In my case, the most important data and filters are properly cached. So offline use of the PWA works fine. Still unsure about cache invalidation. Shall we prune cached data at some time or keep it unlimited? The cache will basically bypass authentication and display the vouchers and giftcards as is. Just creation/modifying would'nt be possible when being offline. |
|
Maybe a manual cache button with a maximum of 72h cache age would be better. Then the user can control when to cache and cached data is pruned automatically at one point. |
|
New release v1.25.0 supports PWA with manually offline caching. Many thanks for the PR. Smooth ride to implement the additional caching for offline use. https://github.com/l4rm4nd/VoucherVault/wiki/04-%E2%80%90-Application-Usage#caching |
|
Woah! I was fine with an online-only PWA, but this is very cool!
|
Will have a look. Personally, I dislike the light mode and one can tell. It needs some proper rework haha.
Yeah the search cannot be cached as it is a server-side search. We could disable it entirely to not confuse people
You identified it correctly. It always tries the network first and then cache. Due to this, it may be that it feels somewhat sluggish. The browser or JS needs to detect that we are offline. Sometimes faster, sometimes slower. Will tinker with it. Guess it needs some more finetuning. |
|
(but I don't think I need vouchervault on my laptop in an offline situation. The offline on my phone is quite useful (quickly caching everything before you go shopping), and there it works perfectly :) ) EDIT: And yes, I also have almost everything in Dark mode :D |
|
By the way, a potential solution for the authentication bypass with caching could be biometric authentication using webauthn which should work offline as well. Then you can just cache everything, and use longer cache times. I don't have experience with this though but came across it while thinking about caching vs authentication. |
Theme switching works again. Light theme unchanged though. No interest atm to make it better haha.
I've played around a bit and improved the logic. Now it seems to work properly. Even if you re-open the PWA being offline.
Passkeys / webauthn would work too but unfortunately the support for Django CMS is limited. I've already opted for the django-mozilla-oidc to support SSO and that's likely it. As offline mode and caching seems to work for now, I'll neglect this idea atm. May upgrade to the latest release. I recommend:
and then try PWA + cache creation another time :) |
Fixes #43
Followed the guide at https://github.com/silviolleite/django-pwa to add PWA support to VoucherVault. I think the changes are fairly minimal:
Tested on my server, seems to work perfectly!


Some screenshots:
Desktop browser:
Android install and app switcher after install:
Hope to hear your thoughts!