Pwa Frappe

A 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. ๐Ÿš€

Install Pwa Frappe

bench get-app https://github.com/omfsakib/pwa_frappe

Add the Frappe Gems badge to your README

Maintain Pwa Frappe? Paste this into your README:

[![Listed on Frappe Gems](https://frappegems.com/api/method/frappe_gems.seo.badge?app=omfsakib%2Fpwa_frappe)](https://frappegems.com/gems/apps/omfsakib/pwa_frappe)

About Pwa Frappe

๐ŸŒ PWA Frappe

A 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
  • ๐Ÿ”” Push Notifications โ€” VAPID-based notifications (๐Ÿ“ฆ Coming Soon!)
  • ๐Ÿ’พ Offline-First Architecture โ€” Smart caching via Service Worker
  • ๐ŸŽจ Customizable Manifest โ€” Icons, colors, display modes & screenshots
  • ๐Ÿงฉ Easy Configuration โ€” Manage everything from simple Frappe DocTypes

๐Ÿงฐ Installation

Use bench to install the app:

cd $PATH_TO_YOUR_BENCH
bench get-app https://github.com/omfsakib/pwa_frappe --branch main
bench install-app pwa_frappe

โš™๏ธ 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 โ€” fullscreen, standalone, minimal-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 (coming soon) - โš™๏ธ Configure caching and update policies


๐Ÿ’ก 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 config
โ”‚   โ”‚   โ””โ”€โ”€ web_app_manifest/         # Manifest settings
โ”‚   โ””โ”€โ”€ www/
โ”‚       โ”œโ”€โ”€ app.html                  # PWA-enabled Desk template
โ”‚       โ”œโ”€โ”€ manifest.json             # Dynamic manifest endpoint
โ”‚       โ”œโ”€โ”€ sw.js                     # Service Worker script
โ”‚       โ”œโ”€โ”€ 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 & notifications config

๐Ÿง‘โ€๐Ÿ’ป Development

๐Ÿ”ง Prerequisites

cd apps/pwa_frappe
pre-commit install

๐Ÿงน Code Quality

  • ๐Ÿ Ruff โ€” Python linting
  • ๐Ÿ’… Prettier โ€” Code formatting
  • ๐Ÿงญ ESLint โ€” JavaScript linting

๐Ÿงช Testing

bench --site [site-name] run-tests --app pwa_frappe

๐Ÿงฉ Customization

๐Ÿ”— Hooks Integration

In your hooks.py:

app_include_js = ["/assets/pwa_frappe/js/pwa.js"]
web_include_js = ["/assets/pwa_frappe/js/pwa.js"]

๐Ÿง  Service Worker Extensions

Extend to include custom routes or caching strategies.


๐ŸŒ Browser Support

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


โš ๏ธ Limitations

  • ๐Ÿšง Push notifications not yet implemented
  • ๐Ÿ”’ HTTPS required for PWA features
  • ๐ŸŽ Limited iOS PWA support

๐Ÿงฐ 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

Related Developer Tools apps for Frappe & ERPNext

  • Frappe โ€” Low code web framework for real world applications, in Python and Javascript
  • Frappe Docker โ€” Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
  • Builder โ€” Craft beautiful websites effortlessly with an intuitive visual builder and publish them instantly
  • Bench โ€” CLI to manage Multi-tenant deployments for Frappe apps
  • Frappe Ui โ€” A set of components and utilities for rapid UI development
  • Press โ€” Full service cloud hosting for the Frappe stack - powers Frappe Cloud
  • Gameplan โ€” Open Source Discussions Platform for Remote Teams
  • Doppio โ€” A Frappe app (CLI) to magically setup single page applications and Vue/React powered desk pages on your custom Frappe apps.