Vito Business OS is a Progressive Web App (PWA). Users can install it on their phone or desktop home screen and receive push notifications even when the browser tab is closed. The PWA layer is managed byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AugustoMelara-Dev/Vito-Business-OS/llms.txt
Use this file to discover all available pages before exploring further.
vite-plugin-pwa, which generates a service worker and a Web App Manifest at build time.
Vite configuration
The PWA plugin is configured invite.config.js:
Key configuration choices
| Option | Value | Reason |
|---|---|---|
registerType | autoUpdate | Service worker updates silently in the background |
navigateFallback | null | Prevents the service worker from serving cached HTML for API routes, avoiding cross-tenant data leaks |
globPatterns | **/*.{js,css,ico,png,svg,woff2} | Only static assets are pre-cached; never JSON or HTML |
display | standalone | Hides the browser chrome when installed, giving a native app feel |
App manifest
The Web App Manifest is generated from themanifest key in vite.config.js and served from /build/manifest.webmanifest. Browsers use it to populate the install prompt and home screen icon.
| Field | Value |
|---|---|
name | Conecta HN |
short_name | Conecta |
display | standalone |
theme_color | #000000 |
background_color | #ffffff |
start_url | / |
orientation | portrait |
| Icons | 192×192 and 512×512 PNG, plus a maskable 512×512 |
The maskable icon variant allows Android to apply adaptive icon shaping (circles, squircles, etc.) without clipping your logo. Make sure
/icon-512x512.png has sufficient safe-zone padding.Service worker
vite-plugin-pwa generates a Workbox-powered service worker during npm run build. It is registered automatically with registerType: 'autoUpdate'.
What the service worker caches
| Strategy | Assets |
|---|---|
| Pre-cache (at install) | All .js, .css, .ico, .png, .svg, .woff2 files emitted by Vite |
CacheFirst (runtime) | Images matching *.png, *.jpg, *.jpeg, *.svg, *.gif, *.webp — cached for 30 days, max 50 entries |
| Network only (implicit) | Everything else — API responses, HTML pages |
Offline capability
With the current configuration, the app shell (JS, CSS, fonts, icons) loads offline after the first visit. Dynamic content (orders, products, catalog data) requires a network connection because API responses are intentionally not cached. This design is a deliberate security trade-off: tenant data must never be stored in the browser cache where it could be accessed by another user on a shared device.Installing the app
- Android (Chrome)
- iOS (Safari)
- Desktop (Chrome / Edge)
Accept the install prompt
Chrome shows an “Add to Home screen” banner or an install icon in the address bar. Tap it and confirm.
Integration with Web Push
The service worker is the delivery point for background push notifications. When the Laravel backend sends a push via VAPID, the browser vendor’s push service wakes the service worker even if the browser tab is closed. The service worker listens for thepush event and displays the notification using the Notifications API. Tapping the notification triggers the notificationclick event, which opens the relevant URL from the notification payload.
See the push notifications page for the full frontend subscription flow and service worker event handler code.
Build output
After runningnpm run build, the following files are emitted to public/build/:
| File | Purpose |
|---|---|
sw.js | Generated Workbox service worker |
workbox-*.js | Workbox runtime libraries |
manifest.webmanifest | Web App Manifest |
<head> by the Vite plugin.