Skip to content

feat(pwa): make frontend installable as a PWA for mobile creators/buy… - #549

Merged
barry01-hash merged 1 commit into
PromptMintLabs:mainfrom
legend-esc:feat/505-pwa-install
Aug 31, 2026
Merged

feat(pwa): make frontend installable as a PWA for mobile creators/buy…#549
barry01-hash merged 1 commit into
PromptMintLabs:mainfrom
legend-esc:feat/505-pwa-install

Conversation

@legend-esc

Copy link
Copy Markdown
Contributor

Closes #505

Summary

Mobile creators and buyers can now install PromptHash to their home screen as a native-like app. This adds a web app manifest, branded app icons, and a service worker that precaches the app shell and runtime-caches API/font requests so the marketplace stays usable offline.

Changes

  • vite.config.ts — Enabled vite-plugin-pwa (already a dev dependency) with registerType: autoUpdate. Added the web app manifest (standalone, portrait, purple #7c3aed theme) and Workbox rules:
    • Precache the JS/CSS/HTML/image shell on first load.
    • NetworkFirst runtime caching for /api (10s timeout, 24h expiry).
    • StaleWhileRevalidate caching for Google Fonts.
    • cleanupOutdatedCaches for safe updates.
  • public/pwa/ — Generated branded icons from logo.png: icon-192.png, icon-512.png, maskable-512.png (safe-zone padded), apple-touch-icon.png.
  • index.html — Added theme-color, apple-mobile-web-app-* meta, and the apple-touch-icon link; updated title.
  • src/hooks/usePWAInstall.ts — Captures the beforeinstallprompt event, detects standalone/already-installed state, and exposes install().
  • src/components/InstallAppButton.tsx — Install button (icon + full variants) that prompts install and shows an "Installed" state.
  • src/components/navigation.tsx — Wired the install button into the desktop header, mobile header, and the mobile menu sheet.
  • .changeset/pwa-install-505.md — Minor-feature changeset.

How to test

  1. yarn build && yarn preview
  2. Open in a mobile browser (or Chrome DevTools device mode).
  3. An Install app button appears in the header/menu; tapping it shows the native install prompt.
  4. After installing, the app opens standalone (no browser chrome) and reloads instantly offline thanks to the precached shell.
  5. Lighthouse → "Installable" and "PWA" checks pass.

…ers (PromptMintLabs#505)

Add web app manifest, generated brand icons (192/512/maskable/apple-touch),
and a service worker that precaches the app shell and runtime-caches the API
and fonts for offline browsing. Wire an "Install app" button into the navigation
using the beforeinstallprompt event, and set theme-color/apple-touch meta.

Co-Authored-By: Kilo <kilo@github.com>
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@legend-esc Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@barry01-hash
barry01-hash merged commit 0917061 into PromptMintLabs:main Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add mobile-native or PWA install support

2 participants