Skip to main content

Progressive Web App

WEFA is installable as a PWA with offline support.

Manifest

{
"name": "WEFA",
"short_name": "WEFA",
"display": "standalone",
"start_url": "/",
"scope": "/",
"theme_color": "#...",
"background_color": "#...",
"icons": [
{ "src": "/icons/icon-192x192.png", "sizes": "192x192", "type": "image/png" },
{ "src": "/icons/icon-512x512.png", "sizes": "512x512", "type": "image/png" }
]
}

Service Worker

Configured via vite-plugin-pwa with Workbox in vite.config.ts.

Caching Strategy

ResourceStrategyRationale
App shellPrecacheAlways available offline
Seed pack spritesPrecacheNeeded for offline creature fallback
IconsPrecachePWA requirement
Creature templatesCacheFirstRarely change
Generated assetsStaleWhileRevalidateMay update but stale is OK
API callsNetworkFirstFresh data preferred

Registration

Service worker is registered in src/main.tsx with an update prompt when a new version is available.

Web APIs Used

APIPurpose
Background SyncFlush job queue when reconnected
Push / NotificationsCare reminders (configurable, default daily)
Badging APIPending creature/badge notification count
Screen Wake LockKeep screen on during active game
Screen OrientationLock portrait during gameplay
VibrationHaptic feedback on key interactions
Web AudioSound effects (optional)

iOS Considerations

  • IndexedDB ~50MB quota per origin
  • No Push Notifications on iOS < 16.4
  • No Badging API on iOS
  • Service worker support varies by iOS version
  • standalone display mode hides Safari chrome