diff --git a/frontend/public/apple-touch-icon.png b/frontend/public/apple-touch-icon.png new file mode 100644 index 0000000..0e60b65 Binary files /dev/null and b/frontend/public/apple-touch-icon.png differ diff --git a/frontend/public/favicon.ico b/frontend/public/favicon.ico new file mode 100644 index 0000000..c5e2f07 Binary files /dev/null and b/frontend/public/favicon.ico differ diff --git a/frontend/public/icons/apple-touch-icon.png b/frontend/public/icons/apple-touch-icon.png new file mode 100644 index 0000000..0e60b65 Binary files /dev/null and b/frontend/public/icons/apple-touch-icon.png differ diff --git a/frontend/public/icons/icon-192x192.png b/frontend/public/icons/icon-192x192.png new file mode 100644 index 0000000..5121e74 Binary files /dev/null and b/frontend/public/icons/icon-192x192.png differ diff --git a/frontend/public/icons/icon-512x512.png b/frontend/public/icons/icon-512x512.png new file mode 100644 index 0000000..97451b8 Binary files /dev/null and b/frontend/public/icons/icon-512x512.png differ diff --git a/frontend/public/icons/icon-64x64.png b/frontend/public/icons/icon-64x64.png new file mode 100644 index 0000000..c5e2f07 Binary files /dev/null and b/frontend/public/icons/icon-64x64.png differ diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json new file mode 100644 index 0000000..d196d03 --- /dev/null +++ b/frontend/public/manifest.json @@ -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" + } + ] +} diff --git a/frontend/public/sw.js b/frontend/public/sw.js new file mode 100644 index 0000000..d62be85 --- /dev/null +++ b/frontend/public/sw.js @@ -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; + }) + ); +}); diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 0523b2a..41b3d99 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -1,9 +1,27 @@ import "./globals.css"; -import type { Metadata } from "next"; +import type { Metadata, Viewport } from "next"; + +export const viewport: Viewport = { + themeColor: "#030712", + width: "device-width", + initialScale: 1, + maximumScale: 1, + userScalable: false, +}; export const metadata: Metadata = { title: "AuraTrade // Institutional Quant Terminal", - description: "High-Frequency Trading Terminal & Sentinel Risk Firewall for Exness MT5", + description: "High-Frequency Quantitative Trading Terminal & Sentinel Risk Firewall for Exness MT5", + manifest: "/manifest.json", + appleWebApp: { + capable: true, + statusBarStyle: "black-translucent", + title: "AuraTrade", + }, + icons: { + icon: "/icons/icon-192x192.png", + apple: "/icons/apple-touch-icon.png", + }, }; export default function RootLayout({ @@ -13,8 +31,30 @@ export default function RootLayout({ }) { return ( - + + + + + + + + + {children} +