Skip to content

feat: add PWA install support#9

Merged
eSlider merged 3 commits intomasterfrom
feat/pwa
Feb 15, 2026
Merged

feat: add PWA install support#9
eSlider merged 3 commits intomasterfrom
feat/pwa

Conversation

@eSlider
Copy link
Owner

@eSlider eSlider commented Feb 15, 2026

Makes Mail Archive installable as a Progressive Web App on desktop and mobile.

Changes

  • Web app manifest (manifest.webmanifest) with name, theme color, icons
  • Service worker for offline caching of static assets (API remains network-first)
  • PWA meta tags on all pages (dashboard, login, register)
  • /sw.js and /manifest.webmanifest routes with correct MIME types

Docs

  • README: PWA feature, installation section, updated file structure
  • CONTRIBUTING: PWA stack mention, updated frontend file structure

Requires HTTPS in production (localhost works for development).

- Add web app manifest (name, theme, icons)
- Add service worker for offline static asset caching
- Add PWA meta tags to all templates
- Serve sw.js and manifest with correct MIME types
- Update README and CONTRIBUTING with PWA docs

Co-authored-by: Cursor <cursoragent@cursor.com>
Copy link
Owner Author

@eSlider eSlider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to be fixed

<link rel="stylesheet" href="/static/css/app.css">
<link rel="icon" href="/static/favicon.svg" type="image/svg+xml">
<link rel="manifest" href="/manifest.webmanifest">
<meta name="theme-color" content="#6366f1">
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isolate color into manifest

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isolate color into manifest

Ok

- Isolate theme-color in manifest only (remove from HTML)
- DRY: extract PWA meta into partials/pwa.tmpl, reuse in all templates
- sw.js: Vue *.template.vue cached on first fetch via /static/ prefix
- sw.js: use CACHE_EXACT and CACHE_PREFIXES arrays for path matching

Co-authored-by: Cursor <cursoragent@cursor.com>
@eSlider
Copy link
Owner Author

eSlider commented Feb 15, 2026

Addressed review comments:

1. Isolate color into manifest — Removed theme-color meta from all HTML templates. It stays only in manifest.webmanifest.

2. DRY base template — Added templates/partials/pwa.tmpl with {{define "pwa_head"}} containing manifest link + apple meta + apple-touch-icon. All three templates (login, register, dashboard) now use {{template "pwa_head" .}}. templates.go parses the partial and clones it for each page.

3. Vue templates wildcard — Removed main.template.vue from precache. Vue *.template.vue files are cached on first fetch via the /static/ prefix in the fetch handler.

4. Use array for path matching — Replaced the long condition with CACHE_EXACT.includes(url.pathname) || CACHE_PREFIXES.some(p => url.pathname.startsWith(p)).

Co-authored-by: Cursor <cursoragent@cursor.com>
@eSlider eSlider merged commit bd0623a into master Feb 15, 2026
5 checks passed
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.

1 participant