Phase 0 + 1: Dockerized Supabase core + attendee PWA

Phase 0 — Supabase core (Docker via CLI):
- Schema: profiles, slots, sessions, preferences, connections, checkins,
  feedback, leaderboard (Realtime mirror), points_log
- RLS on every table; transactional security-definer points RPCs
- Seed: 6 slots, 18 sessions, 13 demo users (QR token as auth password)

Phase 1 — Attendee web PWA (React + Vite + TS):
- Login via QR token + email (GoTrue, no email sent)
- Home, Agenda, Scan/Connect, staff Check-in, Feedback, live Leaderboard, Profile
- Same-origin proxy to Supabase (Vite dev / nginx in Docker)
- Docker: multi-stage build -> nginx sidecar on the Supabase network
This commit is contained in:
Lago committed 2026-08-22 16:10:59 +02:00
commit 37684ba116
45 files changed
+6922

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
import type { Slot } from './types';
/** The event day (from the seed). All slot times are on this date. */
export const EVENT_DATE = '2026-10-23';
/** Simulated "now" used for the demo (matches the mockup: 10:20 on event day). */
export const DEFAULT_NOW = new Date(`${EVENT_DATE}T10:20:00`);
export type SlotStatus = 'done' | 'now' | 'next';
function at(dateStr: string, time: string): Date {
return new Date(`${dateStr}T${time}`);
}
export function slotStart(slot: Slot): Date {
return at(slot.slot_date, slot.start_time);
}
export function slotEnd(slot: Slot): Date {
return at(slot.slot_date, slot.end_time);
}
export function slotStatus(slot: Slot, now: Date): SlotStatus {
if (now >= slotEnd(slot)) return 'done';
if (now >= slotStart(slot)) return 'now';
return 'next';
}
/** "09:00" from "09:00:00". */
export function fmtTime(time: string): string {
return time.slice(0, 5);
}
export function fmtRange(slot: Slot): string {
return `${fmtTime(slot.start_time)}–${fmtTime(slot.end_time)}`;
}
export function greeting(now: Date): string {
const h = now.getHours();
if (h < 12) return 'Good morning';
if (h < 18) return 'Good afternoon';
return 'Good evening';
}