-
Notifications
You must be signed in to change notification settings - Fork 7
PWA
hieuck edited this page Jul 5, 2026
·
1 revision
Smart ERP Next's web app is a Next.js Progressive Web App (PWA).
-
manifest.jsonenables add-to-home-screen on mobile and desktop. -
service-worker.jscaches static assets for offline access. -
localStorage/ IndexedDB wrappers cache API responses and pending mutations.
When the device comes back online, local changes may conflict with server data. The app uses a predefined conflict UX matrix:
| Scenario | Resolution |
|---|---|
| Local create + server create | Show diff modal; user chooses keep local / server / merge |
| Local update + server update | Timestamp + user decision |
| Local delete + server update | Prompt: restore or keep deleted |
| Offline batch sync | Retry with exponential backoff, surface failures in notification center |
See docs/pwa/conflict-ux-matrix.md for the full matrix and test cases.
apps/web/public/manifest.jsonapps/web/public/sw.jsapps/web/src/lib/offline-db.tsapps/web/src/lib/sync-service.tsapps/web/src/components/SyncConflictModal.tsx