Skip to content

internauten/pwa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

My Progressive Web App

A complete Progressive Web App (PWA) that can be installed on iOS 12+ and Windows.

--> Completely generated by AI Claude Sonnet 4.5 <--

Features

  • πŸ“² Installable: Add to home screen on iOS and Windows
  • πŸ”Œ Offline Support: Works without internet connection using Service Worker
  • πŸ“± Responsive Design: Optimized for mobile and desktop
  • πŸ’Ύ Local Storage: Save notes and preferences locally
  • 🎨 Theme Customization: Change background colors
  • 🌐 Connection Status: See online/offline status in real-time

Installation

On iOS (iPhone/iPad - iOS 12+)

  1. Open Safari and navigate to your hosted PWA URL
  2. Tap the Share button (box with arrow)
  3. Scroll down and tap "Add to Home Screen"
  4. Tap "Add" to confirm
  5. The app icon will appear on your home screen

On Windows (Desktop)

  1. Open Chrome, Edge, or other Chromium browser
  2. Navigate to your hosted PWA URL
  3. Click the install icon in the address bar (+ or install button)
  4. Click "Install" to confirm
  5. The app will launch in a standalone window

On Android

  1. Open Chrome browser
  2. Navigate to your hosted PWA URL
  3. Tap the menu (three dots) and select "Add to Home Screen"
  4. Or use the install prompt that appears automatically

Running Locally

To test the PWA locally, you need to serve it over HTTPS or localhost:

Option 1: Python HTTP Server

# Python 3
python -m http.server 8000

# Visit: http://localhost:8000

Option 2: Node.js HTTP Server

# Install http-server globally
npm install -g http-server

# Run server
http-server -p 8000

# Visit: http://localhost:8000

Option 3: VS Code Live Server Extension

  1. Install "Live Server" extension in VS Code
  2. Right-click index.html
  3. Select "Open with Live Server"

Deployment

To make your PWA installable on iOS and Windows, deploy it to a hosting service with HTTPS:

Recommended Free Hosting Options

  • GitHub Pages: Free, HTTPS enabled
  • Netlify: Free tier with HTTPS
  • Vercel: Free tier with HTTPS
  • Azure Static Web Apps: Free tier available
  • Firebase Hosting: Free tier available

Quick Deploy to GitHub Pages

  1. Create a GitHub repository
  2. Push your code to the repository
  3. Go to Settings β†’ Pages
  4. Select your branch and save
  5. Your PWA will be available at https://yourusername.github.io/repo-name

File Structure

webapp/
β”œβ”€β”€ index.html          # Main HTML file with PWA meta tags
β”œβ”€β”€ manifest.json       # Web app manifest for installability
β”œβ”€β”€ sw.js              # Service worker for offline functionality
β”œβ”€β”€ app.js             # Main application JavaScript
β”œβ”€β”€ styles.css         # Styling and responsive design
β”œβ”€β”€ generate_icons.py  # Script to generate app icons
β”œβ”€β”€ icons/             # App icons in various sizes
β”‚   β”œβ”€β”€ icon-72x72.png
β”‚   β”œβ”€β”€ icon-96x96.png
β”‚   β”œβ”€β”€ icon-128x128.png
β”‚   β”œβ”€β”€ icon-144x144.png
β”‚   β”œβ”€β”€ icon-152x152.png
β”‚   β”œβ”€β”€ icon-167x167.png
β”‚   β”œβ”€β”€ icon-180x180.png
β”‚   β”œβ”€β”€ icon-192x192.png
β”‚   β”œβ”€β”€ icon-384x384.png
β”‚   └── icon-512x512.png
└── README.md          # This file

PWA Features Implemented

iOS 12 Compatibility

  • βœ… Apple-specific meta tags (apple-mobile-web-app-capable)
  • βœ… Apple touch icons in multiple sizes
  • βœ… Status bar styling for iOS
  • βœ… Viewport configuration for iOS devices
  • βœ… Web app manifest for modern iOS versions

Windows Compatibility

  • βœ… Web app manifest with proper configuration
  • βœ… Service worker for offline functionality
  • βœ… Install prompt handling
  • βœ… Desktop-optimized responsive design
  • βœ… Multiple icon sizes for different displays

Core PWA Features

  • βœ… Service Worker registration
  • βœ… Offline caching strategy
  • βœ… App install prompt
  • βœ… Standalone display mode
  • βœ… Theme color customization
  • βœ… Responsive design
  • βœ… Local storage for data persistence

Browser Support

  • βœ… iOS Safari 12+
  • βœ… Chrome (Desktop & Mobile)
  • βœ… Edge (Desktop & Mobile)
  • βœ… Firefox (limited PWA support)
  • βœ… Opera
  • βœ… Samsung Internet

Development Notes

Service Worker

The service worker (sw.js) caches all static assets and provides offline functionality. It uses a cache-first strategy for better performance.

Manifest

The manifest.json defines how the app appears when installed, including:

  • App name and short name
  • Display mode (standalone)
  • Theme colors
  • Icons in multiple sizes
  • Start URL

Icons

Icons are generated in 10 different sizes to support:

  • Various iOS devices and display densities
  • Android devices
  • Windows tiles
  • Browser favicons

Troubleshooting

PWA not installing on iOS

  • Ensure you're using Safari browser
  • Check that all required icons are present
  • Verify apple-mobile-web-app meta tags are correct
  • Make sure the site is served over HTTPS (or localhost)

PWA not installing on Windows

  • Use Chrome or Edge browser
  • Ensure manifest.json is valid
  • Check that Service Worker is registered successfully
  • Verify HTTPS is enabled (or using localhost)

Service Worker not updating

  • Clear browser cache
  • Unregister the old service worker in DevTools
  • Increment the cache version in sw.js

Customization

Change App Name

Edit manifest.json:

{
  "name": "Your App Name",
  "short_name": "YourApp"
}

Change Theme Color

Edit both index.html and manifest.json:

<meta name="theme-color" content="#your-color">

Change App Icons

  1. Replace icon files in the icons/ directory
  2. Or modify generate_icons.py and regenerate

License

MIT License - feel free to use and modify for your projects!

Credits

Built as a demonstration PWA compatible with iOS 12+ and Windows.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors