feat: add PWA 1-click install, Apple iOS Add-to-Home-Screen guide modal, manifest, and service worker

This commit is contained in:
2026-10-23 00:23:16 +06:00
parent e8ee5e8ac2
commit 5a79667bf7
11 changed files with 412 additions and 4 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 581 B

+43
View File
@@ -0,0 +1,43 @@
{
"name": "AuraTrade // Institutional Quant Terminal",
"short_name": "AuraTrade",
"description": "High-Frequency Quantitative Trading Terminal & Sentinel Risk Firewall for Exness MT5",
"start_url": "/",
"display": "standalone",
"orientation": "any",
"background_color": "#030712",
"theme_color": "#030712",
"scope": "/",
"categories": ["finance", "business", "productivity"],
"icons": [
{
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
},
{
"src": "/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/icons/apple-touch-icon.png",
"sizes": "180x180",
"type": "image/png"
}
]
}
+61
View File
@@ -0,0 +1,61 @@
const CACHE_NAME = "auratrade-v1.0.0";
const STATIC_ASSETS = [
"/",
"/manifest.json",
"/icons/icon-192x192.png",
"/icons/icon-512x512.png",
"/icons/apple-touch-icon.png",
"/favicon.ico"
];
// Install: Cache static app shell
self.addEventListener("install", (event) => {
event.waitUntil(
caches.open(CACHE_NAME).then((cache) => {
return cache.addAll(STATIC_ASSETS);
})
);
self.skipWaiting();
});
// Activate: Clean up old caches
self.addEventListener("activate", (event) => {
event.waitUntil(
caches.keys().then((keys) => {
return Promise.all(
keys.map((key) => {
if (key !== CACHE_NAME) {
return caches.delete(key);
}
})
);
})
);
self.clients.claim();
});
// Fetch: Bypass live API & WebSocket, Stale-while-revalidate for static assets
self.addEventListener("fetch", (event) => {
const url = new URL(event.request.url);
// Always bypass cache for live APIs and WebSockets
if (url.pathname.startsWith("/api/") || url.pathname.startsWith("/ws")) {
return;
}
event.respondWith(
caches.match(event.request).then((cachedResponse) => {
const fetchPromise = fetch(event.request).then((networkResponse) => {
if (networkResponse && networkResponse.status === 200 && event.request.method === "GET") {
const responseToCache = networkResponse.clone();
caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, responseToCache);
});
}
return networkResponse;
}).catch(() => cachedResponse);
return cachedResponse || fetchPromise;
})
);
});