feat: Add PWA support with placeholder icons and manifest configuration

This commit is contained in:
Marcio Bevervanso 2026-02-17 20:46:57 -03:00
parent 3849edad10
commit 1939d2d777
9 changed files with 4325 additions and 60 deletions

Binary file not shown.

Binary file not shown.

BIN
foodsnappronto.rar Normal file

Binary file not shown.

View file

@ -5,7 +5,9 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#059669" />
<link rel="apple-touch-icon" href="/pwa-192x192.png" />
<link rel="mask-icon" href="/vite.svg" color="#059669" />
<!-- Primary Meta Tags -->
<title>FoodSnap.ai - Nutricionista de Bolso com Inteligência Artificial</title>
<meta name="title" content="FoodSnap.ai - Nutricionista de Bolso com Inteligência Artificial" />

4342
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -21,6 +21,7 @@
"@types/node": "^22.14.0",
"@vitejs/plugin-react": "^5.0.0",
"typescript": "~5.8.2",
"vite": "^6.2.0"
"vite": "^6.2.0",
"vite-plugin-pwa": "^1.2.0"
}
}

BIN
public/pwa-192x192.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
public/pwa-512x512.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -1,6 +1,7 @@
import path from 'path';
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, '.', '');
@ -9,7 +10,40 @@ export default defineConfig(({ mode }) => {
port: 3000,
host: '0.0.0.0',
},
plugins: [react()],
plugins: [
react(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'masked-icon.svg'],
manifest: {
name: 'FoodSnap.ai',
short_name: 'FoodSnap',
description: 'Nutricionista de Bolso com Inteligência Artificial',
theme_color: '#059669',
background_color: '#ffffff',
display: 'standalone',
orientation: 'portrait',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png'
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable'
}
]
}
})
],
define: {
'process.env.API_KEY': JSON.stringify(env.GEMINI_API_KEY),
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY)