A modern Progressive Web App (PWA) that showcases inspiring stories from the Banten community through interactive mapping technology.
- Static Content: Core HTML, CSS, and JavaScript are cached for instant loading
- Dynamic Content: API data is fetched and cached with intelligent strategies
- Offline-First: App shell loads immediately, even without internet connection
- Add to Homescreen: Users can install the app on their device
- Native App Experience: Runs in standalone mode without browser UI
- App Icons: High-quality icons for various device sizes
- Splash Screen: Custom loading screen during app startup
- Complete Offline Support: All essential UI components remain functional offline
- Intelligent Caching: Different caching strategies for different content types
- Offline Fallback: Graceful degradation when network is unavailable
- Background Sync: Queues actions for when connection is restored
- Node.js (v16 or higher)
- npm or yarn
# Clone the repository
git clone <repository-url>
cd Banten-Storyteller-App
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
- Visit the app in Chrome or Edge
- Look for the install icon in the address bar
- Click "Install" to add to desktop
- Open the app in Chrome
- Tap the menu (โฎ) and select "Add to Home screen"
- Follow the prompts to install
- Open the app in Safari
- Tap the share button (โกโ)
- Select "Add to Home Screen"
The app uses a custom service worker (public/sw.js
) with:
- Application Shell Caching: Core UI components cached for instant loading
- Runtime Caching: Dynamic content cached with Network-First strategy
- Offline Fallback: Custom offline page for navigation requests
- Push Notifications: Support for real-time notifications
The PWA manifest (public/manifest.json
) includes:
- App metadata and branding
- Icons for various device sizes
- Display modes and orientation
- App shortcuts for quick access
- Cache First: Static assets (CSS, JS, images)
- Network First: Dynamic content (API responses)
- Stale While Revalidate: External resources (fonts, CDN)
- โ App shell and navigation
- โ Previously viewed content
- โ Cached images and assets
- โ Core functionality
- โ Offline fallback pages
- โ New content fetching
- โ Real-time updates
- โ User authentication
- โ Data submission
- Performance: 90+
- Accessibility: 95+
- Best Practices: 95+
- SEO: 90+
- PWA: 100
- Code Splitting: Automatic chunking for faster loading
- Tree Shaking: Unused code elimination
- Asset Optimization: Compressed images and minified code
- Preloading: Critical resources loaded early
The app supports push notifications for:
- New story updates
- Community announcements
- User engagement reminders
- Rich notifications with images
- Action buttons for quick responses
- Background sync for offline actions
- Custom notification sounds
- Chrome DevTools: PWA tab for debugging
- Lighthouse: Performance and PWA auditing
- Workbox: Service worker development
# Test offline functionality
1. Open DevTools โ Application โ Service Workers
2. Check "Offline" in Network tab
3. Refresh page and verify offline behavior
# Test installation
1. Open DevTools โ Application โ Manifest
2. Verify manifest is valid
3. Test install prompt in supported browsers
- Chrome 67+
- Edge 79+
- Firefox 67+
- Safari 11.1+
- Older browsers fall back to standard web app behavior
- Graceful degradation for unsupported features
vite.config.js
: PWA plugin configurationpublic/sw.js
: Service worker implementationpublic/manifest.json
: PWA manifestpublic/offline.html
: Offline fallback pagesrc/scripts/utils/sw-register.js
: Service worker registrationsrc/scripts/utils/offline-detector.js
: Offline state management
npm run build
- Service worker is generated
- Manifest is accessible
- Icons are properly sized
- HTTPS is enabled
- Offline functionality tested
- Installation prompt works
- Install Rate: Track app installations
- Offline Usage: Monitor offline engagement
- Performance: Core Web Vitals tracking
- User Engagement: Session duration and interactions
- Fork the repository
- Create a feature branch
- Make your changes
- Test PWA functionality
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For PWA-related issues or questions:
- Check the browser's DevTools PWA tab
- Verify service worker registration
- Test offline functionality
- Review manifest validation
Banten Storyteller - Bringing stories to life through technology ๐