commit 63aa4ecfc8c6a58afae0cebddc55730799f20e80 Author: Jose Lago Date: Sat Aug 22 16:10:59 2026 +0200 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 Co-authored-by: Stephan Charles Co-authored-by: Amelia Hernandez Co-authored-by: Markus Franz Co-authored-by: Sabrina Hota Co-authored-by: NilΓΌfer Doğan diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef4468f --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +# Dependencies +node_modules/ + +# Builds +dist/ +build/ +*.tsbuildinfo + +# Environment (keep the example) +.env +.env.* +!.env.example + +# Supabase CLI local state (generated on `supabase start`) +supabase/.temp/ +supabase/.branches/ + +# Logs +*.log +npm-debug.log* + +# OS / editor +.DS_Store +Thumbs.db +.vscode/ +.idea/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..c838d46 --- /dev/null +++ b/README.md @@ -0,0 +1,276 @@ +# Convivo 🎀 + +**Turn a conference into a game.** Convivo is a mobile-first web app (PWA) that gets attendees out of their seats: mark the sessions you want, scan lanyards to make connections, get checked in by staff, and climb the live leaderboard. The whole thing runs on a **Dockerized Supabase core** β€” no custom backend. + +> **Status:** Phase 0 + Phase 1 complete. +> - **Phase 0** β€” Dockerized Supabase core (Postgres + GoTrue + PostgREST + Realtime + Kong + Studio) with the full schema, RLS, and transactional points RPCs. +> - **Phase 1** β€” Attendee web PWA: login (QR + email), Home, Agenda, Scan/Connect, staff Check-in, Feedback, live Leaderboard, Profile. +> +> Next: Phase 2 (Pretix ticketing interface), Phase 3 (Admin app), Phase 4 (Sessionize interface). + +--- + +## 1. The problem + +Conferences are full of people who want to meet each other but don't know how to start. Convivo removes the friction: + +- **No awkward "hi, I'm…"** β€” scanning a lanyard QR starts the conversation for you. +- **No FOMO** β€” you pick one session per slot, so you always know where to be. +- **No invisible networking** β€” every check-in, connection, and review earns points, and the leaderboard makes it fun. + +## 2. Event format + +| | | +|---|---| +| **Date** | Wednesday, 23 October | +| **Hours** | 09:00 – 17:00 | +| **Structure** | 6 slots Γ— 45 minutes, **3 parallel sessions per slot** | +| **Breaks** | 09:45–10:00 Β· coffee 10:45–11:30 Β· lunch 12:15–13:15 Β· 14:45–15:00 Β· closing 15:45–17:00 | + +| Slot | Time | Slot | Time | +|---|---|---|---| +| 1 | 09:00–09:45 | 4 | 13:15–14:00 | +| 2 | 10:00–10:45 | 5 | 14:00–14:45 | +| 3 | 11:30–12:15 | 6 | 15:00–15:45 | + +The schedule is **data-driven** (stored in Postgres), so times and sessions can be changed without an app update. + +> **Demo clock:** the app uses a simulated "now" of `2026-10-23 10:20` so Slot 1 is *done* and Slot 2 is *live* β€” matching the mockup. See `apps/convivo/src/lib/time.ts`. + +## 3. Roles + +| Role | What they can do | +|---|---| +| **Attendee** | Log in, view agenda, mark preferences, scan peers to connect, get checked in, give feedback, view leaderboard | +| **Staff** | Everything an attendee can do, **plus** a Check-in mode: pick a session, scan attendee lanyards to check them in | +| **Admin** | Staff powers **plus** full read/write on all event data (used by the future Admin app) | + +Staff and attendees use the **same app** β€” the role is an attribute on the profile and changes the Scan tab into a Check-in tab. + +## 4. Features + +### 4.1 Login (QR + email) +1. Open the app β†’ **Scan** your own lanyard QR (or type the code). +2. The app resolves the attendee from the QR and asks for your **email to confirm** it's really you. +3. On match β†’ you're in. On mismatch β†’ error, try again. + +**How it works:** the QR token is stored as the Supabase Auth **password** and the email as the **identifier**. Login is a standard `signInWithPassword({ email, password: qrToken })` β€” no custom JWT, no separate backend, and **no email is ever sent** (`enable_confirmations = false`). + +### 4.2 Agenda & preferences +- The agenda shows all 6 slots and their 3 parallel sessions (title, room, speaker, description). +- Attendees mark **one preferred session per slot** (they can change their pick until the slot starts). +- Home shows "Now / Next" based on the current time and the user's picks. + +### 4.3 Connections (the core loop) +1. While logged in, scan **another person's** lanyard QR. +2. A popup appears: *"Connect with Bruno Costa?"* +3. The other person sees the request in **Connections β†’ Requests** and accepts (or rejects). +4. On acceptance, **both** earn points and both see each other in **My connections**. + +### 4.4 Session check-in (staff) +- Staff open the Check-in tab, select the session, and scan attendees' lanyards. +- Each successful check-in awards the attendee points. +- Duplicate scans are rejected with a clear message ("Already checked in β€” no extra points"). + +### 4.5 Feedback +- After a session ends, attendees who were checked in can rate it **1–5 stars** and optionally leave free text. +- Rating only earns a small bonus; adding comments earns more. + +### 4.6 Leaderboard +- All attendees ranked by total points, with a top-3 podium. +- Your own row is highlighted. +- **Live:** the leaderboard table is a Realtime source, so it updates in every open app the moment points change. + +## 5. Points system + +| Action | Points | +|---|---| +| Checked into a session (by staff) | **+10** | +| Connection accepted | **+5 each** (both people) | +| Feedback β€” rating only | **+5** | +| Feedback β€” rating + free text | **+10 total** | + +Points are updated **transactionally** by Postgres RPCs (`security definer`): each RPC updates `profiles.points`, inserts the related row, and re-syncs the `leaderboard` mirror **in a single transaction**. This guarantees the leaderboard is always consistent and that duplicate actions (re-check-in, re-feedback) never double-award. + +## 6. Architecture + +```mermaid +flowchart LR + subgraph Browser + A["Convivo PWA
React + Vite + TS
(mobile-first, installable)"] + end + subgraph Docker + K["Kong (API gateway)
:54321"] + K --> G["GoTrue (Auth)"] + K --> R["PostgREST"] + K --> RT["Realtime"] + K --> S["Storage"] + R --> P[("Postgres 17
schema Β· RLS Β· points RPCs")] + RT --> P + G --> P + end + A -->|"same-origin /auth /rest /realtime"| K +``` + +**Why no custom backend?** Supabase gives us the whole backend as a managed local stack: + +- **Auth** (GoTrue) β€” QR token as password, email as identifier. +- **Data + logic** (Postgres) β€” the schema, **Row Level Security**, and the transactional points RPCs live in the database. The app calls RPCs directly; Postgres enforces who can do what. +- **Realtime** β€” the `leaderboard` table is broadcast to all connected clients. +- **Kong** β€” a single API gateway fronting everything on one port. + +The app talks to Supabase through **same-origin paths** (`/auth`, `/rest`, `/realtime`, `/storage`). In dev, Vite proxies them to the local stack; in Docker, the app's nginx does the same. This avoids CORS entirely. + +### App β†’ Supabase connectivity + +| Path | Proxied to | Purpose | +|---|---|---| +| `/auth/*` | Kong `:54321` | GoTrue login / session | +| `/rest/*` | Kong `:54321` | PostgREST (tables + RPCs) | +| `/realtime/*` | Kong `:54321` | WebSocket (leaderboard) | +| `/storage/*` | Kong `:54321` | Storage (unused in v1) | + +## 7. Data model (Postgres) + +| Table | Key fields | Notes | +|---|---|---| +| `profiles` | id (= auth uid), email (unique), full_name, company, role (attendee/staff/admin), qr_token (unique), points | One row per attendee; id is the Supabase Auth user id | +| `slots` | id, name, start, end | 6 rows for 23 Oct | +| `sessions` | id, title, description, slot_id, room, speakers, capacity | 18 rows (3 per slot) | +| `preferences` | profile_id, session_id, slot_id | Unique per (profile, slot) β€” one pick per slot | +| `connections` | from_id, to_id, status (pending/accepted/rejected), created_at, resolved_at | Unique per unordered pair (via `least`/`greatest` index) | +| `checkins` | profile_id, session_id, staff_id, created_at | Unique per (profile, session) | +| `feedback` | profile_id, session_id, rating (1–5), comment, created_at | Unique per (profile, session); only after session end | +| `leaderboard` | profile_id, full_name, company, points, updated_at | Realtime mirror, kept in sync by the RPCs | +| `points_log` | profile_id, delta, category, created_at | Audit trail powering the per-category breakdown | + +**Key RPCs** (all `security definer`, transactional): `lanyard_lookup`, `set_preference`, `clear_preference`, `create_connection_request`, `accept_connection`, `reject_connection`, `checkin_attendee`, `submit_feedback`, `adjust_points`, `get_agenda`, `get_public_profiles`. + +**RLS:** every table has policies. Profiles are self-or-admin; event tables are scoped to `auth.uid()`; slots/sessions are readable by any authenticated user and writable by admin; the leaderboard is readable by any authenticated user. + +## 8. Tech stack + +| Layer | Choice | Why | +|---|---|---| +| Core | **Supabase (local, Docker)** via the Supabase CLI | Postgres + Auth + REST + Realtime + Storage in one managed stack; RLS + RPCs keep logic in the DB | +| App | **React 18 + Vite 5 + TypeScript** (PWA) | Fast, mobile-first, installable; same-origin proxy avoids CORS | +| QR | `html5-qrcode` (scan) + `qrcode.react` (render) | Camera scan with manual-entry fallback | +| Client | `@supabase/supabase-js` | Auth + REST + Realtime in one client | +| Packaging | **Docker** (multi-stage build β†’ nginx) | The app is a sidecar that joins the Supabase network | + +## 9. Security + +- **No secrets in the app** β€” only the anon key (public by design) ships in the bundle. The service-role key stays server-side. +- **User login** = QR token + email match via GoTrue; the session JWT is short-lived and stored in `localStorage`. +- **QR tokens are opaque** β€” scanning a lanyard reveals no personal data by itself. +- **RLS on every table** β€” the database, not the app, enforces who can read/write what. +- **Transactional points** β€” RPCs make points + related row + leaderboard sync atomic, so there's no race or double-award. + +## 10. Repository layout + +``` +Convivo/ +β”œβ”€ apps/convivo/ # Attendee web PWA (React + Vite + TS) +β”‚ β”œβ”€ Dockerfile # Multi-stage: build β†’ nginx (serves SPA + proxies Supabase) +β”‚ β”œβ”€ nginx.conf.template # SPA + same-origin proxy to the Supabase core +β”‚ └─ src/ # screens, components, lib, context +β”œβ”€ supabase/ +β”‚ β”œβ”€ config.toml # Local stack config (ports, auth, RLS defaults) +β”‚ β”œβ”€ migrations/ # 20260822000000_init.sql β€” schema, RLS, RPCs +β”‚ └─ seed.sql # Slots, sessions, 13 demo users, Ana's demo state +β”œβ”€ docker-compose.yml # Runs the app sidecar on the Supabase network +└─ mockup/index.html # Original interactive mockup (design reference) +``` + +## 11. Getting started + +### Prerequisites +- **Docker** (with the Docker daemon running) +- **Node.js 20+** +- **Supabase CLI** (installed as a devDependency β€” `npx supabase` works out of the box) + +### Option A β€” Dev (Vite dev server) +```bash +# 1. Start the Supabase core (Postgres, Auth, REST, Realtime, Studio, Kong) +npm run db:start + +# 2. (Re)apply migrations + seed, then restart the stack +npm run db:reset + +# 3. Run the app (Vite dev server on :3000, proxies to the core) +npm run app:dev +``` +Open **http://localhost:3000**. Studio is at **http://localhost:54323** (user `postgres`, password `postgres`). + +### Option B β€” Docker (app as a sidecar) +```bash +# 1. Start the Supabase core (creates the supabase_network_Convivo network) +npm run db:start + +# 2. Build + run the app container on :3000 (joins the Supabase network) +docker compose up --build +``` +Open **http://localhost:3000**. The app's nginx proxies the Supabase paths to the Kong container on the shared network. + +> **Reset the demo data at any time:** `npm run db:reset` (re-applies migrations + seed). + +### Ports + +| Service | Port | +|---|---| +| Convivo app | **3000** | +| Supabase API (Kong) | 54321 | +| Supabase Studio | 54323 | +| Postgres | 54322 | +| SMTP (Mailpit) | 54324 | + +## 12. Demo accounts + +Login = **QR code** (typed or scanned) + **email**. The QR token is the password. + +| Person | Role | QR code | Email | +|---|---|---|---| +| **Ana Silva** | attendee | `CVV-ANA-4821` | ana.silva@nubank.com | +| **Bruno Costa** | staff | `CVV-BRU-1177` | bruno.costa@acme.com | +| **Rita Lopes** | staff | `CVV-RIT-9034` | rita.lopes@globant.com | +| **Admin** | admin | `CVV-ADM-0001` | admin@appe.at | +| TomΓ‘s Ribeiro | attendee | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com | +| Sofia Almeida | attendee | `CVV-SOF-2299` | sofia.almeida@loop.com | +| Marco Chen | attendee | `CVV-MRC-7712` | marco.chen@deepmind.com | +| Julia Santos | attendee | `CVV-JUL-3345` | julia.santos@acme.com | +| Pedro Nunes | attendee | `CVV-PED-8801` | pedro.nunes@globant.com | +| Carla Mendes | attendee | `CVV-CAR-6623` | carla.mendes@nubank.com | +| Diego Ferreira | attendee | `CVV-DIE-4458` | diego.ferreira@loop.com | +| Marina Costa | attendee | `CVV-MNA-2210` | marina.costa@dataprev.com | +| Lucas Oliveira | attendee | `CVV-LUC-9987` | lucas.oliveira@deepmind.com | + +**Suggested demo flow:** +1. Log in as **Ana** (attendee) β†’ see Home, Agenda, Leaderboard. +2. Scan **Marco** (`CVV-MRC-7712`) β†’ send a connection request. +3. Log in as **Bruno** (staff) β†’ the Scan tab becomes **Check-in** β†’ pick a session β†’ scan **Carla** (`CVV-CAR-6623`) β†’ she gets +10. +4. Watch the **Leaderboard** update live. + +## 13. Roadmap + +| Phase | Scope | Status | +|---|---|---| +| **0** | Dockerized Supabase core: schema, RLS, transactional points RPCs, seed | βœ… | +| **1** | Attendee web PWA: login, Home, Agenda, Scan/Connect, Check-in, Feedback, Leaderboard, Profile | βœ… | +| **2** | **Pretix** interface β€” sync tickets β†’ attendees (QR tokens, roles) | ⬜ next | +| **3** | **Admin app** (admin.appe.at) β€” manage attendees, sessions, points, event | ⬜ | +| **4** | **Sessionize** interface β€” sync the real agenda (slots, sessions, speakers) | ⬜ | + +> **Subdomains** (`convivo.appe.at`, `admin.appe.at`, `db.appe.at`, `pretix.eu`, `sessionize.com`) do not exist yet β€” everything runs on **localhost** for now. + +## 14. Out of scope (v1) + +- Push notifications (connection requests are seen when the app is opened) +- Multi-day events +- Session capacity enforcement +- i18n / offline mode + +## 15. Open questions + +1. **Schedule times** β€” the 6 slot times above are an assumption; confirm against the real agenda (Phase 4 will pull them from Sessionize). +2. **Connection acceptance** β€” in-app only for v1? (Push notifications would be a later add-on.) +3. **Pretix mapping** β€” which ticket fields map to role (attendee/staff/admin) and company? diff --git a/apps/convivo/.dockerignore b/apps/convivo/.dockerignore new file mode 100644 index 0000000..9b7c8b5 --- /dev/null +++ b/apps/convivo/.dockerignore @@ -0,0 +1,13 @@ +# Keep the Docker build context small and avoid leaking local state. +# NOTE: nginx.conf.template and docker-entrypoint.sh are COPYed by the +# Dockerfile, so they must NOT be excluded here. +node_modules +dist +.env +.env.* +!.env.example +*.tsbuildinfo +.git +.gitignore +Dockerfile +.dockerignore diff --git a/apps/convivo/.env.example b/apps/convivo/.env.example new file mode 100644 index 0000000..79d9d8b --- /dev/null +++ b/apps/convivo/.env.example @@ -0,0 +1,10 @@ +# Supabase local stack. +# +# The app talks to Supabase through SAME-ORIGIN paths (/auth, /rest, /realtime, +# /storage). In dev the Vite server proxies them to the local Supabase stack; +# in Docker the app's nginx does the same. So no URL is needed here β€” the client +# falls back to window.location.origin. Only the anon key is required. +# +# VITE_SUPABASE_URL is intentionally left unset (same-origin). +# The value below is the standard local Supabase anon key (not a secret). +VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0 diff --git a/apps/convivo/Dockerfile b/apps/convivo/Dockerfile new file mode 100644 index 0000000..2c60fbc --- /dev/null +++ b/apps/convivo/Dockerfile @@ -0,0 +1,35 @@ +# Convivo attendee app β€” multi-stage build. +# +# Stage 1 (build): compile the Vite/React/TS app into static assets. +# Stage 2 (serve): nginx serves the static build and proxies the Supabase +# same-origin paths (/auth, /rest, /realtime, /storage) to the Supabase core. +# +# The Supabase core itself is NOT built here β€” it runs via the Supabase CLI +# (`supabase start`) or as a separate container. See the root docker-compose.yml. + +# ---- Build stage ------------------------------------------------------------- +FROM node:20-alpine AS build +WORKDIR /app + +# Install deps first for better layer caching (reproducible via lock file). +COPY package.json package-lock.json ./ +RUN npm ci + +# Copy sources and build. The anon key is baked in at build time (it is not a +# secret β€” it is the standard local Supabase anon key). Override with +# --build-arg VITE_SUPABASE_ANON_KEY=... if you use a custom key. +ARG VITE_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0 +ENV VITE_SUPABASE_ANON_KEY=$VITE_SUPABASE_ANON_KEY +COPY . . +RUN npm run build + +# ---- Serve stage ------------------------------------------------------------- +FROM nginx:1.27-alpine AS serve +# nginx template: serve the SPA + proxy Supabase paths to the core. The proxy +# target is injected at container start (see docker-entrypoint.sh). +COPY nginx.conf.template /etc/nginx/conf.d/default.conf.template +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh +COPY --from=build /app/dist /usr/share/nginx/html +EXPOSE 3000 +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/apps/convivo/docker-entrypoint.sh b/apps/convivo/docker-entrypoint.sh new file mode 100644 index 0000000..214436e --- /dev/null +++ b/apps/convivo/docker-entrypoint.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Convivo app β€” container entrypoint. +# +# Injects the Supabase proxy target into the nginx config template, then starts +# nginx. The target defaults to the Kong container on the shared Supabase +# network (supabase_kong_Convivo:8000 β€” Kong's internal port; 54321 is the +# host-only mapping). Override with SUPABASE_PROXY_TARGET +# (e.g. host.docker.internal:54321) if the core is not on the shared network. +set -eu + +TARGET="${SUPABASE_PROXY_TARGET:-supabase_kong_Convivo:8000}" +TEMPLATE=/etc/nginx/conf.d/default.conf.template +CONF=/etc/nginx/conf.d/default.conf + +echo "[convivo] Proxying Supabase paths to: ${TARGET}" +sed "s|__SUPABASE_PROXY_TARGET__|${TARGET}|g" "${TEMPLATE}" > "${CONF}" + +# Run nginx in the foreground. +exec nginx -g "daemon off;" diff --git a/apps/convivo/index.html b/apps/convivo/index.html new file mode 100644 index 0000000..e305ca9 --- /dev/null +++ b/apps/convivo/index.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + + Convivo + + +
+ + + diff --git a/apps/convivo/nginx.conf.template b/apps/convivo/nginx.conf.template new file mode 100644 index 0000000..057de40 --- /dev/null +++ b/apps/convivo/nginx.conf.template @@ -0,0 +1,77 @@ +# Convivo app β€” nginx server block (template). +# +# Serves the built SPA and proxies the Supabase same-origin paths +# (/auth, /rest, /realtime, /storage) to the Supabase core. +# +# The proxy target is injected at container start by /docker-entrypoint.sh +# from the SUPABASE_PROXY_TARGET env var (default: supabase_kong_Convivo:8000, +# i.e. the Kong container on the shared Supabase network β€” Kong's internal port). +# +# The placeholder __SUPABASE_PROXY_TARGET__ is replaced before nginx starts. + +server { + listen 3000; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types text/plain text/css application/json application/javascript image/svg+xml; + + # SPA fallback: any non-file, non-proxied route serves index.html so the + # client-side router can take over. + location / { + try_files $uri $uri/ /index.html; + } + + # Long-cache immutable build assets. + location /assets/ { + expires 30d; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + # ---- Supabase same-origin proxy ------------------------------------- + # No trailing slash on proxy_pass => the original URI is passed through + # unchanged (e.g. /auth/v1/token -> http:///auth/v1/token). + + location /auth/ { + proxy_pass http://__SUPABASE_PROXY_TARGET__; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /rest/ { + proxy_pass http://__SUPABASE_PROXY_TARGET__; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + # Realtime uses WebSockets β€” enable the upgrade handshake. + location /realtime/ { + proxy_pass http://__SUPABASE_PROXY_TARGET__; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + } + + location /storage/ { + proxy_pass http://__SUPABASE_PROXY_TARGET__; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + client_max_body_size 50M; + } +} diff --git a/apps/convivo/package-lock.json b/apps/convivo/package-lock.json new file mode 100644 index 0000000..805bcb0 --- /dev/null +++ b/apps/convivo/package-lock.json @@ -0,0 +1,1917 @@ +{ + "name": "@convivo/app", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "@convivo/app", + "version": "0.1.0", + "dependencies": { + "@supabase/supabase-js": "^2.45.4", + "html5-qrcode": "^2.3.8", + "qrcode.react": "^4.0.1", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "typescript": "^5.5.4", + "vite": "^5.4.8" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.8.tgz", + "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.8", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.5.tgz", + "integrity": "sha512-jfkGfTwhQpsiSckPF8r9bU3pn3vyd72NlWaO+TgEO6WPSDnUhXzrNYCHBMOYj0ACaUgjm6eERLF+XV9a6RstoA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.5.tgz", + "integrity": "sha512-oGVqyQlxnrz9/ty89oHpU857VUHEl5/Xu4R2lS+aivCTrNnSsbiENzTnNaBsjxH0CNWGPhzHArOLFwo+oKXveA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.5.tgz", + "integrity": "sha512-bW7B8xMEq8n99Q3ieEcPRGuphurdZAaFzQc9Efyyw3FL6DZO6pMy9xhdN+kBoD7Sy05xNXSr4OyPPnpkYriS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.5.tgz", + "integrity": "sha512-YSwBS86QeHOGlrxJ1PSOIZSkzRL/JmKeunhc+lV6M1a6En8QuVCD/T/qIA0J4Gd2Y86RIOBYrLcOUtqGh9+/1w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.5.tgz", + "integrity": "sha512-2fST8lILgl7cKbme/1KDdPCmbXbG+gqoV3bHp19L0ypX/3akYMBVdOunPleRCwonoLnXOZ/0F+Mt/v8POFmfcQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.5.tgz", + "integrity": "sha512-cpIxQCP9J+EVad0a6LO1kY3ZGODlk80VlI+2I96B8xMcdHZ4pLVhfQ49JFpYqjPF91FFkQWftf57YlDcTiw9yQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.5.tgz", + "integrity": "sha512-r9fGh3eFs3e/udWh5ZjXQtxiYK/xoFxQaYR/cELxac/Udkl5Th+IsFm0CX3Kl9hmUH/we7EoMpjJgeQNnE0+IA==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.5.tgz", + "integrity": "sha512-xdvFdp7OM6KLJviJT2g/YuRSUjnZgGHk4RNgwIbN7X6cPugOucV60DdHXWzsBVCUdrGb6qSXnJQrrAKMmQuj3Q==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.5.tgz", + "integrity": "sha512-rRqILAndyzHzP7T9NFQrq+4HFWNhqkqkKur7eiBpfLmz01PO0JKx5Vchu3YllE4YXI/Ftgq/szrDWg5GJ0mI8g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.5.tgz", + "integrity": "sha512-Gf4X3qVMucayUvux6aXXPgXovocSFUC0rrffDuPI/S2nHhNMhjcZxsrAFYCOF350PRreW1XwzFj3CT/3bKsWCw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.5.tgz", + "integrity": "sha512-+s5qA0TNM0qm8PK/a5gt/1Hpx+NV08uSuCncvhziIlQzT6AEV2fnUQo7eBtFTFO0nA9scauvoR2HusfXmQnO4w==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.5.tgz", + "integrity": "sha512-ybb6QvWwWJCbBWqERpc8K3pYVGIrXlG8MEQ8IIuJY6Y9KdHQxoFoNyfkAOtKn1VHu3KuLidXvwrvGR1mEjeWCw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.5.tgz", + "integrity": "sha512-nZb1DtnOyhCmYvsC8A2CwOkopVg+IS1+fPUa7rMOAXtNw5+lLCLLPqd6XAiNrGtoQKsbvIBOwsHnBH/3wnb4HQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.5.tgz", + "integrity": "sha512-yMbj63Sp89ryrXLWyz+sy+fYD2HpOnMCLGbe4Oa1smclFSUukdtD/BgdiHaAetJNb74URD8U4hM+qG5KVzMEkg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.5.tgz", + "integrity": "sha512-mhoan3OJw2kYV/e1jtIdmvUZgyBFeA6zGWsOswmR0Tg19TQbowZuR+JMLID6spbbBN7Zee2ejrgmy3+FxGrIdA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.5.tgz", + "integrity": "sha512-5ZTLmjWbb1VZdjuyhe83K/8QO0/h11midQCBP+X5OYn32ra7eOBoM0ZqtaY4nkgNsYgmdVhMYPoyVPTjUpHf3w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.5.tgz", + "integrity": "sha512-m53kG+br6PGxOTmgBEM2DHSDs9RVjsyEbUwjJPJGTFm1grWOG8EKJggDCTb60unD4Tjby8fi7/m9XfkEWasVWg==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.5.tgz", + "integrity": "sha512-6RHPJR1g/uvdYU8uXBnfq3nlqyZCP82Fr6NHgfGoaIeSh0YEqnX/x6uA9MmJJbnSH7swqX4F+CkGdUF+6doiQA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.5.tgz", + "integrity": "sha512-xs+OXQtEXgpXT0DmA5+U3qnRZHdCST/5HRQxS8wSPZTUZN/EMWeHuSIod32LQklTBZBV9DyfncKBQ8n5V3eFdw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.5.tgz", + "integrity": "sha512-e7hD+sl3s+mcLQDZ8pbudBVsdG6r5yN4w3LqG2TJ8sQHDpblWj5lrJs/3m01Cvlxbt4x13zu5thLjgypgtkYzw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.5.tgz", + "integrity": "sha512-GiyJaCf+WpMub/17aPcKk27QMl5W6f+KhdPTjlFOn5akH5Wa/DCM9Stdx5cDfmasyKB08MqpVQ1uJE2RkkpbXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.5.tgz", + "integrity": "sha512-+OQ8U2DdoEfXl8T4Fb18AjmEwbXMerKDKCL8yCPAYhKCEEKoul7rkbeGCBFCbAlaGaa7pmtRTpkAJM2LE/i5FA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.5.tgz", + "integrity": "sha512-KanvAZrPKbDBFwrgiU9yEVpQoox9QPV1WZOXX7HudJQY+eSlu82CtWxDU8WtuRRvtN5EGkLczkd6Y6DTcvm9wA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.5.tgz", + "integrity": "sha512-1aC3UEWTtRl3RK3VpDJ/Tqk1XI4SLTmXIthAq6wRWo8XiSXJNd+VprJM4/1P4+i6HIaFEFlVi9sTTziniD2tOQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.5.tgz", + "integrity": "sha512-/gDJaRs4gl0NPIwqCz+6PkpmhhjRAD2j6P4rSNHBzUkO3naEx2mIU0pRle1vUNRQ7mE/+8OOeXLTv/J56FKiQg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@supabase/auth-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.112.3.tgz", + "integrity": "sha512-NA0rsgAlWZPvbhw8aUdmgfpHVgUAcd8zK5ov43l++o1bLIPXZhRiAlRobhwF5AatQuovpqxsMH50F4oyyV4XZw==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@supabase/functions-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.112.3.tgz", + "integrity": "sha512-gfv481mTOVWtZIJgXupxZpni2V2UWPf6jeF/jOK7HdMHdH+mt6sU0sHHwf0POsPip8ltlulu9OUHgwVzl5ddRw==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@supabase/phoenix": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/@supabase/phoenix/-/phoenix-0.4.5.tgz", + "integrity": "sha512-aAn9H9ovVyeApKy11OWOrrOGq8DV68yWeH4ud2lN9fzn4aO8Zb5GLL9m1pUg9nLqIcT+ZDfAcsZe0E/nqdv2lw==", + "license": "MIT" + }, + "node_modules/@supabase/postgrest-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-2.112.3.tgz", + "integrity": "sha512-+Mf6uCpzr00bqxwX8hTK2X2L9eAL/1vuOjdEjx6upz9ulb0RmQT16XeU/JkMUlVHw/B46ZnPa2busY4Kd9YCzw==", + "license": "MIT", + "dependencies": { + "tslib": "2.8.1" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@supabase/realtime-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.112.3.tgz", + "integrity": "sha512-E6wljXWs7DUOloyIB69i3YFInWE6IyCvgTAbQ0KYxOHv26FdA1KzEXTuzxrYEdf70t406Z9BRwUlGyclGF2FXA==", + "license": "MIT", + "dependencies": { + "@supabase/phoenix": "0.4.5", + "tslib": "2.8.1" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@supabase/storage-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.112.3.tgz", + "integrity": "sha512-oSK61tzlUvg+BWPqpKQCu9qqonsO26btaoAR9D6Gest2aj7xUqToj9rKyaoYOJczkhg9BjqA1REbYy9tPI4bDA==", + "license": "MIT", + "dependencies": { + "iceberg-js": "^0.8.1", + "tslib": "2.8.1" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/@supabase/supabase-js": { + "version": "2.112.3", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.112.3.tgz", + "integrity": "sha512-Jv1bxVQmEJNkjvPEhFaKjPzsh+Ozyew6lWGD+SoYcsclDEP1z7yEvKvfUQfzy0DkxRIQnZNxmmWtAzw5XLTQoA==", + "license": "MIT", + "dependencies": { + "@supabase/auth-js": "2.112.3", + "@supabase/functions-js": "2.112.3", + "@supabase/postgrest-js": "2.112.3", + "@supabase/realtime-js": "2.112.3", + "@supabase/storage-js": "2.112.3" + }, + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + } + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.17", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.17.tgz", + "integrity": "sha512-KAUDn1OSS0fmPlGO+NOUMRcOQ/b/shUBH3OgkG73mPgdf+JD/BQ6fHboGxNOxnUmlwcq+lLq3dTkayRPuSfXwg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.28.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz", + "integrity": "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.12", + "caniuse-lite": "^1.0.30001809", + "electron-to-chromium": "^1.5.402", + "node-releases": "^2.0.53", + "update-browserslist-db": "^1.3.0" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001809", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001809.tgz", + "integrity": "sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.412", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.412.tgz", + "integrity": "sha512-z4rMe3esBzlzovKHj4gxJnsCGZRK5l4baUvm+gCGJBPE+gsyUMKsuU9tnEUtI1dOebXz1ytAPGjvXhmQ7rIPwA==", + "dev": true, + "license": "ISC" + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/html5-qrcode": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/html5-qrcode/-/html5-qrcode-2.3.8.tgz", + "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==", + "license": "Apache-2.0" + }, + "node_modules/iceberg-js": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/iceberg-js/-/iceberg-js-0.8.1.tgz", + "integrity": "sha512-1dhVQZXhcHje7798IVM+xoo/1ZdVfzOMIc8/rgVSijRK38EDqOJoGula9N/8ZI5RD8QTxNQtK/Gozpr+qUqRRA==", + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.18", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", + "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.53", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.53.tgz", + "integrity": "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.26", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", + "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.17", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/qrcode.react": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-4.2.0.tgz", + "integrity": "sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==", + "license": "ISC", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rollup": { + "version": "4.62.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.5.tgz", + "integrity": "sha512-/tqMfgP7GPA3PHhCmuiS4vIjrSVhHLgY++i+dhbG462euyAj7FpM4D9uq1X3BgjlqRdpcOrYhcQtfiQLNc8tqw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.62.5", + "@rollup/rollup-android-arm64": "4.62.5", + "@rollup/rollup-darwin-arm64": "4.62.5", + "@rollup/rollup-darwin-x64": "4.62.5", + "@rollup/rollup-freebsd-arm64": "4.62.5", + "@rollup/rollup-freebsd-x64": "4.62.5", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.5", + "@rollup/rollup-linux-arm-musleabihf": "4.62.5", + "@rollup/rollup-linux-arm64-gnu": "4.62.5", + "@rollup/rollup-linux-arm64-musl": "4.62.5", + "@rollup/rollup-linux-loong64-gnu": "4.62.5", + "@rollup/rollup-linux-loong64-musl": "4.62.5", + "@rollup/rollup-linux-ppc64-gnu": "4.62.5", + "@rollup/rollup-linux-ppc64-musl": "4.62.5", + "@rollup/rollup-linux-riscv64-gnu": "4.62.5", + "@rollup/rollup-linux-riscv64-musl": "4.62.5", + "@rollup/rollup-linux-s390x-gnu": "4.62.5", + "@rollup/rollup-linux-x64-gnu": "4.62.5", + "@rollup/rollup-linux-x64-musl": "4.62.5", + "@rollup/rollup-openbsd-x64": "4.62.5", + "@rollup/rollup-openharmony-arm64": "4.62.5", + "@rollup/rollup-win32-arm64-msvc": "4.62.5", + "@rollup/rollup-win32-ia32-msvc": "4.62.5", + "@rollup/rollup-win32-x64-gnu": "4.62.5", + "@rollup/rollup-win32-x64-msvc": "4.62.5", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.1.tgz", + "integrity": "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/apps/convivo/package.json b/apps/convivo/package.json new file mode 100644 index 0000000..006c837 --- /dev/null +++ b/apps/convivo/package.json @@ -0,0 +1,25 @@ +{ + "name": "@convivo/app", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@supabase/supabase-js": "^2.45.4", + "html5-qrcode": "^2.3.8", + "qrcode.react": "^4.0.1", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@types/react": "^18.3.5", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.1", + "typescript": "^5.5.4", + "vite": "^5.4.8" + } +} diff --git a/apps/convivo/public/favicon.svg b/apps/convivo/public/favicon.svg new file mode 100644 index 0000000..65fa75d --- /dev/null +++ b/apps/convivo/public/favicon.svg @@ -0,0 +1,10 @@ + + + + + + + + + C + diff --git a/apps/convivo/public/icon-192.png b/apps/convivo/public/icon-192.png new file mode 100644 index 0000000..8c1e1f9 Binary files /dev/null and b/apps/convivo/public/icon-192.png differ diff --git a/apps/convivo/public/icon-512.png b/apps/convivo/public/icon-512.png new file mode 100644 index 0000000..54772a4 Binary files /dev/null and b/apps/convivo/public/icon-512.png differ diff --git a/apps/convivo/public/manifest.webmanifest b/apps/convivo/public/manifest.webmanifest new file mode 100644 index 0000000..a96cfca --- /dev/null +++ b/apps/convivo/public/manifest.webmanifest @@ -0,0 +1,13 @@ +{ + "name": "Convivo", + "short_name": "Convivo", + "description": "Turn a conference into a game. Scan, connect, climb the leaderboard.", + "start_url": "/", + "display": "standalone", + "background_color": "#f0f2f6", + "theme_color": "#d50000", + "icons": [ + { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" }, + { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" } + ] +} diff --git a/apps/convivo/src/App.tsx b/apps/convivo/src/App.tsx new file mode 100644 index 0000000..bdf5321 --- /dev/null +++ b/apps/convivo/src/App.tsx @@ -0,0 +1,94 @@ +import { useState } from 'react'; +import { AuthProvider, useAuth } from './context/AuthContext'; +import { ToastProvider } from './context/ToastContext'; +import { Login } from './screens/Login'; +import { Home } from './screens/Home'; +import { Agenda } from './screens/Agenda'; +import { Scan } from './screens/Scan'; +import { Connections } from './screens/Connections'; +import { Leaderboard } from './screens/Leaderboard'; +import { Profile } from './screens/Profile'; +import { Feedback } from './screens/Feedback'; +import { Spinner } from './components/ui'; + +type Tab = 'home' | 'agenda' | 'scan' | 'connections' | 'profile' | 'leaderboard'; +const TABS: { id: Tab; ico: string; label: string }[] = [ + { id: 'home', ico: '🏠', label: 'Home' }, + { id: 'agenda', ico: 'πŸ“…', label: 'Agenda' }, + { id: 'scan', ico: 'πŸ“·', label: 'Scan' }, + { id: 'connections', ico: '🀝', label: 'Connect' }, + { id: 'profile', ico: 'πŸ‘€', label: 'Profile' }, +]; + +function Shell() { + const { session, profile, loading } = useAuth(); + const [tab, setTab] = useState('home'); + const [feedbackSession, setFeedbackSession] = useState(null); + + if (loading) { + return ( +
+
+ +
+
+ ); + } + + if (!session || !profile) { + return ( +
+ +
+ ); + } + + // Feedback is a full-screen takeover (no tab bar). + if (feedbackSession) { + return ( +
+ { setFeedbackSession(null); setTab('home'); }} /> +
+ ); + } + + const scanLabel = profile.role === 'staff' || profile.role === 'admin' ? 'Check-in' : 'Scan'; + + return ( +
+ {tab === 'home' && setTab(t as Tab)} />} + {tab === 'agenda' && setFeedbackSession(id)} />} + {tab === 'scan' && } + {tab === 'connections' && } + {tab === 'profile' && } + {tab === 'leaderboard' && } + + +
+ ); +} + +export default function App() { + return ( + + + + + + ); +} diff --git a/apps/convivo/src/components/ui.tsx b/apps/convivo/src/components/ui.tsx new file mode 100644 index 0000000..1749a17 --- /dev/null +++ b/apps/convivo/src/components/ui.tsx @@ -0,0 +1,152 @@ +import { useEffect, useRef, useState, type ReactNode } from 'react'; +import { QRCodeSVG } from 'qrcode.react'; +import { Html5Qrcode } from 'html5-qrcode'; + +const AV_COLORS = ['#d50000', '#20b2aa', '#e11d48', '#0d9488', '#f59e0b', '#0ea5e9', '#dc2626', '#7c3aed', '#16a34a', '#ea580c', '#0891b2', '#db2777']; + +export function initials(name: string): string { + return name.split(' ').map((w) => w[0]).slice(0, 2).join('').toUpperCase(); +} + +export function avColor(seed: string): string { + let h = 0; + for (const c of seed) h = (h * 31 + c.charCodeAt(0)) >>> 0; + return AV_COLORS[h % AV_COLORS.length]; +} + +export function Avatar({ name, id, size = 44, fs = 15 }: { name: string; id: string; size?: number; fs?: number }) { + return ( + + {initials(name)} + + ); +} + +export function Spinner() { + return ; +} + +export function Empty({ icon, text }: { icon: string; text: string }) { + return ( +
+
{icon}
+ {text} +
+ ); +} + +/** Bottom-sheet modal. */ +export function Sheet({ open, onClose, children }: { open: boolean; onClose: () => void; children: ReactNode }) { + if (!open) return null; + return ( +
e.target === e.currentTarget && onClose()}> +
+
+ {children} +
+
+ ); +} + +/** Render a string (e.g. a QR token) as a scannable QR code. */ +export function QrImage({ value, size = 180 }: { value: string; size?: number }) { + return ( +
+ +
+ ); +} + +/** + * Camera QR scanner with a manual-entry fallback. Calls onResult with the + * decoded text. The camera only works on a secure context (https or localhost); + * the manual field always works. + */ +export function Scanner({ onResult, label = 'Scan a lanyard QR' }: { onResult: (text: string) => void; label?: string }) { + const [manual, setManual] = useState(''); + const [camError, setCamError] = useState(null); + const scannerRef = useRef(null); + const [camOn, setCamOn] = useState(false); + + useEffect(() => { + let cancelled = false; + const el = document.getElementById('qr-reader'); + if (!el) return; + + // Camera requires a secure context + a real device. Fall back to manual + // entry (always available) when it's not usable. + const hasCamera = + typeof navigator !== 'undefined' && + !!navigator.mediaDevices && + typeof navigator.mediaDevices.getUserMedia === 'function'; + if (!hasCamera) { + setCamError('Camera unavailable β€” type the code below'); + return; + } + + let scanner: Html5Qrcode | null = null; + try { + scanner = new Html5Qrcode('qr-reader'); + scannerRef.current = scanner; + scanner + .start( + { facingMode: 'environment' }, + { fps: 10, qrbox: { width: 220, height: 220 } }, + (text) => { + if (cancelled) return; + setCamOn(false); + scanner?.stop().catch(() => {}); + onResult(text); + }, + () => {}, + ) + .then(() => { + if (!cancelled) setCamOn(true); + }) + .catch((err) => { + if (!cancelled) setCamError(typeof err === 'string' ? err : 'Camera unavailable'); + }); + } catch { + if (!cancelled) setCamError('Camera unavailable β€” type the code below'); + } + + return () => { + cancelled = true; + try { + scanner?.stop().catch(() => {}); + } catch { + /* ignore */ + } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ( +
+
+ + + + +
+ {!camOn && !camError &&
} + {camError && ( +
+ {label} +
+ )} +
+
+ setManual(e.target.value)} + /> + +
+
+ ); +} diff --git a/apps/convivo/src/context/AuthContext.tsx b/apps/convivo/src/context/AuthContext.tsx new file mode 100644 index 0000000..47876f2 --- /dev/null +++ b/apps/convivo/src/context/AuthContext.tsx @@ -0,0 +1,71 @@ +import { createContext, useCallback, useContext, useEffect, useMemo, useState, type ReactNode } from 'react'; +import type { Session as SbSession, User } from '@supabase/supabase-js'; +import { supabase } from '../lib/supabase'; +import type { Profile } from '../lib/types'; + +interface AuthContextValue { + session: SbSession | null; + user: User | null; + profile: Profile | null; + loading: boolean; + refreshProfile: () => Promise; + signOut: () => Promise; +} + +const AuthContext = createContext(null); + +export function AuthProvider({ children }: { children: ReactNode }) { + const [session, setSession] = useState(null); + const [profile, setProfile] = useState(null); + const [loading, setLoading] = useState(true); + + const loadProfile = useCallback(async (userId: string) => { + const { data, error } = await supabase.from('profiles').select('*').eq('id', userId).maybeSingle(); + if (error) { + console.error('Failed to load profile', error); + return; + } + setProfile((data as Profile) ?? null); + }, []); + + useEffect(() => { + let active = true; + supabase.auth.getSession().then(({ data }) => { + if (!active) return; + setSession(data.session); + if (data.session?.user) void loadProfile(data.session.user.id); + setLoading(false); + }); + const { data: sub } = supabase.auth.onAuthStateChange((_event, newSession) => { + setSession(newSession); + if (newSession?.user) void loadProfile(newSession.user.id); + else setProfile(null); + }); + return () => { + active = false; + sub.subscription.unsubscribe(); + }; + }, [loadProfile]); + + const refreshProfile = useCallback(async () => { + if (session?.user) await loadProfile(session.user.id); + }, [session, loadProfile]); + + const signOut = useCallback(async () => { + await supabase.auth.signOut(); + setProfile(null); + }, []); + + const value = useMemo( + () => ({ session, user: session?.user ?? null, profile, loading, refreshProfile, signOut }), + [session, profile, loading, refreshProfile, signOut], + ); + + return {children}; +} + +export function useAuth(): AuthContextValue { + const ctx = useContext(AuthContext); + if (!ctx) throw new Error('useAuth must be used within AuthProvider'); + return ctx; +} diff --git a/apps/convivo/src/context/ToastContext.tsx b/apps/convivo/src/context/ToastContext.tsx new file mode 100644 index 0000000..7455ad4 --- /dev/null +++ b/apps/convivo/src/context/ToastContext.tsx @@ -0,0 +1,36 @@ +import { createContext, useCallback, useContext, useRef, useState, type ReactNode } from 'react'; + +type ToastType = '' | 'ok' | 'err'; +interface ToastContextValue { + toast: (msg: string, type?: ToastType) => void; +} + +const ToastContext = createContext(null); + +export function ToastProvider({ children }: { children: ReactNode }) { + const [msg, setMsg] = useState(''); + const [type, setType] = useState(''); + const [show, setShow] = useState(false); + const timer = useRef(undefined); + + const toast = useCallback((text: string, t: ToastType = '') => { + setMsg(text); + setType(t); + setShow(true); + window.clearTimeout(timer.current); + timer.current = window.setTimeout(() => setShow(false), 2600); + }, []); + + return ( + + {children} +
{msg}
+
+ ); +} + +export function useToast(): ToastContextValue { + const ctx = useContext(ToastContext); + if (!ctx) throw new Error('useToast must be used within ToastProvider'); + return ctx; +} diff --git a/apps/convivo/src/lib/api.ts b/apps/convivo/src/lib/api.ts new file mode 100644 index 0000000..ff804e3 --- /dev/null +++ b/apps/convivo/src/lib/api.ts @@ -0,0 +1,129 @@ +import { supabase } from './supabase'; +import type { + AgendaRow, + CheckinResult, + Connection, + Feedback, + FeedbackResult, + LeaderboardRow, + PointsLogRow, + Preference, + PublicProfile, + Session, + Slot, +} from './types'; + +export class ApiError extends Error {} + +async function rpc(fn: string, args: Record): Promise { + const { data, error } = await supabase.rpc(fn, args); + if (error) throw new ApiError(error.message); + return data as T; +} + +/** Resolve a scanned lanyard QR token to a public profile (pre-login + connect). */ +export async function lanyardLookup(qrToken: string): Promise { + const rows = await rpc('lanyard_lookup', { p_qr_token: qrToken }); + return rows && rows.length > 0 ? rows[0] : null; +} + +export async function getPublicProfiles(): Promise { + return rpc('get_public_profiles', {}); +} + +export async function getAgenda(): Promise { + return rpc('get_agenda', {}); +} + +/** Group the flat agenda rows into slots with their sessions. */ +export function groupAgenda(rows: AgendaRow[]): { slot: Slot; sessions: Session[] }[] { + const map = new Map(); + for (const r of rows) { + let entry = map.get(r.slot_id); + if (!entry) { + entry = { + slot: { id: r.slot_id, name: r.slot_name, slot_date: r.slot_date, start_time: r.start_time, end_time: r.end_time }, + sessions: [], + }; + map.set(r.slot_id, entry); + } + if (r.session_id && r.title) { + entry.sessions.push({ + id: r.session_id, + title: r.title, + description: r.description, + slot_id: r.slot_id, + room: r.room, + capacity: r.capacity, + speakers: r.speakers, + }); + } + } + return [...map.values()].sort((a, b) => a.slot.id - b.slot.id); +} + +export async function getMyPreferences(): Promise { + const { data, error } = await supabase.from('preferences').select('*').order('slot_id'); + if (error) throw new ApiError(error.message); + return data as Preference[]; +} + +export async function setPreference(sessionId: string): Promise { + await rpc('set_preference', { p_session_id: sessionId }); +} + +export async function clearPreference(slotId: number): Promise { + await rpc('clear_preference', { p_slot_id: slotId }); +} + +export async function getMyConnections(): Promise { + const { data, error } = await supabase.from('connections').select('*').order('created_at', { ascending: false }); + if (error) throw new ApiError(error.message); + return data as Connection[]; +} + +export async function createConnectionRequest(targetQr: string): Promise { + return rpc('create_connection_request', { p_target_qr: targetQr }); +} + +export async function acceptConnection(id: string): Promise { + return rpc('accept_connection', { p_connection_id: id }); +} + +export async function rejectConnection(id: string): Promise { + return rpc('reject_connection', { p_connection_id: id }); +} + +export async function getMyCheckins(): Promise { + const { data, error } = await supabase.from('checkins').select('session_id'); + if (error) throw new ApiError(error.message); + return (data as { session_id: string }[]).map((c) => c.session_id); +} + +export async function checkinAttendee(sessionId: string, attendeeQr: string): Promise { + const rows = await rpc('checkin_attendee', { p_session_id: sessionId, p_attendee_qr: attendeeQr }); + return rows[0]; +} + +export async function getMyFeedback(): Promise { + const { data, error } = await supabase.from('feedback').select('*'); + if (error) throw new ApiError(error.message); + return data as Feedback[]; +} + +export async function submitFeedback(sessionId: string, rating: number, comment: string): Promise { + const rows = await rpc('submit_feedback', { p_session_id: sessionId, p_rating: rating, p_comment: comment }); + return rows[0]; +} + +export async function getLeaderboard(): Promise { + const { data, error } = await supabase.from('leaderboard').select('*').order('points', { ascending: false }); + if (error) throw new ApiError(error.message); + return data as LeaderboardRow[]; +} + +export async function getMyPointsLog(): Promise { + const { data, error } = await supabase.from('points_log').select('*').order('created_at', { ascending: false }); + if (error) throw new ApiError(error.message); + return data as PointsLogRow[]; +} diff --git a/apps/convivo/src/lib/supabase.ts b/apps/convivo/src/lib/supabase.ts new file mode 100644 index 0000000..66b9cce --- /dev/null +++ b/apps/convivo/src/lib/supabase.ts @@ -0,0 +1,23 @@ +import { createClient } from '@supabase/supabase-js'; + +// The app talks to Supabase through same-origin paths (/auth, /rest, /realtime, +// /storage). In dev the Vite server proxies them to the local Supabase stack; +// in Docker the app's nginx does the same. This avoids CORS entirely. +const url = import.meta.env.VITE_SUPABASE_URL || window.location.origin; +const anonKey = import.meta.env.VITE_SUPABASE_ANON_KEY; + +if (!anonKey) { + // Fail fast with a clear message if the anon key is missing. + console.warn('[convivo] VITE_SUPABASE_ANON_KEY is not set.'); +} + +export const supabase = createClient(url, anonKey, { + auth: { + persistSession: true, + autoRefreshToken: true, + detectSessionInUrl: false, + }, + realtime: { + params: { eventsPerSecond: 10 }, + }, +}); diff --git a/apps/convivo/src/lib/time.ts b/apps/convivo/src/lib/time.ts new file mode 100644 index 0000000..ec3a9ca --- /dev/null +++ b/apps/convivo/src/lib/time.ts @@ -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'; +} diff --git a/apps/convivo/src/lib/types.ts b/apps/convivo/src/lib/types.ts new file mode 100644 index 0000000..d44bbe9 --- /dev/null +++ b/apps/convivo/src/lib/types.ts @@ -0,0 +1,119 @@ +export type Role = 'attendee' | 'staff' | 'admin'; + +export interface Profile { + id: string; + email: string; + full_name: string; + company: string | null; + role: Role; + qr_token: string | null; + points: number; + created_at: string; +} + +/** Public projection of a profile (no email / qr_token). */ +export interface PublicProfile { + id: string; + full_name: string; + company: string | null; + role: Role; + points: number; +} + +export interface Slot { + id: number; + name: string; + slot_date: string; + start_time: string; + end_time: string; +} + +export interface Session { + id: string; + title: string; + description: string | null; + slot_id: number; + room: string | null; + capacity: number | null; + speakers: string | null; +} + +/** Row shape returned by the get_agenda() RPC (slots with nested sessions). */ +export interface AgendaRow { + slot_id: number; + slot_name: string; + slot_date: string; + start_time: string; + end_time: string; + session_id: string | null; + title: string | null; + description: string | null; + room: string | null; + capacity: number | null; + speakers: string | null; +} + +export interface Preference { + id: string; + profile_id: string; + session_id: string; + slot_id: number; +} + +export type ConnectionStatus = 'pending' | 'accepted' | 'rejected'; + +export interface Connection { + id: string; + from_id: string; + to_id: string; + status: ConnectionStatus; + created_at: string; + resolved_at: string | null; +} + +export interface Checkin { + id: string; + profile_id: string; + session_id: string; + staff_id: string; + created_at: string; +} + +export interface Feedback { + id: string; + profile_id: string; + session_id: string; + rating: number; + comment: string | null; + created_at: string; +} + +export interface LeaderboardRow { + profile_id: string; + full_name: string; + company: string | null; + points: number; + updated_at: string; +} + +export interface PointsLogRow { + id: string; + profile_id: string; + delta: number; + category: 'checkin' | 'connection' | 'feedback' | 'admin'; + created_at: string; +} + +export interface CheckinResult { + checkin_id: string; + attendee_id: string; + attendee_name: string; + points: number; + already: boolean; +} + +export interface FeedbackResult { + feedback_id: string; + points: number; + earned: number; +} diff --git a/apps/convivo/src/lib/useEvent.ts b/apps/convivo/src/lib/useEvent.ts new file mode 100644 index 0000000..455300b --- /dev/null +++ b/apps/convivo/src/lib/useEvent.ts @@ -0,0 +1,47 @@ +import { useEffect, useState } from 'react'; +import { getAgenda, groupAgenda } from './api'; +import { DEFAULT_NOW } from './time'; +import type { Session, Slot } from './types'; + +export interface EventData { + slots: { slot: Slot; sessions: Session[] }[]; + sessionById: Map; + slotById: Map; + now: Date; + loading: boolean; + error: string | null; +} + +/** Loads the agenda once and exposes it grouped by slot, plus the event clock. */ +export function useEvent(): EventData { + const [slots, setSlots] = useState<{ slot: Slot; sessions: Session[] }[]>([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useEffect(() => { + let active = true; + (async () => { + try { + const rows = await getAgenda(); + if (!active) return; + setSlots(groupAgenda(rows)); + } catch (e) { + if (active) setError(e instanceof Error ? e.message : 'Failed to load agenda'); + } finally { + if (active) setLoading(false); + } + })(); + return () => { + active = false; + }; + }, []); + + const sessionById = new Map(); + const slotById = new Map(); + for (const { slot, sessions } of slots) { + slotById.set(slot.id, slot); + for (const s of sessions) sessionById.set(s.id, s); + } + + return { slots, sessionById, slotById, now: DEFAULT_NOW, loading, error }; +} diff --git a/apps/convivo/src/main.tsx b/apps/convivo/src/main.tsx new file mode 100644 index 0000000..8f7da6f --- /dev/null +++ b/apps/convivo/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import App from './App'; +import './styles.css'; + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/apps/convivo/src/screens/Agenda.tsx b/apps/convivo/src/screens/Agenda.tsx new file mode 100644 index 0000000..18c35af --- /dev/null +++ b/apps/convivo/src/screens/Agenda.tsx @@ -0,0 +1,159 @@ +import { useEffect, useState } from 'react'; +import { useEvent } from '../lib/useEvent'; +import { clearPreference, getMyCheckins, getMyPreferences, setPreference } from '../lib/api'; +import { fmtRange, slotStatus } from '../lib/time'; +import type { Preference, Session } from '../lib/types'; +import { Sheet, Spinner } from '../components/ui'; +import { useToast } from '../context/ToastContext'; + +export function Agenda({ openFeedback }: { openFeedback: (sessionId: string) => void }) { + const { slots, now, loading } = useEvent(); + const [prefs, setPrefs] = useState([]); + const [checkins, setCheckins] = useState([]); + const [selected, setSelected] = useState(null); + const { toast } = useToast(); + + useEffect(() => { + let active = true; + (async () => { + try { + const [p, c] = await Promise.all([getMyPreferences(), getMyCheckins()]); + if (!active) return; + setPrefs(p); + setCheckins(c); + } catch { + /* non-fatal */ + } + })(); + return () => { + active = false; + }; + }, []); + + if (loading) { + return ( +
+
+ +
+
+ ); + } + + const pickFor = (slotId: number) => prefs.find((p) => p.slot_id === slotId)?.session_id; + + async function togglePick(slotId: number, sessionId: string) { + const current = pickFor(slotId); + try { + if (current === sessionId) { + await clearPreference(slotId); + toast('Pick removed'); + } else { + await setPreference(sessionId); + toast('Pick saved βœ“', 'ok'); + } + const p = await getMyPreferences(); + setPrefs(p); + } catch (e) { + toast(e instanceof Error ? e.message : 'Could not update pick', 'err'); + } + } + + const selSlot = selected ? slots.find((s) => s.slot.id === selected.slot_id)?.slot : undefined; + const selStatus = selSlot ? slotStatus(selSlot, now) : 'next'; + const selCheckedIn = selected ? checkins.includes(selected.id) : false; + + return ( +
+
+
+
Agenda
+
Wed 23 Oct Β· 09:00–17:00
+
+ 6 slots Β· 3 tracks +
+
+ Pick one session per slot β€” you can change until the slot starts. +
+ +
+ {slots.map(({ slot, sessions }) => { + const status = slotStatus(slot, now); + return ( +
+
+
+
{slot.name}
+
{fmtRange(slot)}
+
+ {status === 'done' && Done} + {status === 'now' && ● Live} + {status === 'next' && Up next} +
+ {sessions.map((s) => { + const picked = pickFor(slot.id) === s.id; + return ( + + ); + })} +
+ ); + })} +
+ + setSelected(null)}> + {selected && selSlot && ( + <> +
+
+

{selected.title}

+
+ {selSlot.name} Β· {fmtRange(selSlot)} Β· {selected.room} +
+
+ +
+
+ {selected.description} +
+
+ 🎀 {selected.speakers} + {selected.capacity && πŸ‘₯ {selected.capacity}} + {selCheckedIn && βœ“ Checked in} +
+
+ {selStatus === 'done' && selCheckedIn && ( + + )} + {selStatus === 'done' && !selCheckedIn && ( +
+ You weren’t checked in to this session. +
+ )} + +
+ + )} +
+
+ ); +} diff --git a/apps/convivo/src/screens/Connections.tsx b/apps/convivo/src/screens/Connections.tsx new file mode 100644 index 0000000..6e700b9 --- /dev/null +++ b/apps/convivo/src/screens/Connections.tsx @@ -0,0 +1,131 @@ +import { useCallback, useEffect, useState } from 'react'; +import { useAuth } from '../context/AuthContext'; +import { acceptConnection, getMyConnections, getPublicProfiles, rejectConnection } from '../lib/api'; +import type { Connection, PublicProfile } from '../lib/types'; +import { Avatar, Empty, Spinner } from '../components/ui'; +import { useToast } from '../context/ToastContext'; + +export function Connections() { + const { profile } = useAuth(); + const [tab, setTab] = useState<'mine' | 'req'>('mine'); + const [conns, setConns] = useState([]); + const [people, setPeople] = useState>(new Map()); + const [loading, setLoading] = useState(true); + const { toast } = useToast(); + + const load = useCallback(async () => { + try { + const [c, p] = await Promise.all([getMyConnections(), getPublicProfiles()]); + setConns(c); + setPeople(new Map(p.map((x) => [x.id, x]))); + } catch { + /* non-fatal */ + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + void load(); + }, [load]); + + if (!profile) return null; + const me = profile.id; + const nameOf = (id: string) => people.get(id)?.full_name ?? '…'; + const companyOf = (id: string) => people.get(id)?.company ?? ''; + + const accepted = conns.filter((c) => c.status === 'accepted'); + const incoming = conns.filter((c) => c.status === 'pending' && c.to_id === me); + const outgoing = conns.filter((c) => c.status === 'pending' && c.from_id === me); + + async function resolve(id: string, accept: boolean) { + try { + if (accept) await acceptConnection(id); + else await rejectConnection(id); + toast(accept ? 'Connected! +5 pts 🀝' : 'Request declined', accept ? 'ok' : ''); + await load(); + } catch (e) { + toast(e instanceof Error ? e.message : 'Could not update request', 'err'); + } + } + + if (loading) { + return ( +
+
+ +
+
+ ); + } + + return ( +
+
Connections
+
+ + +
+ + {tab === 'mine' && + (accepted.length === 0 ? ( + + ) : ( + accepted.map((c) => { + const otherId = c.from_id === me ? c.to_id : c.from_id; + return ( +
+ +
+
{nameOf(otherId)}
+
{companyOf(otherId)}
+
+ Connected +
+ ); + }) + ))} + + {tab === 'req' && ( +
+ {incoming.length === 0 && outgoing.length === 0 && ( + + )} + {incoming.length > 0 && ( +
+
Incoming
+ {incoming.map((c) => ( +
+ +
+
{nameOf(c.from_id)}
+
{companyOf(c.from_id)}
+
+ + +
+ ))} +
+ )} + {outgoing.length > 0 && ( +
+
Sent
+ {outgoing.map((c) => ( +
+ +
+
{nameOf(c.to_id)}
+
{companyOf(c.to_id)}
+
+ Pending +
+ ))} +
+ )} +
+ )} +
+ ); +} diff --git a/apps/convivo/src/screens/Feedback.tsx b/apps/convivo/src/screens/Feedback.tsx new file mode 100644 index 0000000..788c62b --- /dev/null +++ b/apps/convivo/src/screens/Feedback.tsx @@ -0,0 +1,105 @@ +import { useEffect, useState } from 'react'; +import { useAuth } from '../context/AuthContext'; +import { useEvent } from '../lib/useEvent'; +import { getMyFeedback, submitFeedback } from '../lib/api'; +import { fmtRange } from '../lib/time'; +import { Spinner } from '../components/ui'; +import { useToast } from '../context/ToastContext'; + +export function Feedback({ sessionId, onDone }: { sessionId: string; onDone: () => void }) { + const { refreshProfile } = useAuth(); + const { sessionById, slotById, loading } = useEvent(); + const [rating, setRating] = useState(0); + const [comment, setComment] = useState(''); + const [existing, setExisting] = useState<{ rating: number; comment: string | null } | null>(null); + const [busy, setBusy] = useState(false); + const [done, setDone] = useState<{ earned: number } | null>(null); + const { toast } = useToast(); + + const session = sessionById.get(sessionId); + const slot = session ? slotById.get(session.slot_id) : undefined; + + useEffect(() => { + let active = true; + (async () => { + try { + const fb = await getMyFeedback(); + const mine = fb.find((f) => f.session_id === sessionId); + if (active && mine) setExisting({ rating: mine.rating, comment: mine.comment }); + } catch { + /* non-fatal */ + } + })(); + return () => { + active = false; + }; + }, [sessionId]); + + if (loading || !session || !slot) { + return ( +
+
+ +
+
+ ); + } + + async function submit() { + if (rating < 1) return; + setBusy(true); + try { + const res = await submitFeedback(sessionId, rating, comment.trim()); + await refreshProfile(); + setDone({ earned: res.earned }); + } catch (e) { + toast(e instanceof Error ? e.message : 'Could not submit feedback', 'err'); + } finally { + setBusy(false); + } + } + + if (done) { + return ( +
+
+
πŸŽ‰
+

{done.earned > 0 ? `+${done.earned} pts earned!` : 'Feedback updated!'}

+

Thanks for the feedback β€” it helps everyone pick better sessions.

+ +
+
+ ); + } + + return ( +
+ +
+
{slot.name} Β· {fmtRange(slot)} Β· {session.room}
+
{session.title}
+
How was it? ⭐
+
+ {[1, 2, 3, 4, 5].map((n) => ( + + ))} +
+
+ {rating > 0 ? `${rating} star${rating > 1 ? 's' : ''}` : 'Tap a star'} +
+ +
Rating: +5 pts Β· With comments: +10 pts
+
+ +
+ + + + +
+
+
+
Leaderboard
+
All attendees Β· by points
+
+ ● Live +
+
+
+ + +
+
Profile
+
+ +
+
+
+ + +
+
+
+
My QR code
+
+
Show this to staff for session check-in
and to peers to make a connection.
+
+
+
Points breakdown
+
+
+ +
+ + +
+
+
+
+
+

+
+
+ +
+
+
+
+
+
+ + +
+
+
+ +

+
+
+
+
+ + +
+
+
+ +

+
+
+
+
+ + + + +
+
+ + + +
+ + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..ca4cace --- /dev/null +++ b/package-lock.json @@ -0,0 +1,248 @@ +{ + "name": "convivo", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "convivo", + "version": "0.1.0", + "devDependencies": { + "supabase": "^2.28.1" + } + }, + "node_modules/@ecies/ciphers": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/@ecies/ciphers/-/ciphers-0.2.6.tgz", + "integrity": "sha512-patgsRPKGkhhoBjETV4XxD0En4ui5fbX0hzayqI3M8tvNMGUoUvmyYAIWwlxBc1KX5cturfqByYdj5bYGRpN9g==", + "dev": true, + "license": "MIT", + "engines": { + "bun": ">=1", + "deno": ">=2.7.10", + "node": ">=16" + }, + "peerDependencies": { + "@noble/ciphers": "^1.0.0" + } + }, + "node_modules/@noble/ciphers": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", + "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@supabase/cli-darwin-arm64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-darwin-arm64/-/cli-darwin-arm64-2.115.0.tgz", + "integrity": "sha512-yUNw1KG+fyuBqBGvFT8ASC7aAkFkx2Kx+qPjUTW50ttiKKgg8D/eMSCoSjQuaAbL0vafw98bHEZ2dAfdyYyXMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@supabase/cli-darwin-x64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-darwin-x64/-/cli-darwin-x64-2.115.0.tgz", + "integrity": "sha512-e4bbWADYcjSjXgSSErreoqyEeEjrFQunxCYummUoiGdVanck/itAIFwhtRykKpBtoKqCYh4CFxUiDxOFMBdNHQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@supabase/cli-linux-arm64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-linux-arm64/-/cli-linux-arm64-2.115.0.tgz", + "integrity": "sha512-JBcnnFuVekMR9+EOCcup1QihW+CHMBWcL/+N1Uz4HB6leX8d894VQ+sX0pFgbXLqnpGcc35IiXKwjLz4FCb8Dw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@supabase/cli-linux-arm64-musl": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.115.0.tgz", + "integrity": "sha512-2OCzD4qZx8RFbW2vfOlXpup+1UnVqSauUsSGH4mKiUIveMD/UyMI6Md8CLKLszwV2XwM+6bZG6w7d7Ems9vxCQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@supabase/cli-linux-x64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-linux-x64/-/cli-linux-x64-2.115.0.tgz", + "integrity": "sha512-ZvZ5QbPB3cvenEam6TDgngWPPm9GBO5m/5GYCOsqIfx2Gz5++WsEhlypWy9U4gTFae7ENtih0RqPzgiyWDKE+w==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@supabase/cli-linux-x64-musl": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-linux-x64-musl/-/cli-linux-x64-musl-2.115.0.tgz", + "integrity": "sha512-t36QEEQxy0AsOn0rr1L8aEzZKYS+kRH4fvYr5KdB+rHA1x39A1dUeOCTqCucCr0V5oQ3+odJLlO6tinNczHKMQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@supabase/cli-windows-arm64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-windows-arm64/-/cli-windows-arm64-2.115.0.tgz", + "integrity": "sha512-MkYbWrNZXpWZxwglVaTexj+w6EWYUi34c7Y9SRGbcQBC/infteM/8zhVVRUmO3ltSEqnJCacHowLPISXIF6g/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@supabase/cli-windows-x64": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/@supabase/cli-windows-x64/-/cli-windows-x64-2.115.0.tgz", + "integrity": "sha512-jRXsJjbw/h0ssSpFQeClTTO2wtMw0YYS1yMzN2f/px4DehigBZNxSFB4thOtzmIJoisInm1gYV5pQJZla1Ytpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/eciesjs": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/eciesjs/-/eciesjs-0.5.0.tgz", + "integrity": "sha512-s0J9SEVYAEPg7J63GFMApLYzPH9VNIQIyC6s15JpnqVc0TqcKWdbgFlnAweEBRyMmko2dcs2sfC83Hj4J43tuA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ecies/ciphers": "^0.2.6", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "^1.9.7", + "@noble/hashes": "^1.8.0" + }, + "engines": { + "bun": ">=1", + "deno": ">=2.7.10", + "node": ">=16" + } + }, + "node_modules/jose": { + "version": "6.2.10", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.10.tgz", + "integrity": "sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/supabase": { + "version": "2.115.0", + "resolved": "https://registry.npmjs.org/supabase/-/supabase-2.115.0.tgz", + "integrity": "sha512-8fL9vOd6jOntmU8N5DVlHGE2GWR1r57ulsrOzSyO6IRYq5QMyKie8T8DH+hb+caGhYUVJLvmpY7XYwic60Uafg==", + "dev": true, + "license": "MIT", + "dependencies": { + "eciesjs": "^0.5.0", + "jose": "^6.2.8" + }, + "bin": { + "supabase": "dist/supabase.js" + }, + "optionalDependencies": { + "@supabase/cli-darwin-arm64": "2.115.0", + "@supabase/cli-darwin-x64": "2.115.0", + "@supabase/cli-linux-arm64": "2.115.0", + "@supabase/cli-linux-arm64-musl": "2.115.0", + "@supabase/cli-linux-x64": "2.115.0", + "@supabase/cli-linux-x64-musl": "2.115.0", + "@supabase/cli-windows-arm64": "2.115.0", + "@supabase/cli-windows-x64": "2.115.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..37cde1b --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "convivo", + "version": "0.1.0", + "private": true, + "description": "Convivo β€” turn a conference into a game. Dockerized Supabase core + web app sidecars.", + "scripts": { + "db:start": "supabase start", + "db:stop": "supabase stop", + "db:reset": "supabase reset", + "db:types": "supabase gen types typescript --local > packages/shared/src/database.types.ts", + "app:dev": "npm --prefix apps/convivo run dev", + "app:build": "npm --prefix apps/convivo run build" + }, + "devDependencies": { + "supabase": "^2.28.1" + } +} diff --git a/supabase/config.toml b/supabase/config.toml new file mode 100644 index 0000000..f2d444c --- /dev/null +++ b/supabase/config.toml @@ -0,0 +1,414 @@ +# For detailed configuration reference documentation, visit: +# https://supabase.com/docs/guides/local-development/cli/config +# A string used to distinguish different Supabase projects on the same host. Defaults to the +# working directory name when running `supabase init`. +project_id = "Convivo" + +[api] +enabled = true +# Port to use for the API URL. +port = 54321 +# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API +# endpoints. `public` and `graphql_public` schemas are included by default. +schemas = ["public", "graphql_public"] +# Extra schemas to add to the search_path of every request. +extra_search_path = ["public", "extensions"] +# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size +# for accidental or malicious requests. +max_rows = 1000 +# Controls whether new tables, views, sequences and functions created in the `public` schema by +# `postgres` are reachable through the Data API roles (`anon`, `authenticated`, `service_role`) +# without explicit GRANTs. When unset, new entities are NOT auto-exposed, matching the new cloud +# default. Set to `true` to keep the legacy behaviour of auto-exposing new entities; this is +# deprecated and the field is removed on 2026-10-30 once the always-revoked behaviour is permanent. +# auto_expose_new_tables = true + +[api.tls] +# Enable HTTPS endpoints locally using a self-signed certificate. +enabled = false +# Paths to self-signed certificate pair. +# cert_path = "../certs/my-cert.pem" +# key_path = "../certs/my-key.pem" + +[db] +# Port to use for the local database URL. +port = 54322 +# Port used by db diff command to initialize the shadow database. +shadow_port = 54320 +# Maximum amount of time to wait for health check when starting the local database. +health_timeout = "2m" +# The database major version to use. This has to be the same as your remote database's. Run `SHOW +# server_version;` on the remote database to check. +major_version = 17 + +[db.pooler] +enabled = false +# Port to use for the local connection pooler. +port = 54329 +# Specifies when a server connection can be reused by other clients. +# Configure one of the supported pooler modes: `transaction`, `session`. +pool_mode = "transaction" +# How many server connections to allow per user/database pair. +default_pool_size = 20 +# Maximum number of client connections allowed. +max_client_conn = 100 + +# [db.vault] +# secret_key = "env(SECRET_VALUE)" + +[db.migrations] +# If disabled, migrations will be skipped during a db push or reset. +enabled = true +# Specifies an ordered list of schema files, directories, or glob patterns that describe your database. +# Supports paths relative to supabase directory: "./schemas/*.sql", "./database". +schema_paths = [] + +[db.seed] +# If enabled, seeds the database after migrations during a db reset. +enabled = true +# Specifies an ordered list of seed files to load during db reset. +# Supports glob patterns relative to supabase directory: "./seeds/*.sql" +sql_paths = ["./seed.sql"] + +[db.network_restrictions] +# Enable management of network restrictions. +enabled = false +# List of IPv4 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv4 connections. Set empty array to block all IPs. +allowed_cidrs = ["0.0.0.0/0"] +# List of IPv6 CIDR blocks allowed to connect to the database. +# Defaults to allow all IPv6 connections. Set empty array to block all IPs. +allowed_cidrs_v6 = ["::/0"] + +# Uncomment to reject non-secure connections to the database. +# [db.ssl_enforcement] +# enabled = true + +[realtime] +enabled = true +# Bind realtime via either IPv4 or IPv6. (default: IPv4) +# ip_version = "IPv6" +# The maximum length in bytes of HTTP request headers. (default: 4096) +# max_header_length = 4096 + +[studio] +enabled = true +# Port to use for Supabase Studio. +port = 54323 +# External URL of the API server that frontend connects to. +api_url = "http://127.0.0.1" +# OpenAI API Key to use for Supabase AI in the Supabase Studio. +openai_api_key = "env(OPENAI_API_KEY)" + +# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they +# are monitored, and you can view the emails that would have been sent from the web interface. +[local_smtp] +enabled = true +# Port to use for the email testing server web interface. +port = 54324 +# Uncomment to expose additional ports for testing user applications that send emails. +# smtp_port = 54325 +# pop3_port = 54326 +# admin_email = "admin@email.com" +# sender_name = "Admin" + +[storage] +enabled = true +# The maximum file size allowed (e.g. "5MB", "500KB"). +file_size_limit = "50MiB" + +# Uncomment to configure local storage buckets +# [storage.buckets.images] +# public = false +# file_size_limit = "50MiB" +# allowed_mime_types = ["image/png", "image/jpeg"] +# objects_path = "./images" + +# Allow connections via S3 compatible clients +[storage.s3_protocol] +enabled = true + +# Image transformation API is available to Supabase Pro plan. +# [storage.image_transformation] +# enabled = true + +# Store analytical data in S3 for running ETL jobs over Iceberg Catalog +# This feature is only available on the hosted platform. +[storage.analytics] +enabled = false +max_namespaces = 5 +max_tables = 10 +max_catalogs = 2 + +# Analytics Buckets is available to Supabase Pro plan. +# [storage.analytics.buckets.my-warehouse] + +# Store vector embeddings in S3 for large and durable datasets +[storage.vector] +enabled = true +max_buckets = 10 +max_indexes = 5 + +# Vector Buckets is available to Supabase Pro plan. +# [storage.vector.buckets.documents-openai] + +[auth] +enabled = true +# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used +# in emails. +site_url = "http://127.0.0.1:3000" +# The public URL that Auth serves on. Defaults to the API external URL with `/auth/v1` appended. +# external_url = "" +# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. +additional_redirect_urls = ["https://127.0.0.1:3000"] +# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). +jwt_expiry = 3600 +# JWT issuer URL. If not set, defaults to auth.external_url. +# jwt_issuer = "" +# Path to JWT signing key. DO NOT commit your signing keys file to git. +# signing_keys_path = "./signing_keys.json" +# If disabled, the refresh token will never expire. +enable_refresh_token_rotation = true +# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. +# Requires enable_refresh_token_rotation = true. +refresh_token_reuse_interval = 10 +# Allow/disallow new user signups to your project. +enable_signup = true +# Allow/disallow anonymous sign-ins to your project. +enable_anonymous_sign_ins = false +# Allow/disallow testing manual linking of accounts +enable_manual_linking = false +# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. +minimum_password_length = 6 +# Passwords that do not meet the following requirements will be rejected as weak. Supported values +# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols` +password_requirements = "" + +# Configure passkey sign-ins. +# [auth.passkey] +# enabled = false + +# Configure WebAuthn relying party settings (required when passkey is enabled). +# [auth.webauthn] +# rp_display_name = "Supabase" +# rp_id = "localhost" +# rp_origins = ["http://127.0.0.1:3000"] + +[auth.rate_limit] +# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled. +email_sent = 2 +# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled. +sms_sent = 30 +# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true. +anonymous_users = 30 +# Number of sessions that can be refreshed in a 5 minute interval per IP address. +token_refresh = 150 +# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users). +sign_in_sign_ups = 30 +# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. +token_verifications = 30 +# Number of Web3 logins that can be made in a 5 minute interval per IP address. +web3 = 30 + +# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. +# [auth.captcha] +# enabled = true +# provider = "hcaptcha" +# secret = "" + +[auth.email] +# Allow/disallow new user signups via email to your project. +enable_signup = true +# If enabled, a user will be required to confirm any email change on both the old, and new email +# addresses. If disabled, only the new email is required to confirm. +double_confirm_changes = true +# If enabled, users need to confirm their email address before signing in. +enable_confirmations = false +# If enabled, users will need to reauthenticate or have logged in recently to change their password. +secure_password_change = false +# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. +max_frequency = "1s" +# Number of characters used in the email OTP. +otp_length = 6 +# Number of seconds before the email OTP expires (defaults to 1 hour). +otp_expiry = 3600 + +# Use a production-ready SMTP server +# [auth.email.smtp] +# enabled = true +# host = "smtp.sendgrid.net" +# port = 587 +# user = "apikey" +# pass = "env(SENDGRID_API_KEY)" +# admin_email = "admin@email.com" +# sender_name = "Admin" + +# Uncomment to customize email template +# [auth.email.template.invite] +# subject = "You have been invited" +# content_path = "./supabase/templates/invite.html" + +# Uncomment to customize notification email template +# [auth.email.notification.password_changed] +# enabled = true +# subject = "Your password has been changed" +# content_path = "./supabase/templates/password_changed_notification.html" + +[auth.sms] +# Allow/disallow new user signups via SMS to your project. +enable_signup = false +# If enabled, users need to confirm their phone number before signing in. +enable_confirmations = false +# Template for sending OTP to users +template = "Your code is {{ .Code }}" +# Controls the minimum amount of time that must pass before sending another sms otp. +max_frequency = "5s" + +# Use pre-defined map of phone number to OTP for testing. +# [auth.sms.test_otp] +# 4152127777 = "123456" + +# Configure logged in session timeouts. +# [auth.sessions] +# Force log out after the specified duration. +# timebox = "24h" +# Force log out if the user has been inactive longer than the specified duration. +# inactivity_timeout = "8h" + +# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object. +# [auth.hook.before_user_created] +# enabled = true +# uri = "pg-functions://postgres/auth/before-user-created-hook" + +# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. +# [auth.hook.custom_access_token] +# enabled = true +# uri = "pg-functions:////" + +# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. +[auth.sms.twilio] +enabled = false +account_sid = "" +message_service_sid = "" +# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: +auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" + +# Multi-factor-authentication is available to Supabase Pro plan. +[auth.mfa] +# Control how many MFA factors can be enrolled at once per user. +max_enrolled_factors = 10 + +# Control MFA via App Authenticator (TOTP) +[auth.mfa.totp] +enroll_enabled = false +verify_enabled = false + +# Configure MFA via Phone Messaging +[auth.mfa.phone] +enroll_enabled = false +verify_enabled = false +otp_length = 6 +template = "Your code is {{ .Code }}" +max_frequency = "5s" + +# Configure MFA via WebAuthn +# [auth.mfa.web_authn] +# enroll_enabled = true +# verify_enabled = true + +# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, +# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, +# `twitter`, `x`, `slack`, `spotify`, `workos`, `zoom`. +[auth.external.apple] +enabled = false +client_id = "" +# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: +secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" +# Overrides the default auth callback URL derived from auth.external_url. +redirect_uri = "" +# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, +# or any other third-party OIDC providers. +url = "" +# If enabled, the nonce check will be skipped. Required for local sign in with Google auth. +skip_nonce_check = false +# If enabled, it will allow the user to successfully authenticate when the provider does not return an email address. +email_optional = false + +# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard. +# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting. +[auth.web3.solana] +enabled = false + +# Use Firebase Auth as a third-party provider alongside Supabase Auth. +[auth.third_party.firebase] +enabled = false +# project_id = "my-firebase-project" + +# Use Auth0 as a third-party provider alongside Supabase Auth. +[auth.third_party.auth0] +enabled = false +# tenant = "my-auth0-tenant" +# tenant_region = "us" + +# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth. +[auth.third_party.aws_cognito] +enabled = false +# user_pool_id = "my-user-pool-id" +# user_pool_region = "us-east-1" + +# Use Clerk as a third-party provider alongside Supabase Auth. +[auth.third_party.clerk] +enabled = false +# Obtain from https://clerk.com/setup/supabase +# domain = "example.clerk.accounts.dev" + +# OAuth server configuration +[auth.oauth_server] +# Enable OAuth server functionality +enabled = false +# Path for OAuth consent flow UI +authorization_url_path = "/oauth/consent" +# Allow dynamic client registration +allow_dynamic_registration = false + +[edge_runtime] +enabled = true +# Supported request policies: `oneshot`, `per_worker`. +# `per_worker` (default) β€” enables hot reload during local development. +# `oneshot` β€” fallback mode if hot reload causes issues (e.g. in large repos or with symlinks). +policy = "per_worker" +# Port to attach the Chrome inspector for debugging edge functions. +inspector_port = 8083 +# The Deno major version to use. +deno_version = 2 + +# [edge_runtime.secrets] +# secret_key = "env(SECRET_VALUE)" + +[analytics] +enabled = true +port = 54327 +# Configure one of the supported backends: `postgres`, `bigquery`. +backend = "postgres" + +# Experimental features may be deprecated any time +[experimental] +# Configures Postgres storage engine to use OrioleDB (S3) +orioledb_version = "" +# Configures S3 bucket URL, eg. .s3-.amazonaws.com +s3_host = "env(S3_HOST)" +# Configures S3 bucket region, eg. us-east-1 +s3_region = "env(S3_REGION)" +# Configures AWS_ACCESS_KEY_ID for S3 bucket +s3_access_key = "env(S3_ACCESS_KEY)" +# Configures AWS_SECRET_ACCESS_KEY for S3 bucket +s3_secret_key = "env(S3_SECRET_KEY)" + +# pg-delta is the schema diff engine for db diff / db pull / db remote commit. +# Set enabled = false to fall back to the legacy migra engine. +[experimental.pgdelta] +enabled = true +# Directory under `supabase/` where declarative files are written. +# declarative_schema_path = "./schemas" +# JSON string passed through to pg-delta SQL formatting. +# format_options = "{\"keywordCase\":\"upper\",\"indent\":2,\"maxWidth\":80,\"commaStyle\":\"trailing\"}" diff --git a/supabase/migrations/20260822000000_init.sql b/supabase/migrations/20260822000000_init.sql new file mode 100644 index 0000000..0a0d05d --- /dev/null +++ b/supabase/migrations/20260822000000_init.sql @@ -0,0 +1,451 @@ +-- ============================================================================= +-- Convivo β€” Phase 0: initial schema, RLS, and transactional points RPCs +-- ============================================================================= +create extension if not exists "pgcrypto"; + +-- ----------------------------------------------------------------------------- +-- TABLES +-- ----------------------------------------------------------------------------- + +-- Source of truth for people. `id` is the Supabase Auth user id. +-- `qr_token` is the lanyard token; it doubles as the Auth password for the +-- QR + email login flow (no email is ever sent). +create table public.profiles ( + id uuid primary key references auth.users (id) on delete cascade, + email text not null unique, + full_name text not null, + company text, + role text not null default 'attendee' check (role in ('attendee', 'staff', 'admin')), + qr_token text unique, + points integer not null default 0 check (points >= 0), + created_at timestamptz not null default now() +); + +create table public.slots ( + id integer primary key, + name text not null, + slot_date date not null, + start_time time not null, + end_time time not null +); + +create table public.sessions ( + id uuid primary key default gen_random_uuid(), + title text not null, + description text, + slot_id integer not null references public.slots (id) on delete cascade, + room text, + capacity integer, + speakers text, + created_at timestamptz not null default now() +); + +-- One preferred session per slot per attendee. +create table public.preferences ( + id uuid primary key default gen_random_uuid(), + profile_id uuid not null references public.profiles (id) on delete cascade, + session_id uuid not null references public.sessions (id) on delete cascade, + slot_id integer not null, + created_at timestamptz not null default now(), + unique (profile_id, slot_id) +); + +-- The custom M:N networking relationship. Unique per unordered pair. +create table public.connections ( + id uuid primary key default gen_random_uuid(), + from_id uuid not null references public.profiles (id) on delete cascade, + to_id uuid not null references public.profiles (id) on delete cascade, + status text not null default 'pending' check (status in ('pending', 'accepted', 'rejected')), + created_at timestamptz not null default now(), + resolved_at timestamptz +); +create unique index connections_pair_uniq + on public.connections (least(from_id, to_id), greatest(from_id, to_id)); + +-- Staff check-in of an attendee into a session. Unique per (attendee, session). +create table public.checkins ( + id uuid primary key default gen_random_uuid(), + profile_id uuid not null references public.profiles (id) on delete cascade, + session_id uuid not null references public.sessions (id) on delete cascade, + staff_id uuid not null references public.profiles (id) on delete cascade, + created_at timestamptz not null default now(), + unique (profile_id, session_id) +); + +-- Post-session feedback. Unique per (attendee, session). +create table public.feedback ( + id uuid primary key default gen_random_uuid(), + profile_id uuid not null references public.profiles (id) on delete cascade, + session_id uuid not null references public.sessions (id) on delete cascade, + rating integer not null check (rating between 1 and 5), + comment text, + created_at timestamptz not null default now(), + unique (profile_id, session_id) +); + +-- Public, Realtime-friendly mirror of points for the live leaderboard. +-- Kept in sync transactionally by the points RPCs (see _sync_leaderboard). +create table public.leaderboard ( + profile_id uuid primary key references public.profiles (id) on delete cascade, + full_name text not null, + company text, + points integer not null default 0, + updated_at timestamptz not null default now() +); + +-- Audit trail powering the per-category points breakdown. +create table public.points_log ( + id uuid primary key default gen_random_uuid(), + profile_id uuid not null references public.profiles (id) on delete cascade, + delta integer not null, + category text not null check (category in ('checkin', 'connection', 'feedback', 'admin')), + created_at timestamptz not null default now() +); + +create index sessions_slot_id_idx on public.sessions (slot_id); +create index checkins_session_id_idx on public.checkins (session_id); +create index points_log_profile_id_idx on public.points_log (profile_id); +create index profiles_qr_token_idx on public.profiles (qr_token); + +-- ----------------------------------------------------------------------------- +-- ROLE HELPER FUNCTIONS (security definer so they can read profiles in RLS) +-- ----------------------------------------------------------------------------- +create or replace function public.is_admin() returns boolean +language sql stable security definer set search_path = public as $$ + select exists (select 1 from public.profiles where id = auth.uid() and role = 'admin'); +$$; + +create or replace function public.is_staff_or_admin() returns boolean +language sql stable security definer set search_path = public as $$ + select exists (select 1 from public.profiles where id = auth.uid() and role in ('staff', 'admin')); +$$; + +-- ----------------------------------------------------------------------------- +-- INTERNAL POINTS HELPERS (security definer: bypass RLS, run as owner) +-- ----------------------------------------------------------------------------- +create or replace function public._sync_leaderboard(p_profile_id uuid) returns void +language plpgsql security definer set search_path = public as $$ +begin + insert into public.leaderboard (profile_id, full_name, company, points) + select id, full_name, company, points from public.profiles where id = p_profile_id + on conflict (profile_id) do update + set full_name = excluded.full_name, + company = excluded.company, + points = excluded.points, + updated_at = now(); +end; +$$; + +create or replace function public._award_points(p_profile_id uuid, p_delta integer, p_category text) returns void +language plpgsql security definer set search_path = public as $$ +begin + update public.profiles set points = greatest(0, points + p_delta) where id = p_profile_id; + insert into public.points_log (profile_id, delta, category) values (p_profile_id, p_delta, p_category); + perform public._sync_leaderboard(p_profile_id); +end; +$$; + +-- ----------------------------------------------------------------------------- +-- PUBLIC READ FUNCTIONS (security definer: expose only public columns) +-- ----------------------------------------------------------------------------- +-- Powers the leaderboard initial load and id -> name/company/role lookups. +create or replace function public.get_public_profiles() +returns table (id uuid, full_name text, company text, role text, points integer) +language sql stable security definer set search_path = public as $$ + select id, full_name, company, role, points + from public.profiles + order by points desc, full_name asc; +$$; + +-- Resolves a scanned lanyard QR token to a public profile (pre-login + connect). +create or replace function public.lanyard_lookup(p_qr_token text) +returns table (id uuid, full_name text, company text, role text) +language sql stable security definer set search_path = public as $$ + select id, full_name, company, role + from public.profiles + where qr_token = p_qr_token; +$$; + +-- ----------------------------------------------------------------------------- +-- RPCs +-- ----------------------------------------------------------------------------- + +-- Set (or change) the preferred session for the slot that p_session_id belongs to. +create or replace function public.set_preference(p_session_id uuid) +returns public.preferences +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_slot_id integer; + v_pref public.preferences; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + select slot_id into v_slot_id from public.sessions where id = p_session_id; + if v_slot_id is null then raise exception 'session not found'; end if; + delete from public.preferences where profile_id = v_uid and slot_id = v_slot_id; + insert into public.preferences (profile_id, session_id, slot_id) + values (v_uid, p_session_id, v_slot_id) + returning * into v_pref; + return v_pref; +end; +$$; + +create or replace function public.clear_preference(p_slot_id integer) +returns void +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); +begin + if v_uid is null then raise exception 'not authenticated'; end if; + delete from public.preferences where profile_id = v_uid and slot_id = p_slot_id; +end; +$$; + +-- Create a pending connection to the attendee whose lanyard QR was scanned. +-- Idempotent: returns the existing connection if the pair already has one. +create or replace function public.create_connection_request(p_target_qr text) +returns public.connections +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_target uuid; + v_conn public.connections; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + select id into v_target from public.profiles where qr_token = p_target_qr; + if v_target is null then raise exception 'no attendee found for that QR code'; end if; + if v_target = v_uid then raise exception 'you cannot connect with yourself'; end if; + select * into v_conn from public.connections + where (from_id = v_uid and to_id = v_target) or (from_id = v_target and to_id = v_uid) + limit 1; + if found then + return v_conn; + end if; + insert into public.connections (from_id, to_id, status) + values (v_uid, v_target, 'pending') + returning * into v_conn; + return v_conn; +end; +$$; + +-- Accept an incoming connection request. Awards +5 to both parties. +create or replace function public.accept_connection(p_connection_id uuid) +returns public.connections +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_conn public.connections; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + select * into v_conn from public.connections where id = p_connection_id for update; + if not found then raise exception 'connection not found'; end if; + if v_conn.to_id <> v_uid then raise exception 'you can only accept incoming requests'; end if; + if v_conn.status <> 'pending' then raise exception 'request already resolved'; end if; + update public.connections set status = 'accepted', resolved_at = now() where id = p_connection_id; + perform public._award_points(v_conn.from_id, 5, 'connection'); + perform public._award_points(v_conn.to_id, 5, 'connection'); + select * into v_conn from public.connections where id = p_connection_id; + return v_conn; +end; +$$; + +create or replace function public.reject_connection(p_connection_id uuid) +returns public.connections +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_conn public.connections; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + select * into v_conn from public.connections where id = p_connection_id for update; + if not found then raise exception 'connection not found'; end if; + if v_conn.to_id <> v_uid then raise exception 'you can only reject incoming requests'; end if; + if v_conn.status <> 'pending' then raise exception 'request already resolved'; end if; + update public.connections set status = 'rejected', resolved_at = now() where id = p_connection_id; + select * into v_conn from public.connections where id = p_connection_id; + return v_conn; +end; +$$; + +-- Staff checks an attendee into a session. Awards +10 to the attendee. +-- Returns already=true if the attendee was already checked in (no double points). +create or replace function public.checkin_attendee(p_session_id uuid, p_attendee_qr text) +returns table (checkin_id uuid, attendee_id uuid, attendee_name text, points integer, already boolean) +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_attendee uuid; + v_name text; + v_new_id uuid; + v_points integer; + v_already boolean := false; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + if not public.is_staff_or_admin() then raise exception 'staff or admin only'; end if; + select id, full_name into v_attendee, v_name from public.profiles where qr_token = p_attendee_qr; + if v_attendee is null then raise exception 'no attendee found for that QR code'; end if; + insert into public.checkins (profile_id, session_id, staff_id) + values (v_attendee, p_session_id, v_uid) + on conflict (profile_id, session_id) do nothing + returning id into v_new_id; + if v_new_id is null then + -- Already checked in: no double points; report the existing check-in. + v_already := true; + select id into v_new_id from public.checkins where profile_id = v_attendee and session_id = p_session_id; + else + perform public._award_points(v_attendee, 10, 'checkin'); + end if; + select p.points into v_points from public.profiles p where p.id = v_attendee; + return query select v_new_id, v_attendee, v_name, v_points, v_already; +end; +$$; + +-- Post-session feedback. Requires the attendee to be checked in. +-- Awards +5 (rating only) or +10 (rating + comment). Idempotent per session. +create or replace function public.submit_feedback(p_session_id uuid, p_rating integer, p_comment text) +returns table (feedback_id uuid, points integer, earned integer) +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); + v_earned integer; + v_fb_id uuid; + v_points integer; + v_clean text; + v_exists boolean; +begin + if v_uid is null then raise exception 'not authenticated'; end if; + if p_rating is null or p_rating < 1 or p_rating > 5 then raise exception 'rating must be between 1 and 5'; end if; + if not exists (select 1 from public.checkins where profile_id = v_uid and session_id = p_session_id) then + raise exception 'you must be checked in to this session to give feedback'; + end if; + v_clean := nullif(btrim(coalesce(p_comment, '')), ''); + v_earned := case when v_clean is not null then 10 else 5 end; + + select exists (select 1 from public.feedback where profile_id = v_uid and session_id = p_session_id) into v_exists; + if v_exists then + update public.feedback set rating = p_rating, comment = v_clean + where profile_id = v_uid and session_id = p_session_id; + select id into v_fb_id from public.feedback where profile_id = v_uid and session_id = p_session_id; + v_earned := 0; -- already rewarded on first submission + else + insert into public.feedback (profile_id, session_id, rating, comment) + values (v_uid, p_session_id, p_rating, v_clean) + returning id into v_fb_id; + perform public._award_points(v_uid, v_earned, 'feedback'); + end if; + select p.points into v_points from public.profiles p where p.id = v_uid; + return query select v_fb_id, v_points, v_earned; +end; +$$; + +-- Admin-only manual points adjustment. +create or replace function public.adjust_points(p_profile_id uuid, p_delta integer, p_reason text) +returns void +language plpgsql security definer set search_path = public as $$ +declare + v_uid uuid := auth.uid(); +begin + if v_uid is null then raise exception 'not authenticated'; end if; + if not public.is_admin() then raise exception 'admin only'; end if; + perform public._award_points(p_profile_id, p_delta, 'admin'); +end; +$$; + +-- Full agenda: slots (ordered) each with their sessions. +create or replace function public.get_agenda() +returns table ( + slot_id integer, slot_name text, slot_date date, start_time time, end_time time, + session_id uuid, title text, description text, room text, capacity integer, speakers text +) +language sql stable security definer set search_path = public as $$ + select s.id, s.name, s.slot_date, s.start_time, s.end_time, + se.id, se.title, se.description, se.room, se.capacity, se.speakers + from public.slots s + left join public.sessions se on se.slot_id = s.id + order by s.id, se.title; +$$; + +-- ----------------------------------------------------------------------------- +-- ROW LEVEL SECURITY +-- ----------------------------------------------------------------------------- +alter table public.profiles enable row level security; +alter table public.slots enable row level security; +alter table public.sessions enable row level security; +alter table public.preferences enable row level security; +alter table public.connections enable row level security; +alter table public.checkins enable row level security; +alter table public.feedback enable row level security; +alter table public.leaderboard enable row level security; +alter table public.points_log enable row level security; + +-- profiles: full row only for self or admin (protects email + qr_token). +create policy "profiles_select_own_or_admin" on public.profiles for select to authenticated + using (id = auth.uid() or public.is_admin()); +create policy "profiles_update_admin" on public.profiles for update to authenticated + using (public.is_admin()) with check (public.is_admin()); +create policy "profiles_delete_admin" on public.profiles for delete to authenticated + using (public.is_admin()); + +-- slots: readable by all authenticated; writable by admin. +create policy "slots_select_all" on public.slots for select to authenticated using (true); +create policy "slots_admin_insert" on public.slots for insert to authenticated with check (public.is_admin()); +create policy "slots_admin_update" on public.slots for update to authenticated using (public.is_admin()) with check (public.is_admin()); +create policy "slots_admin_delete" on public.slots for delete to authenticated using (public.is_admin()); + +-- sessions: readable by all authenticated; writable by admin. +create policy "sessions_select_all" on public.sessions for select to authenticated using (true); +create policy "sessions_admin_insert" on public.sessions for insert to authenticated with check (public.is_admin()); +create policy "sessions_admin_update" on public.sessions for update to authenticated using (public.is_admin()) with check (public.is_admin()); +create policy "sessions_admin_delete" on public.sessions for delete to authenticated using (public.is_admin()); + +-- preferences: read own; writes happen via RPC (security definer). +create policy "prefs_select_own" on public.preferences for select to authenticated + using (profile_id = auth.uid()); + +-- connections: read any row you're part of; writes happen via RPC. +create policy "conn_select_involved" on public.connections for select to authenticated + using (from_id = auth.uid() or to_id = auth.uid()); + +-- checkins: read own, or all if staff/admin; writes happen via RPC. +create policy "checkins_select_own_or_staff" on public.checkins for select to authenticated + using (profile_id = auth.uid() or public.is_staff_or_admin()); + +-- feedback: read own; writes happen via RPC. +create policy "feedback_select_own" on public.feedback for select to authenticated + using (profile_id = auth.uid()); + +-- leaderboard: public to all authenticated (Realtime source). +create policy "leaderboard_select_all" on public.leaderboard for select to authenticated using (true); + +-- points_log: read own or admin. +create policy "points_log_select_own_or_admin" on public.points_log for select to authenticated + using (profile_id = auth.uid() or public.is_admin()); + +-- ----------------------------------------------------------------------------- +-- GRANTS +-- The new Supabase CLI does NOT auto-expose new tables to the Data API roles, +-- so grant explicitly. RLS still governs what each role can actually see. +-- ----------------------------------------------------------------------------- +grant usage on schema public to anon, authenticated, service_role; +grant select on public.profiles, public.slots, public.sessions, public.preferences, + public.connections, public.checkins, public.feedback, + public.leaderboard, public.points_log + to anon, authenticated, service_role; +grant insert, update, delete on public.profiles, public.slots, public.sessions, + public.preferences, public.connections, public.checkins, + public.feedback, public.leaderboard, public.points_log + to authenticated, service_role; + +grant execute on function public.is_admin() to authenticated; +grant execute on function public.is_staff_or_admin() to authenticated; +grant execute on function public.get_public_profiles() to authenticated; +grant execute on function public.lanyard_lookup(text) to authenticated; +grant execute on function public.set_preference(uuid) to authenticated; +grant execute on function public.clear_preference(integer) to authenticated; +grant execute on function public.create_connection_request(text) to authenticated; +grant execute on function public.accept_connection(uuid) to authenticated; +grant execute on function public.reject_connection(uuid) to authenticated; +grant execute on function public.checkin_attendee(uuid, text) to authenticated; +grant execute on function public.submit_feedback(uuid, integer, text) to authenticated; +grant execute on function public.adjust_points(uuid, integer, text) to authenticated; +grant execute on function public.get_agenda() to authenticated; diff --git a/supabase/seed.sql b/supabase/seed.sql new file mode 100644 index 0000000..e81f75f --- /dev/null +++ b/supabase/seed.sql @@ -0,0 +1,160 @@ +-- ============================================================================= +-- Convivo β€” Phase 0: seed data +-- Ports the mockup's slots/sessions/people into real Supabase Auth users + rows. +-- The QR token is the Auth password (QR + email login, no email sent). +-- ============================================================================= + +-- ----------------------------------------------------------------------------- +-- SLOTS (23 Oct) +-- ----------------------------------------------------------------------------- +insert into public.slots (id, name, slot_date, start_time, end_time) values + (1, 'Slot 1', '2026-10-23', '09:00:00', '09:45:00'), + (2, 'Slot 2', '2026-10-23', '10:00:00', '10:45:00'), + (3, 'Slot 3', '2026-10-23', '11:30:00', '12:15:00'), + (4, 'Slot 4', '2026-10-23', '13:15:00', '14:00:00'), + (5, 'Slot 5', '2026-10-23', '14:00:00', '14:45:00'), + (6, 'Slot 6', '2026-10-23', '15:00:00', '15:45:00') +on conflict (id) do nothing; + +-- ----------------------------------------------------------------------------- +-- SESSIONS (18 β€” 3 per slot) +-- ----------------------------------------------------------------------------- +insert into public.sessions (id, title, description, slot_id, room, capacity, speakers) values + ('10000000-0000-0000-0000-000000000001', 'Opening Keynote: The Next Decade of AI', 'A wide-angle look at where AI is heading over the next ten years β€” and what it means for product teams.', 1, 'Main Stage', 300, 'Dr. Elena Vasquez'), + ('10000000-0000-0000-0000-000000000002', 'Designing for Trust in AI Products', 'Practical patterns for making AI features transparent, explainable, and safe for your users.', 1, 'Room A', 80, 'Marco Chen'), + ('10000000-0000-0000-0000-000000000003', 'From Hackathon to Product', 'How a weekend prototype became a product with 40k users β€” the messy middle included.', 1, 'Room B', 60, 'Sofia Almeida'), + ('10000000-0000-0000-0000-000000000004', 'AI in Practice: Lessons from Production', 'Lessons learned shipping LLM features to production: latency, cost, evals, and the surprises.', 2, 'Main Stage', 300, 'Bruno Costa'), + ('10000000-0000-0000-0000-000000000005', 'The Introvert''s Guide to Networking', 'Small, low-energy ways to have big conversations at any event. (Yes, this one is for you.)', 2, 'Room A', 80, 'Rita Lopes'), + ('10000000-0000-0000-0000-000000000006', 'Building with Dataverse: Beyond the Basics', 'Go beyond the basics: relationships, security roles, and automations that actually scale.', 2, 'Room B', 60, 'TomΓ‘s Ribeiro'), + ('10000000-0000-0000-0000-000000000007', 'Scaling Teams at 10x', 'What breaks when you grow 10x in two years, and the rituals that kept us sane.', 3, 'Main Stage', 300, 'Julia Santos'), + ('10000000-0000-0000-0000-000000000008', 'Security by Design', 'Baking security into the product from day one instead of bolting it on at the end.', 3, 'Room A', 80, 'Pedro Nunes'), + ('10000000-0000-0000-0000-000000000009', 'Data Storytelling', 'Turn dashboards into narratives your stakeholders actually remember.', 3, 'Room B', 60, 'Carla Mendes'), + ('10000000-0000-0000-0000-000000000010', 'The Future of Work', 'Hybrid, async, and AI-augmented: where work is going and how to prepare for it.', 4, 'Main Stage', 300, 'Dr. Elena Vasquez'), + ('10000000-0000-0000-0000-000000000011', 'Prototyping with AI', 'From idea to clickable prototype in an afternoon β€” tools and workflows that work.', 4, 'Room A', 80, 'Diego Ferreira'), + ('10000000-0000-0000-0000-000000000012', 'Pricing SaaS in 2026', 'Usage-based, seat-based, or hybrid? What is actually working right now.', 4, 'Room B', 60, 'Marina Costa'), + ('10000000-0000-0000-0000-000000000013', 'Community-Led Growth', 'Building a community that sells for you β€” case studies and playbooks.', 5, 'Main Stage', 300, 'Lucas Oliveira'), + ('10000000-0000-0000-0000-000000000014', 'Accessibility First', 'Why accessible products are better products, and how to start this sprint.', 5, 'Room A', 80, 'Carla Mendes'), + ('10000000-0000-0000-0000-000000000015', 'The Art of the Demo', 'Structure, pacing, and the moments that make a demo land.', 5, 'Room B', 60, 'Pedro Nunes'), + ('10000000-0000-0000-0000-000000000016', 'Closing Panel: What''s Next', 'Founders, researchers, and builders on what comes next β€” with audience Q&A.', 6, 'Main Stage', 300, 'Elena Β· Bruno Β· Rita'), + ('10000000-0000-0000-0000-000000000017', 'Open Space: Your Ideas', 'You bring the topic, we bring the room. 45 minutes of your ideas.', 6, 'Room A', 80, 'Facilitated by Ana Silva'), + ('10000000-0000-0000-0000-000000000018', 'Lightning Talks', 'Eight speakers, five minutes each. Fast, fun, and unpredictable.', 6, 'Room B', 60, '8 speakers') +on conflict (id) do nothing; + +-- ----------------------------------------------------------------------------- +-- AUTH USERS (QR token = password). 12 attendees + 1 admin. +-- ----------------------------------------------------------------------------- +-- NOTE: confirmation_token is set to '' (not NULL) because GoTrue's password +-- grant cannot scan a NULL confirmation_token on manually-inserted users. +insert into auth.users (instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, confirmation_token, recovery_token, email_change_token_new, email_change, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_sent_at, last_sign_in_at) values + ('00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111', 'authenticated', 'authenticated', 'ana.silva@nubank.com', crypt('CVV-ANA-4821', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ana Silva"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '22222222-2222-2222-2222-222222222222', 'authenticated', 'authenticated', 'bruno.costa@acme.com', crypt('CVV-BRU-1177', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Bruno Costa"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '33333333-3333-3333-3333-333333333333', 'authenticated', 'authenticated', 'rita.lopes@globant.com', crypt('CVV-RIT-9034', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Rita Lopes"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '44444444-4444-4444-4444-444444444444', 'authenticated', 'authenticated', 'tomas.ribeiro@dataprev.com', crypt('CVV-TOM-5566', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"TomΓ‘s Ribeiro"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '55555555-5555-5555-5555-555555555555', 'authenticated', 'authenticated', 'sofia.almeida@loop.com', crypt('CVV-SOF-2299', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sofia Almeida"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '66666666-6666-6666-6666-666666666666', 'authenticated', 'authenticated', 'marco.chen@deepmind.com', crypt('CVV-MRC-7712', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marco Chen"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '77777777-7777-7777-7777-777777777777', 'authenticated', 'authenticated', 'julia.santos@ifood.com', crypt('CVV-JUL-3345', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Julia Santos"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '88888888-8888-8888-8888-888888888888', 'authenticated', 'authenticated', 'pedro.nunes@microsoft.com', crypt('CVV-PED-8801', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Pedro Nunes"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', '99999999-9999-9999-9999-999999999999', 'authenticated', 'authenticated', 'carla.mendes@quintoessencial.com', crypt('CVV-CAR-6623', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Carla Mendes"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'authenticated', 'authenticated', 'diego.ferreira@stone.com', crypt('CVV-DIE-4458', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Diego Ferreira"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'authenticated', 'authenticated', 'marina.costa@olx.com', crypt('CVV-MNA-2210', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marina Costa"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', 'cccccccc-cccc-cccc-cccc-cccccccccccc', 'authenticated', 'authenticated', 'lucas.oliveira@usp.br', crypt('CVV-LUC-9987', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lucas Oliveira"}', now(), now(), now(), now()), + ('00000000-0000-0000-0000-000000000000', 'dddddddd-dddd-dddd-dddd-dddddddddddd', 'authenticated', 'authenticated', 'admin@appe.at', crypt('CVV-ADM-0001', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Convivo Admin"}', now(), now(), now(), now()) +on conflict (id) do nothing; + +insert into auth.identities (id, provider_id, identity_data, provider, user_id, created_at, updated_at, last_sign_in_at) values + ('11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111', '{"sub":"11111111-1111-1111-1111-111111111111","email":"ana.silva@nubank.com"}', 'email', '11111111-1111-1111-1111-111111111111', now(), now(), now()), + ('22222222-2222-2222-2222-222222222222', '22222222-2222-2222-2222-222222222222', '{"sub":"22222222-2222-2222-2222-222222222222","email":"bruno.costa@acme.com"}', 'email', '22222222-2222-2222-2222-222222222222', now(), now(), now()), + ('33333333-3333-3333-3333-333333333333', '33333333-3333-3333-3333-333333333333', '{"sub":"33333333-3333-3333-3333-333333333333","email":"rita.lopes@globant.com"}', 'email', '33333333-3333-3333-3333-333333333333', now(), now(), now()), + ('44444444-4444-4444-4444-444444444444', '44444444-4444-4444-4444-444444444444', '{"sub":"44444444-4444-4444-4444-444444444444","email":"tomas.ribeiro@dataprev.com"}', 'email', '44444444-4444-4444-4444-444444444444', now(), now(), now()), + ('55555555-5555-5555-5555-555555555555', '55555555-5555-5555-5555-555555555555', '{"sub":"55555555-5555-5555-5555-555555555555","email":"sofia.almeida@loop.com"}', 'email', '55555555-5555-5555-5555-555555555555', now(), now(), now()), + ('66666666-6666-6666-6666-666666666666', '66666666-6666-6666-6666-666666666666', '{"sub":"66666666-6666-6666-6666-666666666666","email":"marco.chen@deepmind.com"}', 'email', '66666666-6666-6666-6666-666666666666', now(), now(), now()), + ('77777777-7777-7777-7777-777777777777', '77777777-7777-7777-7777-777777777777', '{"sub":"77777777-7777-7777-7777-777777777777","email":"julia.santos@ifood.com"}', 'email', '77777777-7777-7777-7777-777777777777', now(), now(), now()), + ('88888888-8888-8888-8888-888888888888', '88888888-8888-8888-8888-888888888888', '{"sub":"88888888-8888-8888-8888-888888888888","email":"pedro.nunes@microsoft.com"}', 'email', '88888888-8888-8888-8888-888888888888', now(), now(), now()), + ('99999999-9999-9999-9999-999999999999', '99999999-9999-9999-9999-999999999999', '{"sub":"99999999-9999-9999-9999-999999999999","email":"carla.mendes@quintoessencial.com"}', 'email', '99999999-9999-9999-9999-999999999999', now(), now(), now()), + ('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '{"sub":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","email":"diego.ferreira@stone.com"}', 'email', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', now(), now(), now()), + ('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '{"sub":"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb","email":"marina.costa@olx.com"}', 'email', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', now(), now(), now()), + ('cccccccc-cccc-cccc-cccc-cccccccccccc', 'cccccccc-cccc-cccc-cccc-cccccccccccc', '{"sub":"cccccccc-cccc-cccc-cccc-cccccccccccc","email":"lucas.oliveira@usp.br"}', 'email', 'cccccccc-cccc-cccc-cccc-cccccccccccc', now(), now(), now()), + ('dddddddd-dddd-dddd-dddd-dddddddddddd', 'dddddddd-dddd-dddd-dddd-dddddddddddd', '{"sub":"dddddddd-dddd-dddd-dddd-dddddddddddd","email":"admin@appe.at"}', 'email', 'dddddddd-dddd-dddd-dddd-dddddddddddd', now(), now(), now()) +on conflict (id) do nothing; + +-- ----------------------------------------------------------------------------- +-- PROFILES +-- ----------------------------------------------------------------------------- +insert into public.profiles (id, email, full_name, company, role, qr_token, points) values + ('11111111-1111-1111-1111-111111111111', 'ana.silva@nubank.com', 'Ana Silva', 'Nubank', 'attendee', 'CVV-ANA-4821', 40), + ('22222222-2222-2222-2222-222222222222', 'bruno.costa@acme.com', 'Bruno Costa', 'Acme Corp', 'staff', 'CVV-BRU-1177', 140), + ('33333333-3333-3333-3333-333333333333', 'rita.lopes@globant.com', 'Rita Lopes', 'Globant', 'staff', 'CVV-RIT-9034', 95), + ('44444444-4444-4444-4444-444444444444', 'tomas.ribeiro@dataprev.com', 'TomΓ‘s Ribeiro', 'Dataprev', 'attendee', 'CVV-TOM-5566', 88), + ('55555555-5555-5555-5555-555555555555', 'sofia.almeida@loop.com', 'Sofia Almeida', 'Loop', 'attendee', 'CVV-SOF-2299', 76), + ('66666666-6666-6666-6666-666666666666', 'marco.chen@deepmind.com', 'Marco Chen', 'DeepMind', 'attendee', 'CVV-MRC-7712', 70), + ('77777777-7777-7777-7777-777777777777', 'julia.santos@ifood.com', 'Julia Santos', 'iFood', 'attendee', 'CVV-JUL-3345', 64), + ('88888888-8888-8888-8888-888888888888', 'pedro.nunes@microsoft.com', 'Pedro Nunes', 'Microsoft', 'attendee', 'CVV-PED-8801', 58), + ('99999999-9999-9999-9999-999999999999', 'carla.mendes@quintoessencial.com', 'Carla Mendes', 'QuintoEssencial', 'attendee', 'CVV-CAR-6623', 52), + ('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'diego.ferreira@stone.com', 'Diego Ferreira', 'Stone', 'attendee', 'CVV-DIE-4458', 35), + ('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'marina.costa@olx.com', 'Marina Costa', 'OLX', 'attendee', 'CVV-MNA-2210', 28), + ('cccccccc-cccc-cccc-cccc-cccccccccccc', 'lucas.oliveira@usp.br', 'Lucas Oliveira', 'USP', 'attendee', 'CVV-LUC-9987', 15), + ('dddddddd-dddd-dddd-dddd-dddddddddddd', 'admin@appe.at', 'Convivo Admin', 'Convivo', 'admin', 'CVV-ADM-0001', 0) +on conflict (id) do nothing; + +-- ----------------------------------------------------------------------------- +-- LEADERBOARD (mirror of points) +-- ----------------------------------------------------------------------------- +insert into public.leaderboard (profile_id, full_name, company, points) +select id, full_name, company, points from public.profiles +on conflict (profile_id) do update + set full_name = excluded.full_name, company = excluded.company, points = excluded.points, updated_at = now(); + +-- ----------------------------------------------------------------------------- +-- POINTS LOG +-- Ana: a coherent breakdown (2 checkins, 2 connections, 1 feedback = 40). +-- Everyone else: a single 'admin' seed entry for their starting points. +-- ----------------------------------------------------------------------------- +insert into public.points_log (profile_id, delta, category) values + ('11111111-1111-1111-1111-111111111111', 10, 'checkin'), + ('11111111-1111-1111-1111-111111111111', 10, 'checkin'), + ('11111111-1111-1111-1111-111111111111', 5, 'connection'), + ('11111111-1111-1111-1111-111111111111', 5, 'connection'), + ('11111111-1111-1111-1111-111111111111', 10, 'feedback'), + ('22222222-2222-2222-2222-222222222222', 140, 'admin'), + ('33333333-3333-3333-3333-333333333333', 95, 'admin'), + ('44444444-4444-4444-4444-444444444444', 88, 'admin'), + ('55555555-5555-5555-5555-555555555555', 76, 'admin'), + ('66666666-6666-6666-6666-666666666666', 70, 'admin'), + ('77777777-7777-7777-7777-777777777777', 64, 'admin'), + ('88888888-8888-8888-8888-888888888888', 58, 'admin'), + ('99999999-9999-9999-9999-999999999999', 52, 'admin'), + ('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 35, 'admin'), + ('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 28, 'admin'), + ('cccccccc-cccc-cccc-cccc-cccccccccccc', 15, 'admin'); + +-- ----------------------------------------------------------------------------- +-- ANA'S DEMO STATE (so the app looks alive on first login) +-- ----------------------------------------------------------------------------- +-- Preferences: one pick per slot (matches the mockup). +insert into public.preferences (profile_id, session_id, slot_id) values + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', 1), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000004', 2), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000009', 3), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000011', 4), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000013', 5), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000016', 6) +on conflict (profile_id, slot_id) do nothing; + +-- Check-ins: Ana is checked into Slot 1 (s2) and Slot 2 (s4), by staff Bruno. +insert into public.checkins (profile_id, session_id, staff_id) values + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', '22222222-2222-2222-2222-222222222222'), + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000004', '22222222-2222-2222-2222-222222222222') +on conflict (profile_id, session_id) do nothing; + +-- Connections: accepted with Bruno & Rita; incoming from Sofia; outgoing to Julia. +insert into public.connections (id, from_id, to_id, status, created_at, resolved_at) values + ('e0000000-0000-0000-0000-000000000001', '11111111-1111-1111-1111-111111111111', '22222222-2222-2222-2222-222222222222', 'accepted', now() - interval '2 hours', now() - interval '2 hours'), + ('e0000000-0000-0000-0000-000000000002', '33333333-3333-3333-3333-333333333333', '11111111-1111-1111-1111-111111111111', 'accepted', now() - interval '90 minutes', now() - interval '90 minutes'), + ('e0000000-0000-0000-0000-000000000003', '55555555-5555-5555-5555-555555555555', '11111111-1111-1111-1111-111111111111', 'pending', now() - interval '15 minutes', null), + ('e0000000-0000-0000-0000-000000000004', '11111111-1111-1111-1111-111111111111', '77777777-7777-7777-7777-777777777777', 'pending', now() - interval '5 minutes', null) +on conflict (id) do nothing; + +-- Feedback: Ana rated Slot 1 (s2). +insert into public.feedback (profile_id, session_id, rating, comment) values + ('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', 5, 'Great patterns, very practical. Wish it were longer!') +on conflict (profile_id, session_id) do nothing;