Phase 2: auth, session management, layout, PWA manifest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jānis Kacēns
2026-05-11 11:54:37 +03:00
parent 0bc9160d97
commit d9de37d3d8
17 changed files with 487 additions and 1 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

+22
View File
@@ -0,0 +1,22 @@
{
"name": "QBank",
"short_name": "QBank",
"start_url": "/",
"display": "standalone",
"background_color": "#f9fafb",
"theme_color": "#2563eb",
"icons": [
{
"src": "/static/icon-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/static/icon-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
const CACHE = 'qbank-v1';
self.addEventListener('install', () => self.skipWaiting());
self.addEventListener('activate', e => e.waitUntil(clients.claim()));
self.addEventListener('fetch', e => {
// Network-first: serve fresh, fall back to cache for GET requests.
if (e.request.method !== 'GET') return;
e.respondWith(
fetch(e.request)
.then(res => {
if (res.ok) {
const clone = res.clone();
caches.open(CACHE).then(c => c.put(e.request, clone));
}
return res;
})
.catch(() => caches.match(e.request))
);
});