- 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.
106 lines
5.6 KiB
Markdown
106 lines
5.6 KiB
Markdown
# Convivo — Roadmap
|
||
|
||
Living roadmap. The top section is the **current focus**; completed phases are
|
||
summarized below. For *how* each piece works, see [`docs/`](./docs/README.md).
|
||
|
||
> **Status:** Phases 0–8 are complete and verified. The **Redesign** (Phases
|
||
> 3–6) is done, and the **Pretix + Sessionize interfaces** (Phases 7–8) are
|
||
> built and browser-verified end-to-end (against the local mock API). Remaining
|
||
> work is cross-cutting (real event clock, deployment, automated testing).
|
||
|
||
---
|
||
|
||
## Current focus — the Redesign (Phases 3–6) ✅ DONE
|
||
|
||
A new data model replaces the single-event `profiles` schema with a
|
||
**multi-event** model, the admin app is rebranded to **APPE Admin**, and the
|
||
Convivo App gains several behaviors. Details live in
|
||
[`docs/next-steps.md`](./docs/next-steps.md).
|
||
|
||
| Phase | Scope | Status |
|
||
|---|---|---|
|
||
| **3** | **Data model** — `contacts` (email PK), `events` (one active), `registrations` (per ticket), `sponsors`; slot types; session speakers (1:N); session `average_feedback` / `ai_generated_feedback` / `material`; activity tables re-scoped to event + contact; drop `profiles`; new RPCs + RLS + `materials` bucket | ✅ |
|
||
| **4** | **APPE Admin** — rebrand + new views: Dashboard (active event + aggregates), Contacts, Registrations, Sponsors, Schedule (slots/sessions/speakers/material/AI-evaluate), Activity, event management | ✅ |
|
||
| **5** | **Convivo App** — 24h login, 5s visibility-aware polling, staff-only check-in, QR type badge, pending-connection red dot, speaker material upload/download, graceful "no active event" | ✅ |
|
||
| **6** | **Branding** — `appe_full.png` as favicon + PWA icon for both apps | ✅ |
|
||
|
||
### Redesign decisions (locked)
|
||
- **Staff = admin (merged).** A contact has `is_admin` + a QR token (its login
|
||
password). `is_admin` grants both staff powers (check-in) and APPE Admin access.
|
||
- **QR token lives on the contact** (one per person). Each registration (ticket)
|
||
references the contact; the lanyard QR is the contact's token.
|
||
- **One active event at a time.** All app data is queried for the active event;
|
||
the app handles "no active event" gracefully.
|
||
- **AI feedback is a stub** this phase (field + state machine + admin "Evaluate"
|
||
button → RPC stub). Real LLM integration is a later phase.
|
||
- **Points kept, scoped per event** (check-in +10, connection +5 each, feedback
|
||
+5/+10), keyed on registration, leaderboard per active event.
|
||
|
||
---
|
||
|
||
## The Interfaces (Phases 7–8) ✅ DONE
|
||
|
||
Pull **real** data from the systems that run a conference. Full detail in
|
||
[`docs/backend/interfaces.md`](./docs/backend/interfaces.md).
|
||
|
||
| Phase | Scope | Status |
|
||
|---|---|---|
|
||
| **7** | **Pretix interface** — `sync-trigger` Edge Function pulls tickets → `contacts` + `registrations` (+ auth users, generated QR tokens, type mapping, idempotent by `external_id`); QR CSV export in APPE Admin | ✅ |
|
||
| **8** | **Sessionize interface** — same Edge Function pulls the agenda → `slots` + `sessions` + `session_speakers` (idempotent by `external_id`) | ✅ |
|
||
|
||
### Interface decisions (locked)
|
||
- **Runtime** — a Supabase **Edge Function** (`sync-trigger`), not a separate
|
||
container. It's the only component that talks to the external APIs and holds
|
||
the service-role key.
|
||
- **Style** — **pull** (on-demand from the APPE Admin **Interfaces** view +
|
||
cron-ready via `CRON_SECRET`). Webhooks are a later add-on.
|
||
- **Service-role-only RPCs** — `sync_pretix_attendees` / `sync_sessionize_sessions`
|
||
are guarded to the service-role caller (JWT `role` claim); the apps cannot
|
||
call them.
|
||
- **Idempotency** — `external_id` columns (partial unique indexes) on
|
||
contacts / registrations / sessions; re-runs update in place.
|
||
- **Audit** — a `sync_runs` table (admin-only read) records every run.
|
||
- **Local testing** — a `mock-api` Docker service serves the real API shapes
|
||
from fixtures, so the pipeline is testable without credentials.
|
||
|
||
---
|
||
|
||
## Completed
|
||
|
||
| Phase | Scope | Status |
|
||
|---|---|---|
|
||
| **0** | Dockerized Supabase core: schema, RLS, transactional points RPCs, seed | ✅ |
|
||
| **1** | Attendee web PWA: login (QR + email), Home, Agenda, Scan/Connect, Check-in, Feedback, Leaderboard, Profile | ✅ |
|
||
| **2** | Admin console (Convivo Admin): Dashboard, Attendees, Schedule, Activity; `reset_qr_token` RPC | ✅ |
|
||
|
||
> **Note:** Phases 0–2 built the `profiles`-based single-event model. Phase 3
|
||
> (the Redesign) **replaces** that schema — the old `profiles` table is dropped
|
||
> and the activity tables are re-scoped to the new `contacts` / `events` /
|
||
> `registrations` model.
|
||
|
||
---
|
||
|
||
## Cross-cutting / later
|
||
|
||
- **Real event clock** — replace the simulated `DEFAULT_NOW` with `new Date()`.
|
||
- **Subdomains** — `convivo.appe.at`, `admin.appe.at`, `db.appe.at` don't exist
|
||
yet; everything runs on localhost. DNS + TLS + a reverse proxy in front of the
|
||
Supabase core will be needed for a real deployment.
|
||
- **Push notifications** — connection requests are currently seen when the app
|
||
is opened (or via the 5s poll while visible).
|
||
- **Testing** — no automated tests yet. Candidates: RPC unit tests (points
|
||
idempotency, role guards, sponsor-type rule), and an E2E smoke test.
|
||
|
||
## Open questions
|
||
|
||
**Resolved in Phases 7–8:** sync runtime (Edge Function), sync style (pull +
|
||
cron-ready), credentials (env-configured + local mock API).
|
||
|
||
1. **Pretix mapping** — confirm the ticket-type → registration-type mapping
|
||
(the substring matcher is a reasonable default).
|
||
2. **Sync cadence** — how often to pull (pre-event vs during the event)?
|
||
3. **AI provider** — which LLM/API for `ai_generated_feedback` (the admin
|
||
"Evaluate" button is still a stub).
|
||
4. **Deployment target** — stay on localhost, or plan for the `appe.at`
|
||
subdomains now?
|