Files
roaauto/frontend/vite.config.js
Marius Mutu 1686efeead feat(frontend): PWA + Backup/Restore + Upgrade Prompts + Settings
- PWA: vite-plugin-pwa with autoUpdate service worker, manifest, offline
  caching for assets + NetworkFirst for API calls
- PWA icons: 192x192 and 512x512 placeholder PNGs + favicon.svg
- index.html: theme-color, apple-touch-icon, description meta tags
- UpgradeBanner component: trial expiry warning with upgrade CTA
- SettingsView: complete settings page with:
  - Plan info display
  - Tenant profile form (firma, CUI, reg com, adresa, IBAN, banca)
  - Backup export (JSON with all tenant data from wa-sqlite)
  - Restore import (JSON file with validation and INSERT OR REPLACE)
  - User management with invite form (email + rol)
  - Logout button
- useOffline composable: shared reactive online/offline state
- DashboardView: added UpgradeBanner at top

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 17:35:06 +02:00

56 lines
1.5 KiB
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import { VitePWA } from 'vite-plugin-pwa'
export default defineConfig({
plugins: [
vue(),
tailwindcss(),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,svg,wasm}'],
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
runtimeCaching: [
{
urlPattern: /^https?:\/\/.*\/api\//,
handler: 'NetworkFirst',
options: {
cacheName: 'api-cache',
expiration: { maxEntries: 50, maxAgeSeconds: 300 },
},
},
],
},
manifest: {
name: 'ROA AUTO - Management Service Auto',
short_name: 'ROA AUTO',
description: 'Aplicatie de management pentru service-uri auto',
theme_color: '#111827',
background_color: '#f9fafb',
display: 'standalone',
orientation: 'portrait-primary',
start_url: '/',
scope: '/',
icons: [
{ src: '/icon-192.png', sizes: '192x192', type: 'image/png' },
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png' },
{ src: '/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' },
],
},
}),
],
server: {
proxy: {
'/api': {
target: 'http://localhost:8000',
changeOrigin: true,
},
},
},
optimizeDeps: {
exclude: ['@journeyapps/wa-sqlite'],
},
})