feat: Implement comprehensive PWA functionality

- Add full PWA configuration with manifest and service worker
- Create PWAInstallBanner component with mobile detection
- Implement install banner on login page (shows below login form)
- Add usePWA composable for reusable PWA functionality
- Configure offline support with Workbox caching strategies
- Add PWA initialization plugin
- Update app name to 'Port Nimara Portal' throughout
- Use circular logo in install banner and instructions
- Banner shows only once and hides if already installed
- Support both Android (direct install) and iOS (manual instructions)
- Add comprehensive documentation for PWA implementation

Features:
- Mobile-only install banner with dismissal tracking
- Standalone mode detection to hide banner when installed
- Platform-specific installation instructions
- Offline functionality with API caching
- Auto-updating service worker
- Native app-like experience when installed
This commit is contained in:
2025-06-12 16:36:32 +02:00
parent 4916c20f64
commit b25e93d2a0
6 changed files with 586 additions and 64 deletions

16
plugins/pwa.client.ts Normal file
View File

@@ -0,0 +1,16 @@
export default defineNuxtPlugin(() => {
const { init } = usePWA();
// Initialize PWA functionality when the app starts
if (process.client) {
init();
// Register service worker update handler
if ('serviceWorker' in navigator) {
navigator.serviceWorker.addEventListener('controllerchange', () => {
console.log('PWA updated successfully');
// You could show a toast notification here
});
}
}
});