A mobile-first Progressive Web App to store, manage, and organize your coupon codes. Works offline and can be installed on your phone like a native app.
Try it now: Live Demo (replace with your URL)
- Open the app in your mobile browser
- Add to Home Screen:
- iPhone: Tap Share button β "Add to Home Screen"
- Android: Tap menu (3 dots) β "Add to Home screen" or look for install prompt
- Use offline - works without internet connection
- Tap the green + button in the bottom right
- Enter codes one per line in the text area
- Tap Save to add them to your current list
- Tap any coupon β copies to clipboard instantly
- Swipe any coupon β moves to archived
- Tap any coupon β copies to clipboard
- Swipe left β moves back to current
- Swipe right β deletes permanently
- β Works offline - no internet needed after first visit
- β Persistent storage - your coupons stay saved
- β One-tap copy - instant clipboard access
- β Touch-friendly - optimized for mobile use
- β Clean interface - easy to read monospace codes
This PWA is built with vanilla JavaScript using a modular approach:
coupon-manager/
βββ index.html # Main HTML structure
βββ app.js # All JavaScript modules
βββ styles.css # Complete styling
βββ manifest.json # PWA configuration
βββ sw.js # Service worker
βββ README.md # Documentation
βββ LICENSE # MIT license
StorageManager (app.js)
- Handles localStorage operations
- Provides get/set methods with error handling
CouponManager (app.js)
- Manages coupon CRUD operations
- Handles current/archived state transitions
- Validates and processes bulk input
UIManager (app.js)
- Controls tab switching and rendering
- Updates DOM with coupon lists
- Handles empty states
TouchHandler (app.js)
- Detects tap vs swipe gestures
- Differentiates swipe directions
- Provides visual feedback during interactions
ClipboardManager (app.js)
- Modern clipboard API with fallback
- Shows success notifications
ModalManager (app.js)
- Controls add coupon modal
- Handles bulk text input processing
ToastManager (app.js)
- Shows temporary notifications
- Non-blocking user feedback
Service Worker (sw.js)
- Caches app resources for offline use
- Implements cache-first strategy
- Handles cache updates
Web App Manifest (manifest.json)
- Enables "Add to Home Screen"
- Defines app metadata and icons
- Sets standalone display mode
Uses localStorage with JSON serialization:
current-coupons: Array of current coupon objectsarchived-coupons: Array of archived coupon objects
Each coupon object: { code: "COUPONCODE", id: timestamp }
- β Chrome/Chromium (Android, Desktop)
- β Safari (iOS, macOS)
- β Firefox
- β Edge
β οΈ Touch gestures require modern browser
-
Clone the repository
git clone https://github.com/yourusername/coupon-manager.git cd coupon-manager -
Start local server
# Using Python python -m http.server 8000 # Using Node.js npx serve # Using PHP php -S localhost:8000
-
Open browser:
http://localhost:8000
- Fork this repository
- Enable GitHub Pages:
- Go to Settings β Pages
- Source: "Deploy from a branch"
- Branch: main, folder: / (root)
- Access:
https://yourusername.github.io/coupon-manager
Manual Testing Checklist:
- Add coupons via bulk input
- Copy coupon codes (check clipboard)
- Swipe gestures on both tabs
- Tab switching functionality
- Offline functionality (disconnect network)
- PWA installation on mobile device
We welcome contributions! Here's how to help:
π Bug Reports
- Use GitHub Issues
- Include browser/device info
- Describe steps to reproduce
- Add screenshots if helpful
π‘ Feature Requests
- Open GitHub Issue with "enhancement" label
- Describe the use case
- Explain expected behavior
π οΈ Code Contributions
-
Fork the repository
-
Create feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Follow existing code style
- Keep modules separate and focused
- Test on mobile devices
-
Submit Pull Request
- Clear description of changes
- Reference any related issues
- Include testing notes
Code Style:
- Use ES6+ JavaScript features
- Keep functions small and focused
- Comment complex logic
- Use meaningful variable names
Mobile-First:
- Test on actual mobile devices
- Ensure touch gestures work smoothly
- Verify offline functionality
- Check PWA installation flow
Performance:
- Minimize DOM manipulations
- Keep localStorage operations efficient
- Test with large numbers of coupons
Potential future enhancements:
- Coupon expiration dates
- Categories/tags for organization
- Search and filter functionality
- Export/import features
- Backup to cloud storage
- Usage tracking/statistics
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with vanilla JavaScript for maximum compatibility
- Inspired by mobile-first design principles
- Uses Web APIs for native-like experience
Made with β€οΈ for fellow bus travelers
Have questions? Open an issue or contribute to make this app even better!