docs/guides/PWA_GUIDE.md
OmniRoute ships as a fully installable Progressive Web App. When you access the dashboard from any mobile browser — Android (Chrome) or iOS (Safari) — you can "Add to Home Screen" and get a native app-like experience with no app store required.
A Progressive Web App turns the OmniRoute web dashboard into something that looks and feels like a native mobile app. Once installed, it:
http://YOUR_IP:20128http://YOUR_IP:20128The manifest is configured with display: "fullscreen", which means the installed app uses the entire screen — no browser chrome, no status bar overlap. This makes the dashboard feel truly native.
OmniRoute includes a service worker (sw.js) that provides intelligent caching:
| Asset Type | Strategy | Behavior |
|---|---|---|
| App Shell | Cache-first | /, /offline, manifest, and icons are pre-cached on install |
| Static assets (CSS, JS, images, fonts) | Network-first with cache fallback | Fetches fresh from the network; falls back to cache if offline |
Next.js bundles (/_next/) | Network-first with cache update | Fetches from network and updates cache; serves cached version if offline |
| Navigation requests | Network-only with offline fallback | Always fetches from network; shows /offline page if network is unavailable |
API routes (/api/, /a2a, /dashboard/endpoint) | Bypass (never cached) | Always goes directly to the server — never intercepted by the service worker |
When the network is unavailable and a user navigates to a new page, the service worker serves a dedicated /offline page that:
OmniRoute provides icons optimized for each platform:
| File | Size | Used By |
|---|---|---|
icon-512.png | 512×512 | Android install prompt, splash screen |
apple-touch-icon.png | 180×180 | iOS home screen icon |
icon-192.svg | 192×192 (vector) | Android adaptive icon |
apple-touch-icon.svg | 180×180 (vector) | Apple fallback |
favicon.svg | Vector | Browser tabs |
favicon.ico | Multi-size | Legacy browsers |
The service worker is registered automatically via the <PwaRegister /> component in the root layout. No user action is needed — the app becomes installable as soon as the browser detects the valid manifest and service worker.
manifest.webmanifest)Generated by Next.js via src/app/manifest.ts:
{
"name": "OmniRoute",
"short_name": "OmniRoute",
"description": "OmniRoute is an AI gateway for multi-provider LLMs. One endpoint for all your AI providers.",
"start_url": "/",
"scope": "/",
"display": "fullscreen",
"orientation": "any",
"background_color": "#0b0f1a",
"theme_color": "#0b0f1a",
"icons": [
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" },
{ "src": "/apple-touch-icon.png", "sizes": "180x180", "type": "image/png" }
]
}
public/sw.js)A vanilla service worker (no framework dependencies) with:
omniroute-pwa-v2 — bump this to force a fresh cache on updatesrc/app/layout.tsx)The root layout provides all the meta tags required for PWA compliance:
manifest link to /manifest.webmanifestapple-web-app-capable: true for iOS standalone modeapple-web-app-status-bar-style: black-translucentmobile-web-app-capable: yes for Android Chrometheme-color: #0b0f1aviewport-fit: cover for edge-to-edge renderingPwaRegisterLocated at src/shared/components/PwaRegister.tsx, this client component:
serviceWorker support in the browser/sw.js silently (errors are swallowed to avoid blocking the app)return null) — it's a side-effect-only componentWhen running OmniRoute on Android via Termux, the PWA works seamlessly:
npx omniroutehttp://localhost:20128This combination means your Android phone is both the server (Termux) and the client (PWA) — a complete self-contained AI gateway.
Install the PWA on any device that has browser access to your OmniRoute server:
http://PHONE_IP:20128 and install the PWAThe PWA title respects the Instance Name setting from Dashboard → Settings. If you rename your instance to "My AI Gateway", the installed PWA will show that name.
If you upload a custom favicon via Dashboard → Settings, the PWA icon on desktop will reflect the custom icon. Mobile home screen icons use the pre-built icon-512.png and apple-touch-icon.png files.
/api/ routes are never cached.| File | Purpose |
|---|---|
src/app/manifest.ts | Next.js manifest route (generates manifest.webmanifest) |
public/sw.js | Service worker with caching logic |
src/shared/components/PwaRegister.tsx | Client component that registers the service worker |
src/app/offline/page.tsx | Offline fallback page with live status indicator |
src/app/layout.tsx | Root layout with PWA metadata (apple-web-app, theme-color, etc.) |
public/icon-512.png | 512×512 PNG icon (Android, splash screen) |
public/apple-touch-icon.png | 180×180 PNG icon (iOS home screen) |
public/icon-192.svg | 192×192 SVG icon (Android adaptive) |
public/apple-touch-icon.svg | 180×180 SVG icon (Apple fallback) |