Frappe

Cloud

Marketplace

PWA Frappe

Frappe

Products

Insights

PWA Frappe
PWA for enabling your applications to be installed and run as native-like apps on both desktop and mobile devices. ๐Ÿš€

Publisher

Md Omar Faruk

Supported versions

Version 16, Version 15

Categories

Free
Utility

E-Commerce

About

๐ŸŒ PWA Frappe

Progressive Web App (PWA) implementation for the Frappe Framework, enabling your applications to be installed and run as native-like apps on both desktop and mobile devices. ๐Ÿš€


โœจ Features

  • โšก Progressive Web App Support โ€” Turn your Frappe site into an installable PWA

  • ๐Ÿ“ฑ Cross-Platform Installation โ€” Works on iOS, Android, and Chrome Desktop

  • ๐Ÿ”” FCM Push Notifications โ€” Firebase Cloud Messaging for desk Notification Log alerts (mentions, assignments, shares, energy points)

  • ๐Ÿ’พ Offline-First Architecture โ€” Smart caching via Service Worker

  • ๐ŸŽจ Customizable Manifest โ€” Icons, colors, display modes & screenshots

  • ๐Ÿงฉ Easy Configuration โ€” Manage everything from simple Frappe DocTypes


โš™๏ธ Configuration

1๏ธโƒฃ Web App Manifest Setup

Go to Web App Manifest in your Frappe Desk and configure:

  • ๐Ÿท๏ธ App Name โ€” Full name of your app

  • ๐Ÿ”ค Short Name โ€” Short display name

  • ๐ŸŽจ Theme & Background Colors

  • ๐Ÿงญ Display Mode โ€” fullscreenstandaloneminimal-ui, or browser

  • ๐Ÿ–ผ๏ธ Icons โ€” Upload in multiple sizes (192x192, 512x512 recommended)

  • ๐Ÿ“ธ Screenshots & Categories โ€” For app store appearance

2๏ธโƒฃ Auto PWA Configuration

Click "Automatically configure PWA" to:

  • โœ… Add manifest link to Website Settings

  • โœ… Enable PWA features automatically

  • โœ… Optionally enable Desk Mode support

3๏ธโƒฃ Service Worker Setup (Optional)

Visit Service Worker doctype to:

  • ๐Ÿ”‘ Generate VAPID keys for classic Web Push

  • โš™๏ธ Configure caching and update policies

4๏ธโƒฃ FCM Push Notifications

Every logged-in desk user gets a browser push notification whenever a Notification Log entry is created for them (mentions, assignments, shares, energy points, alerts) โ€” no changes needed on the Frappe/ERPNext side, this hooks into the core Notification Log doctype. Nothing for end users to click or configure: it enables itself silently on their next desk login, once an admin has set it up (below).

A. Admin setup (one-time, per site)

  1. Log in to your site's Desk as a System Manager (e.g. Administrator).

  2. Create a Firebase project and enable Cloud Messaging.

  3. Under Project Settings โ†’ Cloud Messaging โ†’ Web configuration, generate a Web Push certificate (VAPID key pair) and copy the public key.

  4. Under Project Settings โ†’ General, copy the Web app config (apiKeyauthDomainprojectIdstorageBucketmessagingSenderIdappId).

  5. Under Project Settings โ†’ Service accounts, generate a new private key (downloads a JSON file) โ€” this is used server-side to send messages via the FCM HTTP v1 API.

In your Frappe Desk, open the Service Worker doctype and fill in the Firebase Cloud Messaging (FCM) section:

  • โœ… Enable FCM Push Notifications

  • ๐Ÿ”‘ FCM VAPID Public Key โ€” from step 3

  • โš™๏ธ FCM Web Config (JSON) โ€” from step 4

  • ๐Ÿ”’ FCM Service Account JSON โ€” paste the full contents of the file from step 5 (stored encrypted, never shown again in plain text)

  • Click Save.

That's it โ€” no further admin action needed. Every desk user (including the admin) will pick this up automatically on their next login.

B. What end users see

Nothing to configure. On their next desk load, the browser will silently register for push and โ€” the first time only โ€” show the browser's native "Allow notifications?" permission prompt. Once Allow is clicked, they're subscribed for good; nothing changes for them if they click nothing or dismiss it (they simply won't get push notifications until they allow it, which they can also do later from the browser's own site-permissions UI).

A successful subscription creates a record in FCM User Token, one per user per browser/device:

Tokens FCM reports as unregistered (e.g. browser data cleared, uninstalled) are pruned automatically the next time a push is attempted.

๐Ÿ’ก Usage

๐Ÿ–ฅ๏ธ Desktop (Chrome/Edge)

  1. Visit your site

  2. Click the Install icon in the address bar or select Install [App Name]

๐Ÿ“ฑ Android

  1. Open your site in Chrome

  2. Tap Add to Home Screen when prompted

๐ŸŽ iOS (Safari)

  1. Open your site in Safari

  2. Tap Share โ†’ Add to Home Screen โ†’ Add

Visit /install for a full installation guide.


๐Ÿงฑ Technical Details

๐Ÿ“ Directory Structure

pwa_frappe/
โ”œโ”€โ”€ pwa_frappe/
โ”‚   โ”œโ”€โ”€ doctype/
โ”‚   โ”‚   โ”œโ”€โ”€ service_worker/           # Service Worker + FCM config
โ”‚   โ”‚   โ”œโ”€โ”€ fcm_user_token/           # Per-user FCM tokens
โ”‚   โ”‚   โ””โ”€โ”€ web_app_manifest/         # Manifest settings
โ”‚   โ”œโ”€โ”€ fcm.py                        # FCM subscribe/unsubscribe + Notification Log push
โ”‚   โ”œโ”€โ”€ public/js/
โ”‚   โ”‚   โ”œโ”€โ”€ pwa_frappe.js             # Desk manifest injection
โ”‚   โ”‚   โ””โ”€โ”€ fcm.js                    # Desk FCM registration & foreground messages
โ”‚   โ””โ”€โ”€ www/
โ”‚       โ”œโ”€โ”€ app.html                  # PWA-enabled Desk template
โ”‚       โ”œโ”€โ”€ manifest.json             # Dynamic manifest endpoint
โ”‚       โ”œโ”€โ”€ sw.js                     # Service Worker script (+ FCM background messages)
โ”‚       โ”œโ”€โ”€ pwa.js                    # Client-side PWA logic
โ”‚       โ””โ”€โ”€ install.html              # Installation instructions

๐Ÿง  Service Worker Caching

Caches:

  • Static assets (CSS, JS, images)

  • Frappe core resources

  • Custom app assets defined in hooks

Old caches are auto-cleared upon activation ๐Ÿ”

๐Ÿ“„ DocTypes

  1. Web App Manifest โ€” Main configuration

  2. Manifest Icon / Screenshot / Category / Related App โ€” Child tables

  3. Service Worker โ€” Caching & FCM notifications config

  4. FCM User Token โ€” Registered browser push tokens per user

๐Ÿงน Code Quality

  • ๐Ÿ Ruff โ€” Python linting

  • ๐Ÿ’… Prettier โ€” Code formatting

  • ๐Ÿงญ ESLint โ€” JavaScript linting


๐ŸŒ Browser Support

โœ… Chrome (Desktop & Mobile) โœ… Safari (iOS 11.3+)


โš ๏ธ Limitations

  • ๐Ÿ”” FCM push notifications currently cover the desk Notification Log doctype only (no portal/website push yet)

  • ๐Ÿ”’ HTTPS required for PWA features

  • ๐ŸŽ Limited iOS PWA support (and no push notifications on iOS Safari)


๐Ÿงฐ Troubleshooting

โŒ PWA not installing?

  • Ensure HTTPS is enabled

  • Verify /manifest.json is reachable

  • Check Service Worker registration in DevTools

๐Ÿ” Service Worker not updating?

  • Hard refresh (Ctrl+Shift+R)

  • Clear site data

  • Update cache version


๐Ÿค Contributing

  1. Fork this repo

  2. Create a feature branch

  3. Run pre-commit checks

  4. Submit a PR ๐Ÿงก


๐Ÿ“œ License

MIT License โ€” see license.txt


๐Ÿ™Œ Credits

Originally developed by Md Omar Faruk Maintained by the Frappe Community


๐Ÿงญ Support

User Reviews

No reviews yet, be the first to review.

0.0

0 rating

Rate and share your experience

Text

Explore more apps