Manual setup steps for PWA features and offline functionality
Create manifest.json in your public directory:
{
"name": "OrangeCone",
"short_name": "OrangeCone",
"description": "Public Space Issue Reporting & Management",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#ea580c",
"orientation": "any",
"icons": [
{
"src": "/icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}Don't forget: Create icon files (icon-192.png and icon-512.png) with your OrangeCone logo in the public directory.
Get the service worker code from the backend function and save it to your public directory:
functions/getServiceWorkerCode endpoint in your dashboardserviceWorkerCode contentservice-worker.js in your public directoryofflineHTML contentoffline.html in your public directoryNote: The service worker is already registered in your Layout component via ServiceWorkerRegistration.
Add these tags to your index.html in the <head> section:
<!-- PWA Meta Tags --> <link rel="manifest" href="/manifest.json"> <meta name="theme-color" content="#ea580c"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <meta name="apple-mobile-web-app-title" content="OrangeCone"> <link rel="apple-touch-icon" href="/icon-192.png"> <!-- Splash Screens (optional) --> <link rel="apple-touch-startup-image" href="/splash-screen.png">
Desktop Testing
Open Chrome DevTools → Application → Service Workers to verify registration
Mobile Testing
Visit your app on mobile, you should see "Add to Home Screen" prompt
Offline Testing
Enable airplane mode and verify the app still loads cached content
Lighthouse Audit
Run Lighthouse in DevTools to check PWA score
✓ Offline Queue System
IndexedDB-based queue for offline report creation and updates
✓ Performance Monitoring
Real-time metrics for mobile performance, battery, and connectivity
✓ Accessibility Improvements
ARIA labels, touch targets, and screen reader support
Future Enhancement: Push Notifications
Requires additional backend service and user permissions setup
Future Enhancement: Offline Maps
Requires implementing tile caching with Leaflet.offline plugin