Installing as a PWA
When you first visit Track Better in a supported browser, you’ll see a download icon in the top-right corner of the app.Installation Steps
Confirm Installation
Your browser will show a native install prompt. Click “Install” or “Add to Home Screen”
Supported Browsers
Chrome
Full PWA support on Android, Windows, Mac, and Linux
Edge
Full PWA support on Windows and Mac
Safari
iOS/iPadOS: Manual “Add to Home Screen” required
Firefox
Limited PWA support on desktop
On iOS Safari, you need to manually add Track Better to your home screen using the Share menu → “Add to Home Screen”.
How PWA Installation Works
Track Better listens for the browser’sbeforeinstallprompt event and shows a custom install button.
Install Prompt Handling
App.jsx:86-104
- Registers the service worker (
sw.js) for offline caching - Captures the install prompt by preventing the default browser behavior
- Shows a custom install button when the app is installable
Install Button Click Handler
App.jsx:172-181
- Shows the browser’s native install prompt
- Waits for the user’s decision
- Hides the button if installation is accepted
Install Button UI
App.jsx:224-236
Service Worker & Offline Support
Track Better uses a service worker to enable offline functionality and fast loading.Service Worker Registration
The service worker (sw.js) is registered on app load:
App.jsx:88-90
Cache Strategy
sw.js:1-53
- Pre-caches critical assets during installation
- Uses cache-first strategy for offline support
- Updates the cache with fresh content when online
Fetch Strategy
sw.js:30-53
- Returns cached content immediately if available
- Fetches from network in the background and updates the cache
- Falls back to cache if network fails (offline mode)
Offline Capabilities
When installed as a PWA, Track Better provides full offline functionality:Data Storage
Data Storage
All workout logs, DSA problem tracking, and user preferences are stored in localStorage. No internet connection required.
Exercise Videos
Exercise Videos
Exercise demonstration videos require an internet connection. Download the app assets to cache them for offline viewing.
Data Sync
Data Sync
Track Better doesn’t have cloud sync. Use the Export Data feature in Settings to backup your progress and import it on other devices.
Service Worker Updates
Service Worker Updates
When online, the service worker automatically checks for app updates and downloads new versions in the background.
Browser Notifications
If you want to add reminder notifications in the future, you’ll need to:- Request notification permissions
- Set up a push notification server
- Subscribe users to push notifications
- Send scheduled reminders from the server
PWA Manifest
Track Better’s PWA configuration is defined inmanifest.webmanifest:
manifest.webmanifest
display: standalone: Opens without browser UItheme_color: Sets the app’s theme coloricons: Provides home screen and splash screen icons
Benefits of Installing
Offline Access
Use Track Better without an internet connection
Faster Loading
Instant loading from cached assets
Home Screen Icon
Launch directly from your home screen
Native Feel
Full-screen experience without browser UI
Troubleshooting
Install button doesn't appear
Install button doesn't appear
App not working offline
App not working offline
Make sure the service worker is registered. Check the browser console for errors. Visit the site while online first to cache the assets.
How to uninstall
How to uninstall
- Chrome/Edge: Right-click the app icon → “Uninstall” or go to browser settings → Apps
- iOS: Long-press the home screen icon → “Remove App”
- Android: Long-press the app icon → “Uninstall”
Related Features
Data Export
Export your data for backup and sync
Theme Toggle
Customize your app appearance