Existing-sponsor link + remove Interfaces (Pretix/Sessionize)

- Sponsor lookup popup can now link an existing sponsor (dropdown + pre-fill)
  or create a new one; save upserts the sponsor linked to the contact and sets
  the registration type to sponsor.
- Remove the Interfaces feature end-to-end: admin nav button + Sync view, sync
  API helpers + SyncRun type, sync-trigger Edge Function, mock-api + its
  docker-compose service, and a migration dropping the sync RPCs, helpers, and
  sync_runs table.
- Update docs (architecture, backend, frontend, README, roadmap, next-steps).
This commit is contained in:
Lago committed 2026-08-24 09:11:25 +02:00
1 parent 1cbbd1b529
commit a54ce69c4d
27 files changed
+147 -1150

No files matched your search

+4 -11
View File
@@ -34,20 +34,16 @@ flowchart LR
K --> R["PostgREST"]
K --> RT["Realtime"]
K --> S["Storage"]
K --> EF["Edge Functions<br/>sync-trigger"]
R --> P[("Postgres 17<br/>schema · RLS · points RPCs")]
RT --> P
G --> P
EF -->|"service-role RPCs"| R
end
MA["mock-api (:54330)<br/>Pretix + Sessionize fixtures"]
end
A -->|"same-origin /auth /rest /realtime /storage /functions"| N
AD -->|"same-origin /auth /rest /realtime /storage /functions"| NA
N -->|"proxy (supabase_kong_Convivo:8000)"| K
NA -->|"proxy (supabase_kong_Convivo:8000)"| K
EF -->|"GET /pretix/attendees · /sessionize/sessions"| MA
```
**Key idea:** there is **no custom backend**. Supabase provides auth, data,
@@ -62,7 +58,6 @@ talks to Supabase through **same-origin paths**, so there is no CORS to manage.
| 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 |
| Interfaces | **`sync-trigger` Edge Function** (Deno) + **mock API** (Node) | Pulls real Pretix/Sessionize data and imports it via service-role RPCs; the mock API serves fixtures locally |
| Packaging | **Docker** (multi-stage build → nginx) | The app is a sidecar that joins the Supabase network |
## 4. The two halves
@@ -75,9 +70,6 @@ Everything server-side lives in Postgres. See [backend/README.md](./backend/READ
keep the leaderboard consistent. → [backend/rpcs.md](./backend/rpcs.md)
- **Security** — Row Level Security on every table; the app only ever uses the
**anon key + the user's session JWT**. → [backend/rls.md](./backend/rls.md)
- **Interfaces** — service-role-only sync RPCs (`sync_pretix_attendees`,
`sync_sessionize_sessions`) called by the `sync-trigger` Edge Function, which
pulls from Pretix/Sessionize (or the local mock API). → [backend/interfaces.md](./backend/interfaces.md)
- **Data** — seed with 1 event, 6 slots, 18 sessions, 14 contacts, 13
registrations, 3 sponsors. → [backend/seed.md](./backend/seed.md)
@@ -93,7 +85,7 @@ A separate desktop-first React app for organizers, guarded to the **`is_admin`**
flag. See [frontend/admin-app.md](./frontend/admin-app.md):
- **Views** — Dashboard (active event + aggregates), Contacts, Registrations,
Sponsors, Schedule (slots/sessions/speakers/material/AI-evaluate), Activity,
Events, and **Interfaces** (trigger Pretix/Sessionize syncs + export the QR CSV).
and Events.
- **Auth guard** — same QR + email login, but non-admin sessions are rejected.
- **Key RPCs** — `reset_registration_qr_token` (regenerate a registration's
lanyard token + sync the Auth password), `adjust_points`, `upsert_contact`,
@@ -192,8 +184,9 @@ Convivo/
│ │ ├─ 20260822000000_init.sql # original schema (replaced by the Redesign)
│ │ ├─ 20260823000000_admin_app.sql # admin read RLS + reset_qr_token (superseded)
│ │ ├─ 20260824000000_redesign.sql # multi-event model, RPCs, RLS, materials
│ │ ├─ 20260825000000_interfaces.sql # external_id + sync_runs + sync RPCs
│ │ └─ 20260826000000_registration_qr_token.sql # ← current: QR token on registration
│ │ ├─ 20260825000000_interfaces.sql # external_id (sync objects later dropped)
│ │ ├─ 20260826000000_registration_qr_token.sql # QR token on registration
│ │ └─ 20260830000000_remove_interfaces.sql # ← drops the sync RPCs + sync_runs
│ └─ seed.sql # 1 event, 6 slots, 18 sessions, 14 contacts, demo state
├─ docker-compose.yml # Runs both app sidecars on the Supabase network
├─ docs/ # ← this documentation