generated from nhcarrigan/template
feat: transform library into Progressive Web App (PWA)
Implements issue #52 - adds complete PWA functionality with offline support, installability, and app-like experience. PWA Features: - Installable on mobile devices and desktop - Offline support with smart caching strategies - App-like experience with standalone display mode - Full-screen mode and app icon on home screen - Install prompt with beautiful banner UI Manifest Configuration: - Created manifest.json with app metadata - App name: "Naomi's Library" - Theme colour: #9d4edd (witchy purple!) - Background colour: #1a1a2e (dark theme) - Display mode: standalone (app-like) - Icons: Multiple sizes specified (72-512px, maskable variants) - Categories: entertainment, lifestyle Service Worker Implementation: - Cache-first strategy for static assets (JS, CSS, fonts, images) - Network-first strategy for API requests with cache fallback - Network-first strategy for HTML pages with cache fallback - Cache versioning: library-v1 (static, dynamic, images) - Automatic cache cleanup on activation - Update checking every 60 seconds - Message handling for cache clearing and skipWaiting Offline Support: - Created offline.html fallback page with beautiful UI - Auto-retry when network comes back online - Purple gradient matching app theme - Informative messaging about offline state Install Prompt: - Created PwaInstallComponent with banner UI - Detects installability and shows prompt - "Install" and "Not Now" actions - Responsive design for mobile and desktop - Session storage for dismissal state - Animated slide-up entrance Services: - PwaService: Manages service worker registration, install prompts, cache clearing - Automatic initialization on app bootstrap - Signals for reactivity: isInstallable, isInstalled, promptEvent - Update detection and notification HTML Updates: - Added PWA meta tags (theme-color, description) - Linked manifest.json - Apple-specific meta tags for iOS support - Apple touch icon specified Build Configuration: - Updated project.json to include PWA assets - manifest.json, service-worker.js, offline.html copied to dist root Integration: - Added PwaService to app bootstrap - Integrated PwaInstallComponent in main app template - Install banner appears at bottom of screen - Dismissible with session storage Technical Notes: - Service worker uses efficient caching strategies per resource type - Handles Chrome extensions and non-HTTP protocols gracefully - Supports message-based cache clearing - Includes skipWaiting for immediate updates - Compatible with iOS, Android, and desktop PWA standards The library is now a fully-functional Progressive Web App that users can install on any device! The app works offline with cached content and provides an app-like experience with no browser UI in standalone mode. Note: App icons still need to be generated/provided (placeholder paths specified in manifest). ✨ This feature was built by Hikari~ 🌸
This commit is contained in:
@@ -19,6 +19,21 @@
|
||||
{
|
||||
"glob": "**/*",
|
||||
"input": "apps/frontend/public"
|
||||
},
|
||||
{
|
||||
"glob": "manifest.json",
|
||||
"input": "apps/frontend/src",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "service-worker.js",
|
||||
"input": "apps/frontend/src",
|
||||
"output": "/"
|
||||
},
|
||||
{
|
||||
"glob": "offline.html",
|
||||
"input": "apps/frontend/src",
|
||||
"output": "/"
|
||||
}
|
||||
],
|
||||
"styles": ["apps/frontend/src/styles.scss"]
|
||||
|
||||
Reference in New Issue
Block a user