internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.19k stars 1.35k forks source link

Progressive Web App (PWA): Enabling offline functionalties and push notification #4257

Open codetochangeMinds opened 3 years ago

codetochangeMinds commented 3 years ago

Describe the problem that you'd like solved

Currently OL does not have support for offline functionalities. There needs a brainstorming about the features that needs to be supported while the user is offline. Customized push notifications are a great way to interact with the users actively and they definitely enhance user experience. The feature of push notification needs to be enabled in order to improve on the engagement with the mobile user of Open Library.

Proposal & Constraints

The proposed solution is to enable service worker and use workbox library to support offline functionalities. For push messaging we can make use of push api which can help to interact effectively with OL mobile users. The push notification can add value to user experience if done in right way and not just spam user! for e.g we can notify the user as soon as the book is available for lending. PWA has many success stories.

First we need to talk to OL mobile users and extract the requirements about the offline functionalties and push notifications. Once requirements are extracted we need to brainstorm and look like how we can support these features. Workbox, service worker api, notification api and push api can be used to implement the above listed features.

Subtasks

Stakeholders

@Yashs911

jdlrobson commented 3 years ago

@mekarpeles I'll be honest with you - offline sounds overly ambitious for 2021 IMO and very risky for future maintenance.

FWIW we have been trying to do this on Wikipedia since 2016 where we suffer from similar legacy issues with our frontend and backend and are nowhere near there with many more staff and contributors.

If you are using service workers your frontend really should be solid and we are a long way from there. We also need to be able to render pages in JS, which we have no way to do - this would potentially require a complete rearchitecture of the Open Library template system.

To work towards this I'd recommend the following steps in the right direction:

1) to move all our inline scripts into webpack #4485 2) Reducing the amount of dependencies 3) Porting code to a modern framework like Vue

Customized push notifications are a great way to interact with the users actively and they definitely enhance user experience.

"definitely" needs qualifying here. My understanding is that web push notification rollout has had a lot of problems due to bad web patterns giving them a bad name - such as the classic "allow me to send notifications" on page load notification and malware spamming. I just want to note there's also a fair bit of backend work needed here too. Perhaps a 6-month project in itself. We've recently rolled out push notifications for our Wikipedia app to explore demand from our users. Is there a prototype that could be done to experiment in the OpenLibrary/ Internet Archive ecosystem?

cdrini commented 3 years ago

Notes from a chate with Mek on PWAs: