Phase 7+8: Pretix + Sessionize interfaces
- Migration 20260825000000_interfaces.sql: external_id on contacts/ registrations/sessions (+ partial unique indexes), slots_id_seq, sync_runs audit table, and service-role-only sync_pretix_attendees / sync_sessionize_sessions RPCs (idempotent upserts). - sync-trigger Edge Function: admin-JWT or CRON_SECRET auth, pulls from Pretix/Sessionize base URLs, normalizes, calls the service-role RPCs. - interfaces/mock-api: dependency-free Node server (:54330) + fixtures so the full pipeline is testable without real tokens. - APPE Admin 'Interfaces' view: per-source + 'Sync all' triggers, result counts, recent sync runs, and QR CSV export; /functions proxy added. - Docs: new docs/backend/interfaces.md; updated README, roadmap, next-steps, schema, rls, rpcs, architecture, admin-app, and docs index. Co-authored-by: Stephan Charles <[email protected]> Co-authored-by: Amelia Hernandez <[email protected]> Co-authored-by: Markus Franz <[email protected]> Co-authored-by: Sabrina Hota <[email protected]> Co-authored-by: Nilüfer Doğan <[email protected]>
This commit is contained in:
1 parent
7605c9bbf4
commit
74c41c8c1d
26 files changed
+1529
-80
No files matched your search
@@ -2,10 +2,12 @@
|
||||
|
||||
**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:** Phases 0–6 complete and verified, including the full **Redesign**
|
||||
> (Phases 3–6) — a new multi-event data model (contacts / events / registrations /
|
||||
> sponsors), the admin app rebranded to **APPE Admin**, and new Convivo App
|
||||
> behaviors.
|
||||
> **Status:** Phases 0–8 complete and verified. The **Redesign** (Phases 3–6)
|
||||
> and the **Pretix + Sessionize interfaces** (Phases 7–8) are done — the new
|
||||
> multi-event data model is live, the admin app is **APPE Admin**, the Convivo
|
||||
> App has all the new behaviors, both apps carry the APPE branding, and the
|
||||
> interfaces sync real ticket + agenda data (testable end-to-end via a local
|
||||
> mock API).
|
||||
>
|
||||
> - **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.
|
||||
@@ -14,8 +16,11 @@
|
||||
> - **Phase 4** — APPE Admin: rebrand + Contacts / Registrations / Sponsors / Schedule / Activity / event mgmt.
|
||||
> - **Phase 5** — Convivo App: 24h login, 5s polling, QR type badge, red dot, speaker material.
|
||||
> - **Phase 6** — Branding: APPE favicon + icons for both apps.
|
||||
> - **Phase 7** — Pretix interface: `sync-trigger` Edge Function → contacts + registrations (QR tokens, types, idempotent) + QR CSV export.
|
||||
> - **Phase 8** — Sessionize interface: same Edge Function → slots + sessions + speakers (idempotent).
|
||||
>
|
||||
> **Next:** Phase 7 (Pretix) → 8 (Sessionize). See [`roadmap.md`](./roadmap.md).
|
||||
> **Next:** cross-cutting work (real event clock, deployment, automated testing).
|
||||
> See [`roadmap.md`](./roadmap.md).
|
||||
|
||||
---
|
||||
|
||||
@@ -148,12 +153,12 @@ The model is **multi-event**: people (`contacts`) register for `events` via
|
||||
|
||||
| Table | Key fields | Notes |
|
||||
|---|---|---|
|
||||
| `contacts` | email (PK), full_name, linkedin_url, show_email, show_linkedin, is_admin, qr_token (unique) | One row per person; mirrors `auth.users` (email + bcrypt(qr_token)) |
|
||||
| `contacts` | email (PK), full_name, linkedin_url, show_email, show_linkedin, is_admin, qr_token (unique), external_id | One row per person; mirrors `auth.users` (email + bcrypt(qr_token)); `external_id` = Pretix order code |
|
||||
| `events` | id, name, start_date, end_date, location, is_active, + aggregates | Partial unique index → at most one active event |
|
||||
| `registrations` | id, event_id, contact_email, type (attendee/speaker/staff/sponsor), checked_in, points | Unique (event_id, contact_email); points live here |
|
||||
| `registrations` | id, event_id, contact_email, type (attendee/speaker/staff/sponsor), checked_in, points, external_id | Unique (event_id, contact_email); points live here |
|
||||
| `sponsors` | id, event_id, type, name, email, phone, paid, amount_eur, contact_email | `paid` gates visibility to non-admins |
|
||||
| `slots` | id, event_id, type (session/lunch_break/coffee_break/keynote/close_up), name, slot_date, start_time, end_time | 6 rows for 23 Oct |
|
||||
| `sessions` | id, event_id, slot_id, title, description, room, capacity, average_feedback, ai_generated_feedback, material_path | 18 rows (3 per session slot) |
|
||||
| `sessions` | id, event_id, slot_id, title, description, room, capacity, average_feedback, ai_generated_feedback, material_path, external_id | 18 rows (3 per session slot); `external_id` = Sessionize id |
|
||||
| `session_speakers` | session_id, contact_email | Join; a session must have ≥1 speaker |
|
||||
| `preferences` | event_id, contact_email, session_id, slot_id | Unique per (event, contact, slot) — one pick per slot |
|
||||
| `connections` | event_id, from_email, to_email, status, created_at, resolved_at | Unique per unordered pair (via `least`/`greatest` index) |
|
||||
@@ -161,11 +166,33 @@ The model is **multi-event**: people (`contacts`) register for `events` via
|
||||
| `feedback` | event_id, contact_email, session_id, rating (1–5), comment, created_at | Unique per (event, contact, session); only after session end |
|
||||
| `leaderboard` | event_id, contact_email, full_name, points, updated_at | Realtime mirror, kept in sync by the RPCs |
|
||||
| `points_log` | event_id, contact_email, delta, category, created_at | Audit trail powering the per-category breakdown |
|
||||
| `sync_runs` | id, source (pretix/sessionize), started_at, finished_at, created, updated, skipped, error, triggered_by | Audit trail of every interface sync (admin-only read) |
|
||||
|
||||
**Key RPCs** (all `security definer`, transactional): `lanyard_lookup`, `get_active_event`, `get_agenda`, `get_public_contacts`, `get_leaderboard`, `set_preference`, `clear_preference`, `create_connection_request`, `accept_connection`, `reject_connection`, `checkin_attendee`, `submit_feedback`, `adjust_points`, `reset_qr_token`, `upsert_contact`, `create_registration`, `set_registration_type`, `evaluate_session_feedback`, `set_session_material`.
|
||||
**Key RPCs** (all `security definer`, transactional): `lanyard_lookup`, `get_active_event`, `get_agenda`, `get_public_contacts`, `get_leaderboard`, `set_preference`, `clear_preference`, `create_connection_request`, `accept_connection`, `reject_connection`, `checkin_attendee`, `submit_feedback`, `adjust_points`, `reset_qr_token`, `upsert_contact`, `create_registration`, `set_registration_type`, `evaluate_session_feedback`, `set_session_material`, plus the **service-role-only** interface RPCs `sync_pretix_attendees` and `sync_sessionize_sessions` (called by the `sync-trigger` Edge Function — see [Interfaces](#interfaces-pretix--sessionize)).
|
||||
|
||||
**RLS:** every table has policies. Contacts are self-or-admin; sponsors are visible only when `paid` (or to admins); schedule/registrations are readable per active event and writable by admin; the leaderboard is readable by any authenticated user. A `materials` storage bucket holds session materials (read for attendees, write for speakers/admins).
|
||||
|
||||
## Interfaces (Pretix & Sessionize)
|
||||
|
||||
Convivo syncs real ticket and agenda data from the conference's ticketing (Pretix) and
|
||||
scheduling (Sessionize) platforms. The design is **pull-based**: an APPE Admin triggers a
|
||||
sync on demand from the **Interfaces** view (or a cron job can call the same endpoint with
|
||||
a shared secret).
|
||||
|
||||
- **`sync-trigger` Edge Function** — fetches from the configured Pretix/Sessionize base
|
||||
URLs, normalizes the payloads, and calls the service-role-only RPCs
|
||||
`sync_pretix_attendees` / `sync_sessionize_sessions`.
|
||||
- **Pretix → contacts + registrations** — each attendee becomes a `contacts` row (with a
|
||||
generated QR token if none supplied) and a `registrations` row; ticket type maps to
|
||||
attendee/speaker/staff/sponsor.
|
||||
- **Sessionize → slots + sessions + speakers** — each session is upserted by its
|
||||
`external_id`, its time window becomes a `slots` row (find-or-create), and speakers are
|
||||
linked via `session_speakers`.
|
||||
- **Local mock API** (`interfaces/mock-api`, port 54330) — a dependency-free Node server
|
||||
serving fixture data so the whole pipeline is testable without real tokens.
|
||||
|
||||
Full details: [`docs/backend/interfaces.md`](docs/backend/interfaces.md).
|
||||
|
||||
## 8. Tech stack
|
||||
|
||||
| Layer | Choice | Why |
|
||||
@@ -194,10 +221,12 @@ Convivo/
|
||||
│ └─ src/ # screens, components, lib, context
|
||||
├─ supabase/
|
||||
│ ├─ config.toml # Local stack config (ports, auth, RLS defaults)
|
||||
│ ├─ migrations/ # 20260824000000_redesign.sql — current schema, RLS, RPCs
|
||||
│ ├─ migrations/ # 20260824000000_redesign.sql + 20260825000000_interfaces.sql
|
||||
│ ├─ functions/ # sync-trigger Edge Function (Pretix/Sessionize sync)
|
||||
│ └─ seed.sql # 1 event, 6 slots, 18 sessions, 14 contacts, demo state
|
||||
├─ apps/admin/ # APPE Admin console (React + Vite + TS)
|
||||
├─ docker-compose.yml # Runs the app sidecars on the Supabase network
|
||||
├─ interfaces/mock-api/ # Mock Pretix + Sessionize API (Docker, :54330)
|
||||
├─ docker-compose.yml # Runs the app sidecars + mock-api on the Supabase network
|
||||
└─ mockup/index.html # Original interactive mockup (design reference)
|
||||
```
|
||||
|
||||
@@ -239,7 +268,8 @@ Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin).
|
||||
| Service | URL |
|
||||
|---|---|
|
||||
| Attendee app | **http://localhost:3000** |
|
||||
| Admin console | **http://localhost:3001** |
|
||||
| Admin console (APPE Admin) | **http://localhost:3001** |
|
||||
| Mock Pretix/Sessionize API | http://127.0.0.1:54330 |
|
||||
| Supabase Studio | **http://localhost:54323** (user `postgres`, password `postgres`) |
|
||||
| Supabase API (Kong) | http://127.0.0.1:54321 |
|
||||
| Postgres (direct) | `postgresql://postgres:[email protected]:54322/postgres` |
|
||||
@@ -288,8 +318,8 @@ Full detail in [`roadmap.md`](./roadmap.md).
|
||||
| **4** | **Redesign — APPE Admin**: rebrand + Contacts / Registrations / Sponsors / Schedule / Activity / event mgmt | ✅ |
|
||||
| **5** | **Redesign — Convivo App**: 24h login, 5s polling, QR type badge, red dot, speaker material | ✅ |
|
||||
| **6** | **Redesign — branding**: APPE favicon + icons for both apps | ✅ |
|
||||
| **7** | **Pretix** interface — sync tickets → contacts + registrations | ⬜ next |
|
||||
| **8** | **Sessionize** interface — sync the real agenda (slots, sessions, speakers) | ⬜ |
|
||||
| **7** | **Pretix** interface — `sync-trigger` Edge Function → contacts + registrations (QR tokens, types, idempotent) + QR CSV export | ✅ |
|
||||
| **8** | **Sessionize** interface — same Edge Function → slots + sessions + speakers (idempotent) | ✅ |
|
||||
|
||||
> **Subdomains** (`convivo.appe.at`, `admin.appe.at`, `db.appe.at`, `pretix.eu`, `sessionize.com`) do not exist yet — everything runs on **localhost** for now.
|
||||
|
||||
|
||||
Reference in new issue
Block a user