3a1da1482c
- FastAPI + SQLite + Alpine.js + HTMX PWA for Bingo Bango Bongo golf scoring - Passwordless magic link auth with email (aiosmtplib) and admin invite system - Real-time score entry via WebSocket with drag-and-drop player ordering - Course management with per-hole par and stroke index - Scorecard with golf score markers (birdie, eagle, bogey, etc.) - Two-step new game form with tee selection per player - Dashboard with stats, live games social stream, and recent game history - Game summary view (read-only scorecard with leaderboard) - User profile pages with win stats - PWA install support with generated PNG icons - Admin panel for users, courses, games, and invitations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
28 lines
781 B
JavaScript
28 lines
781 B
JavaScript
const CACHE = "skinspins-v1";
|
|
const PRECACHE = ["/static/style.css", "/static/manifest.json"];
|
|
|
|
self.addEventListener("install", (e) => {
|
|
e.waitUntil(caches.open(CACHE).then((c) => c.addAll(PRECACHE)));
|
|
self.skipWaiting();
|
|
});
|
|
|
|
self.addEventListener("activate", (e) => {
|
|
e.waitUntil(
|
|
caches.keys().then((keys) =>
|
|
Promise.all(keys.filter((k) => k !== CACHE).map((k) => caches.delete(k)))
|
|
)
|
|
);
|
|
self.clients.claim();
|
|
});
|
|
|
|
self.addEventListener("fetch", (e) => {
|
|
// Network-first for navigation; cache-first for static assets
|
|
if (e.request.mode === "navigate") {
|
|
e.respondWith(fetch(e.request).catch(() => caches.match(e.request)));
|
|
} else {
|
|
e.respondWith(
|
|
caches.match(e.request).then((cached) => cached || fetch(e.request))
|
|
);
|
|
}
|
|
});
|