From 36ea8f006be2cb9b3262b531636ebe822b7c0d78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?PontualTech=20/=20Karl=C3=A3o?= Date: Mon, 27 Apr 2026 14:35:01 -0300 Subject: [PATCH] =?UTF-8?q?feat(pwa):=20manifest.json=20+=20=C3=ADcone=20S?= =?UTF-8?q?VG=20mar=C3=ADtimo=20pra=20instalar=20como=20app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Endpoint Express /manifest.json com name/short_name/icons/theme - /icon.svg vetorial (veleiro estilizado em paleta marítima) - Links manifest + apple-touch-icon nos 2 HTMLs (app/ e server/public/) Habilita: - Android Chrome: 'Add to Home Screen' com ícone bonito - iOS Safari: ícone na tela inicial - PWABuilder: pode gerar APK Android sideload-ready Co-Authored-By: Claude Opus 4.7 (1M context) --- app/diario-bordo.html | 3 +++ server/public/icon.svg | 10 ++++++++++ server/public/index.html | 3 +++ server/src/index.js | 20 ++++++++++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 server/public/icon.svg diff --git a/app/diario-bordo.html b/app/diario-bordo.html index 791d547..06e8854 100644 --- a/app/diario-bordo.html +++ b/app/diario-bordo.html @@ -8,6 +8,9 @@ + + + Diário de Bordo diff --git a/server/public/icon.svg b/server/public/icon.svg new file mode 100644 index 0000000..214a8bf --- /dev/null +++ b/server/public/icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + Shivao + diff --git a/server/public/index.html b/server/public/index.html index 791d547..06e8854 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -8,6 +8,9 @@ + + + Diário de Bordo diff --git a/server/src/index.js b/server/src/index.js index 511bd1e..5dceaca 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -55,6 +55,26 @@ function requireAuth(req, res, next) { // ==== Public endpoints ==== app.get('/api/health', (req, res) => res.json({ ok: true, ts: Date.now() })); +// PWA manifest (necessário pra "Add to Home Screen" + APK via PWABuilder) +app.get('/manifest.json', (req, res) => { + res.json({ + name: 'Shivao · Diário de Bordo', + short_name: 'Shivao', + description: 'Diário de bordo do veleiro Shivao — viagens, manutenções, GPS, fundeio com alarme remoto', + start_url: '/', + display: 'standalone', + orientation: 'any', + background_color: '#0e2a3d', + theme_color: '#0e2a3d', + lang: 'pt-BR', + icons: [ + { src: '/icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' }, + { src: '/icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'maskable' } + ], + categories: ['navigation', 'travel', 'productivity'] + }); +}); + // ==== Static frontend ==== const publicDir = path.join(__dirname, '..', 'public'); app.use(express.static(publicDir));