Files
Bkk1234 092f551b7d Add service worker and harden the web app manifest for Android 14+ / iOS 17+
Android (Samsung S23, One UI 6) refuses 'Install app' / standalone mode
when the origin is not secure or the app has no service worker. The ported
Next.js app shipped neither: only a manifest existed, and no sw.js at all.

- public/sw.js: navigation network-first with an offline fallback,
  cache-first for static assets, /api and /files bypassed, versioned
  cache with skipWaiting + clients.claim.
- public/offline.html: offline shell.
- src/components/PwaBoot.tsx: registers the worker, wires
  beforeinstallprompt into an in-app install button, and shows a
  share-sheet hint on iOS/Samsung Internet where the event never fires.
- ui-manifest.json: add id, display_override, prefer_related_applications,
  launch_handler, handle_links, a maskable icon for Android 14 and
  screenshots for the install preview.
- layout.tsx: viewport-fit=cover, interactive-widget, maximumScale 5
  (never user-scalable=no), appleWebApp metadata, format detection off,
  and drop manually duplicated meta tags that Next already emits.

Verified: manifest passes 8/8 installability checks, sw.js and offline.html
serve with correct content types, tsc clean, npm run build passes.
2026-10-23 22:40:58 +07:00

30 lines
584 B
Plaintext

1.env
.github/
node_modules/
dist/
*.log
.vscode/
.DS_Store
.idea/
.venv/
script/images
*.png
*.jpg
*.jpeg
*.sql
!backend/migrations/*.sql
*.vps
# Design assets ported from web-at-transit-mock — MUST be committed so the
# `frontend` Docker build ships them (logo, hero map, partner logos,
# route/stop photos). The global *.png/*.jpg/*.jpeg rules above would
# otherwise drop them from the deploy.
!frontend/public/images/
!frontend/public/images/**
!frontend/src/app/icon.png
!frontend/src/app/apple-icon.png
# Next.js build cache — never commit
frontend/tsconfig.tsbuildinfo