Skip to content

Commit 91941ee

Browse files
committed
QA about bundling as native apps + support options
1 parent eafa297 commit 91941ee

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

docs/Tutorial/Dexie-Cloud.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,3 +340,76 @@ This file is needed when you use the CLI (`npx dexie-cloud`) to whitelist, expor
340340
### Why should `dexie-cloud.json` and `dexie-cloud.key` be .gitignored?
341341

342342
Keys shall never be committed to git (`dexie-cloud.key`). `dexie-cloud.json` does not contain any sensitive data but is still not tied to your code base - some other person might want to run the app on another database.
343+
344+
### How can I make my webapp an installable app (PWA) on desktop and mobile?
345+
346+
To make your webapp a Progressive Web App (PWA), you only need a few small pieces:
347+
348+
- Create a web app manifest (`manifest.webmanifest`) with name, icons, start_url and display (standalone).
349+
- Add a service worker that caches your app shell and (optionally) API responses. Keep the service worker small and focused on offline/app-shell behavior.
350+
- Register the service worker from your client code (e.g. `navigator.serviceWorker.register('/sw.js')`).
351+
- Ensure your site is served over HTTPS (localhost is allowed for development).
352+
353+
If you use Vite, there are community plugins that automate manifest generation and service-worker integration (for example `vite-plugin-pwa`). These plugins can inject the manifest, generate precache lists and wire service-worker registration for you.
354+
355+
Quick checklist:
356+
357+
1. Add `manifest.webmanifest` to your public folder and link it from `<head>`.
358+
2. Add a minimal `sw.js` (or use a plugin to generate Workbox-powered service worker).
359+
3. Register the service worker in your app entry file.
360+
4. Test using Chrome/Edge Lighthouse or `web.dev/measure` and verify installability on mobile.
361+
362+
### How can I bundle my app as a native app for iOS and Google Play?
363+
364+
To package your webapp as native apps you have a few solid options. The most common are:
365+
366+
- Capacitor (Ionic) — modern, actively maintained native runtime that wraps your web app and provides native plugins. Good for both iOS and Android.
367+
- Electron — popular for packaging web apps as native desktop apps (macOS, Windows, Linux). Works well with PWAs and frameworks like Vite; pair with builders like `electron-builder` or `electron-forge` for installers.
368+
- PWABuilder / TWA (Trusted Web Activity) — generate Android APKs/AABs from a PWA; TWA is ideal if your app is already a high-quality PWA.
369+
- Cordova / PhoneGap — older tooling still in use for legacy projects but generally superseded by Capacitor.
370+
371+
Recommended quick actions:
372+
373+
1. Make sure your app is a solid PWA first (see previous section). PWAs are the best starting point for native packaging.
374+
2. Choose a tool:
375+
376+
- Capacitor: follow its setup docs to add platforms, copy the web build into the native projects and run builds with Xcode (iOS) and Android Studio (Android).
377+
378+
- Electron: follow its docs to wrap your web build in a desktop runtime — build the web UI, create a small main process that loads the built files, and use builders like `electron-builder` or `electron-forge` to produce installers; remember to configure signing/notarization and auto-updates.
379+
380+
- PWABuilder / TWA: use PWABuilder to generate an Android TWA wrapper or follow the TWA docs to create an AAB that links to your hosted PWA.
381+
382+
3. Configure platform-specific settings: app id/package name, icons and splash screens, permissions, and any native plugins you need.
383+
4. Test on real devices and use platform tooling (Xcode for iOS, Android Studio / bundletool for Android) to create release builds and sign them.
384+
5. Follow the store submission guides to publish on App Store and Google Play (you'll need developer accounts, app listing assets, privacy policy, etc.).
385+
386+
Useful documentation:
387+
388+
- Capacitor: https://capacitorjs.com/docs
389+
- Electron: https://www.electronjs.org/docs/latest
390+
- PWABuilder: https://www.pwabuilder.com/
391+
- Trusted Web Activity (Android / Google): https://developer.chrome.com/docs/android/trusted-web-activity/
392+
- Apple App Store publishing: https://developer.apple.com/app-store/
393+
- Google Play publishing: https://developer.android.com/distribute
394+
395+
### How do I whitelist my app when bundled as native app with Capacitor?
396+
397+
```bash
398+
npx dexie-cloud whitelist capacitor://localhost
399+
npx dexie-cloud whitelist http://localhost
400+
```
401+
402+
### How do I whitelist my app when bundled with Electron?
403+
404+
Electron apps does not require whitelisting.
405+
406+
### How can I get help
407+
408+
Let the community help out on:
409+
410+
- [Stackoverflow](http://stackoverflow.com/questions/ask?tags=dexie)
411+
- [Github Issues](https://github.com/dexie/Dexie.js/issues/new?labels=cloud,question)
412+
- [Discord](https://discord.com/channels/1328303736363421747/1339957860657926204)
413+
- Request private support from the dexie team: [privsupport@dexie.org](https://dexie.org/contact#private-support-issues)
414+
415+
We prefer getting questions on stackoverflow and Github because it they will be publicly searchable for other users and creates a helps learning AI engines.

0 commit comments

Comments
 (0)