14 Commits

Author SHA1 Message Date
Roman Krček
755f46a66c Fix "Next" button in event creation
All checks were successful
Build Docker image / build (push) Successful in 1m21s
Build Docker image / deploy (push) Successful in 3s
Build Docker image / verify (push) Successful in 27s
2025-09-03 16:36:34 +02:00
Roman Krček
83f3b45d6e Make the interface bigger
All checks were successful
Build Docker image / build (push) Successful in 1m34s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 47s
2025-09-03 11:41:39 +02:00
Roman Krček
4f957d4da6 Going crazy
All checks were successful
Build Docker image / build (push) Successful in 1m30s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 53s
2025-09-03 11:19:46 +02:00
Roman Krček
f6360edef3 Attempt 55 to fix bypass
All checks were successful
Build Docker image / build (push) Successful in 1m31s
Build Docker image / deploy (push) Successful in 3s
Build Docker image / verify (push) Successful in 53s
2025-09-03 10:58:48 +02:00
Roman Krček
28fc22fcd8 Another try to fix service worker bypassing cache
All checks were successful
Build Docker image / build (push) Successful in 1m28s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 56s
2025-09-03 10:52:48 +02:00
Roman Krček
c881d660e2 Fix service worker mess
All checks were successful
Build Docker image / build (push) Successful in 2m10s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 50s
2025-09-03 10:42:05 +02:00
Roman Krček
90287e098e Fix worker reloads 2025-09-03 10:42:05 +02:00
Roman Krček
1d4cae35a5 Fixed problem where auth is bypassed 2025-09-03 10:42:05 +02:00
3f771bf7b0 Merge pull request 'Fix when people order multiple times' (#26) from development into main
All checks were successful
Build Docker image / build (push) Successful in 2m54s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 42s
Reviewed-on: #26
2025-09-03 08:35:00 +02:00
e78902d79f Merge pull request 'development' (#25) from development into main
All checks were successful
Build Docker image / build (push) Successful in 1m14s
Build Docker image / deploy (push) Successful in 3s
Build Docker image / verify (push) Successful in 28s
Reviewed-on: #25
2025-09-02 19:37:17 +02:00
Roman Krček
e52aea9dd3 Fixed private pages being cached
All checks were successful
Build Docker image / build (push) Successful in 1m22s
Build Docker image / deploy (push) Successful in 4s
Build Docker image / verify (push) Successful in 1m8s
2025-09-02 18:43:49 +02:00
cdc8b89916 Merge pull request 'Added loading indicator' (#24) from development into main
All checks were successful
Build Docker image / build (push) Successful in 3m19s
Build Docker image / deploy (push) Successful in 3s
Build Docker image / verify (push) Successful in 1m57s
Reviewed-on: #24
2025-09-02 18:26:28 +02:00
9dd79514f5 Merge branch 'main' into development 2025-09-02 18:21:55 +02:00
Roman Krček
cd37d8da0f Added loading indicator 2025-09-02 18:18:58 +02:00
7 changed files with 57 additions and 74 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "scan-wave",
"private": true,
"version": "0.0.1",
"version": "0.0.2",
"type": "module",
"scripts": {
"dev": "vite dev",

View File

@@ -25,6 +25,9 @@
onMount(async () => {
await authManager.checkConnection();
if (authState.isConnected && authState.token) {
onSuccess?.(authState.token);
}
});
async function handleConnect() {

View File

@@ -1,6 +1,6 @@
import { google } from 'googleapis';
import { getAuthenticatedClient } from '../auth/server.js';
import { GoogleSheet } from './types.ts';
import { GoogleSheet } from './types';
// Type for sheet data
export interface SheetData {

View File

@@ -5,7 +5,7 @@
<h1 class="text-3xl font-bold text-center mb-2">ScanWave</h1>
<h2 class="text-lg text-gray-600 text-center mb-8">Make entrance to your events a breeze.</h2>
<div class="flex space-x-4 w-full justify-center">
<a href="/private/home" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-8 rounded-full shadow-none border border-gray-300 w-64 text-center transition">
<a href="/private/home" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-8 rounded-full shadow-none border border-gray-300 w-64 text-center transition" data-sveltekit-reload>
Get started
</a>
</div>

View File

@@ -17,7 +17,7 @@
</script>
<nav class="border-b border-gray-300 bg-gray-50 p-2 text-gray-900">
<div class="container mx-auto max-w-2xl p-2">
<div class="container mx-auto max-w-4xl p-2">
<div class="flex items-center justify-between">
<a href="/private/home" class="text-lg font-bold" aria-label="ScanWave Home">ScanWave</a>
@@ -32,7 +32,7 @@
</nav>
<div class="container mx-auto max-w-2xl bg-white p-2">
<div class="container mx-auto max-w-4xl bg-white p-2">
<QueryClientProvider client={queryClient}>
{@render children()}
</QueryClientProvider>

View File

@@ -57,7 +57,7 @@
{$debouncedSearch ? `Search Results: "${$debouncedSearch}"` : 'All Events'}
</h1>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 max-w-2xl mx-auto mb-10">
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4 mx-auto mb-10">
{#if isLoading}
<!-- Loading placeholders -->
{#each Array(4) as _}

View File

@@ -1,86 +1,66 @@
/// <reference lib="webworker" />
/// <reference types="@sveltejs/kit" />
import { build, files, version } from '$service-worker';
// Create a unique cache name for this deployment
const CACHE = `cache-${version}`;
declare const self: ServiceWorkerGlobalScope;
const CACHE = `cache-${version}`;
const ASSETS = [
...build, // the app itself
...files // everything in `static`
...build,
...files
];
self.addEventListener('install', (event) => {
// Create a new cache and add all files to it
async function addFilesToCache() {
const cache = await caches.open(CACHE);
await cache.addAll(ASSETS);
}
self.addEventListener('install', (event: ExtendableEvent) => {
const addFilesToCache = async () => {
const cache = await caches.open(CACHE);
await cache.addAll(ASSETS);
};
event.waitUntil(addFilesToCache());
console.log(`[SW] Installing new service worker, cache name: ${CACHE}`);
event.waitUntil(addFilesToCache());
self.skipWaiting();
});
self.addEventListener('activate', (event) => {
// Remove previous cached data from disk
async function deleteOldCaches() {
for (const key of await caches.keys()) {
if (key !== CACHE) await caches.delete(key);
}
}
self.addEventListener('activate', (event: ExtendableEvent) => {
const deleteOldCaches = async () => {
for (const key of await caches.keys()) {
if (key !== CACHE) await caches.delete(key);
console.log("[SW] Removing old service worker")
}
};
event.waitUntil(deleteOldCaches());
event.waitUntil(deleteOldCaches());
self.clients.claim();
});
self.addEventListener('fetch', (event) => {
// ignore POST requests etc
if (event.request.method !== 'GET') return;
self.addEventListener('fetch', (event: FetchEvent) => {
if (event.request.method !== 'GET') return;
async function respond() {
const url = new URL(event.request.url);
// Skip caching for auth routes
if (url.pathname.startsWith('/auth/')) {
return fetch(event.request);
}
// For navigation requests, always fetch from the network to ensure
// server-side authentication checks are performed.
if (event.request.mode === 'navigate') {
event.respondWith(fetch(event.request));
return;
}
const cache = await caches.open(CACHE);
// For other requests (e.g., static assets), use a cache-first strategy.
const respond = async () => {
const cache = await caches.open(CACHE);
// `build`/`files` can always be served from the cache
if (ASSETS.includes(url.pathname)) {
const response = await cache.match(url.pathname);
const cachedResponse = await cache.match(event.request);
if (cachedResponse) {
return cachedResponse;
}
if (response) {
return response;
}
}
try {
return await fetch(event.request);
} catch {
// If the network fails, and it's not in the cache, it will fail,
// which is the expected behavior for non-navigation requests.
return new Response('Not found', { status: 404 });
}
};
// for everything else, try the network first, but
// fall back to the cache if we're offline
try {
const response = await fetch(event.request);
// if we're offline, fetch can return a value that is not a Response
// instead of throwing - and we can't pass this non-Response to respondWith
if (!(response instanceof Response)) {
throw new Error('invalid response from fetch');
}
if (response.status === 200) {
cache.put(event.request, response.clone());
}
return response;
} catch (err) {
const response = await cache.match(event.request);
if (response) {
return response;
}
// if there's no cache, then just error out
// as there is nothing we can do to respond to this request
throw err;
}
}
event.respondWith(respond());
});
event.respondWith(respond());
});