Meeds-io / MIPs

The Meeds Improvement Proposal repository
0 stars 0 forks source link

PWA feature v1 #134

Open srenault-meeds opened 1 month ago

srenault-meeds commented 1 month ago

Rationale

Meeds Hubs can be accessed using mobile browser. Fully responsive, the platform provides a mobile experience to its users.

However, end-users and market request to get an app to:

Providing a native app came as a reference for a long time to reach these output. Yet, it requires:

Progressive Web Apps (PWA) has emerged the last few years and it has been improved a lot to answer these concerns without losing native apps advantages:

Based on different reading, including this one

1. Functional Requirements

Top User Stories

#### Installing the app from a browser access ❓ Why?

This is one of the key option provided by PWA. It eases the process for users to add the app without looking for it. And product teams like it as it eases the process to reach users.

You share a link somewhere on the web The user clicks to it, starts using it He is invited to install the app He receives notifications and maybe he will come back see the product again

πŸ’‘ What?

When accessing the platform, and once logged in, suggest to install the app notif to install app

Option still possible from the browser settings if needed install app from settings

Same option can be proposed using desktop browser

image

Once installed, it is listed on the device as any other app App on device

From the user settings, a user can scan a QR code from his user settings. Doing it install the app directly

#### Branding ❓ Why?

Theme, colors, logo, tagline can be added by administrators to make the platform identifiable for its community and users It is highly expected by community leader to inheritate these items when installing the app Users can also easily recognize their platform thanks to this

πŸ’‘ What?

App on device

#### Notifications ❓ Why?

πŸ’‘ What? -A new channel for notification is created to enable users to set their preferences "Mobile Notifications" browser notif pref

🧐 Questions

We need to make sure notifications can be received even when the platform is provided in a secured and internal network (not public web) Precision: no use of google services like firebase is a must-have

#### User experience / Access to the platform ❓ Why?

πŸ’‘ What?

More information here

Impacts

Gamification

NA

Notifications

Analytics

Unified Search

NA

2. Technical Requirements

Expected Volume & Performance

The browser caches storage will be used to offer offline feature. Thus a browser caches consumption has to be monitored and cleaned when possible in order to decrease storage consumption. The Browser navigation performances shouldn't be affected by PWA apps and offline feature, thus the service worker isn't expected to be used in a browser mode.

Security

N/A

Extensibility

The Manifest has to be dynamic and should inherit its properties from Branding Options and Public site as made on Deed Hub Card characteristics synchronization. Each DAO Member has to be able to define its own Manifest by extension.

Configurability

Property Name Default Value Functional Behaviour
pwa.backgroundSynchronization.period 60 seconds A property has to be possible to set in order to allow chossing PWA Background Synchronization periodicity, value in seconds

Upgradability

N/A

Existing Features

The existing features shouldn't be affected by the PWA feature which will allow to install applications in multiple type of devices without changing existing features.

Feature Flags

Property Name Default Value Target Audience Functional Behaviour
pwa true ALL This flag will allow to enabled/disable PWA features. Use full especially to test the feature on production

Other Non Functional Requirements

The portlets rendering has to change to use REST Endpoint in order to allow easily to handle offline mode of applications. This endpoint has to be available in each portlet Web Application.

3. Software Architecture

Knowing that this new feature will rely on previously existing feature, wome change will be brought again into product from previous commits:

Security

N/A

Access

The offline mode has to be offered in applications by the new Page Layout Framework design and not application by application. Thus the fetch API will be polyfilled in order to add more features about background synchronization and periodic updates. A service worker has to be added in order to manage all types of content:

Services & processing

The web notification channel or push notifications from Notification Service (will depend on Needed Fucntional Behavior) may be used in order to periodically retrieve the notifications to display in Application Badge (exactly same as Web Notif Badge by example) and the push/desktop notification content (same Image and content as the web notification by example). The same REST endpoint of Web notifications can be used this way to ensure the Background synchronization, even when the application isn't running.

Data and persistence

N/A

Clustering

N/A

Multitenancy

N/A

Integrations

N/A

Migration strategy

N/A

5. Annexes

rdenarie commented 1 month ago

Hello If we add a new channel for "Browser notifications", what about "Push Notifications" channel ? Should we remove it ? keep it ? If we keep it, in which case it will be used ? As I understand, even you install from the playstore, you install the PWA, right ? So you will have "browser notifications".

If we remove "Push notif", for "Browser notif", it seems to be a simple "replacement", right ?

srenault-meeds commented 1 month ago

Yes indeed, this has to be studied. I didn't add any reference to push notif as we don't provide it with Meeds. Still, it is a good question

rdenarie commented 1 month ago

I see 2 options :

You're right, to study

srenault-meeds commented 1 week ago

Will be worked later for now:

#### Usage of service worker ❓ Why?

πŸ’‘ What?

#### Installing the app from a store ❓ Why?

πŸ’‘ What?

Informations here

🧐 Questions If using different hubs, then how to manage it? Suggested answer for now:

srenault-meeds commented 1 week ago

@margondicco to check please :)

margondicco commented 1 week ago

Hello ok for me

boubaker commented 1 day ago

IMO, no need to remove existing "Push Notifications" channel, we can replace it to be used even in Mobile App. We may need to support both type of notifications for a while until we replace completely the old Mobile Push Notifications with PWA Push Notifications coupled with Background Synchronization API

boubaker commented 1 day ago

For the record and a possible code copying, the previous PRs to introduce PWA with its Manifest file and Service wokers on 6.1:

Which was removed progressively in 6.5 since the feature wasn't enabled since a while.

Those PRs allow to have an offline feature and installable app but not all of allowed features in PWA (See below for features overview)

Image

boubaker commented 35 minutes ago

Ready for tech review by DAO Members (eXo: @rdenarie )