Redesign Phases 3-6: multi-event model, APPE Admin, Convivo App behaviors, APPE branding

- Phase 3: new migration 20260824000000_redesign.sql (contacts/events/registrations/sponsors, slot types, session speakers + feedback/material), seed rewrite
- Phase 4: APPE Admin rebrand + Contacts/Registrations/Sponsors/Schedule/Activity/Events views
- Phase 5: Convivo App (24h login, 5s polling, QR type badge, red dot, speaker material)
- Phase 6: APPE favicon + PWA icons for both apps
- Docs: schema/rpcs/rls/seed/screens/api-client/admin-app/architecture/next-steps/README/roadmap updated
This commit is contained in:
Lago committed 2026-08-23 02:53:16 +02:00
1 parent 5adb5785aa
commit 22f5f1d317
64 files changed
+4593 -1371

No files matched your search

+23 -17
View File
@@ -18,7 +18,7 @@ make connections, get checked in by staff, and rate sessions. Every action earns
flowchart LR
subgraph Browser["Browser"]
A["Convivo PWA<br/>React 18 + Vite 5 + TS<br/>mobile-first, installable"]
AD["Convivo Admin<br/>React 18 + Vite 5 + TS<br/>desktop-first console"]
AD["APPE Admin<br/>React 18 + Vite 5 + TS<br/>desktop-first console"]
end
subgraph Docker["Docker (local)"]
@@ -64,12 +64,14 @@ talks to Supabase through **same-origin paths**, so there is no CORS to manage.
### Backend — the Supabase core
Everything server-side lives in Postgres. See [backend/README.md](./backend/README.md):
- **Schema** — 9 tables (people, schedule, and the event's activity). → [backend/schema.md](./backend/schema.md)
- **Schema** — 13 tables (people, the event, participation, schedule, and the
event's activity). → [backend/schema.md](./backend/schema.md)
- **Business logic** — transactional `security definer` RPCs that award points and
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)
- **Data** — seed with 6 slots, 18 sessions, 13 demo users. → [backend/seed.md](./backend/seed.md)
- **Data** — seed with 1 event, 6 slots, 18 sessions, 14 contacts, 13
registrations, 3 sponsors. → [backend/seed.md](./backend/seed.md)
### Frontend — the attendee PWA
A single-page React app with a tab shell and a few full-screen takeovers. See
@@ -78,15 +80,17 @@ A single-page React app with a tab shell and a few full-screen takeovers. See
- **Screens** — Login, Home, Agenda, Scan/Check-in, Connections, Feedback, Leaderboard, Profile. → [frontend/screens.md](./frontend/screens.md)
- **API client** — a thin typed wrapper over `supabase.rpc` / `supabase.from`. → [frontend/api-client.md](./frontend/api-client.md)
### Frontend — the admin console
A separate desktop-first React app for organizers, guarded to the **admin** role.
See [frontend/admin-app.md](./frontend/admin-app.md):
- **Views** — Dashboard (live stats), Attendees (edit / reset QR / adjust
points), Schedule (manage slots + sessions), Activity (check-ins /
connections / feedback).
### Frontend — the admin console (APPE Admin)
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.
- **Auth guard** — same QR + email login, but non-admin sessions are rejected.
- **New RPC** — `reset_qr_token` regenerates an attendee's lanyard token and
syncs the Auth password (see [backend/rpcs.md](./backend/rpcs.md)).
- **Key RPCs** — `reset_qr_token` (regenerate a lanyard token + sync the Auth
password), `adjust_points`, `upsert_contact`, `create_registration`,
`set_registration_type`, `evaluate_session_feedback` (AI stub), and
`set_session_material` (see [backend/rpcs.md](./backend/rpcs.md)).
## 5. How a request flows (example: staff check-in)
@@ -102,7 +106,7 @@ sequenceDiagram
N->>K: proxy (same-origin)
K->>R: route /rest
R->>DB: execute checkin_attendee() as `authenticated`
Note over DB: security definer → bypasses RLS<br/>1. insert checkin (ON CONFLICT do nothing)<br/>2. _award_points(+10) → profiles.points + points_log<br/>3. _sync_leaderboard()
Note over DB: security definer → bypasses RLS<br/>1. insert checkin (ON CONFLICT do nothing)<br/>2. _award_points(+10) → registrations.points + points_log<br/>3. _sync_leaderboard()
DB-->>R: {checkin_id, attendee_name, points, already}
R-->>K: JSON
K-->>N: JSON
@@ -119,8 +123,9 @@ the work atomically, and the `leaderboard` table change fans out over Realtime.
Login is a standard `signInWithPassword({ email, password: qrToken })`.
- `enable_confirmations = false`, so **no email is sent** — the email is only a
"confirm it's you" check against the ticket purchase.
- After login, the app holds a short-lived **session JWT** (in `localStorage`).
Every request sends the **anon key** (public) + the **session JWT** (identity).
- After login, the app holds a **session JWT** (in `localStorage`) that lasts
**24 hours** (`jwt_expiry = 86400`). Every request sends the **anon key**
(public) + the **session JWT** (identity).
- The **service-role key is never in the app** — it bypasses RLS and stays
server-side. See [backend/rls.md](./backend/rls.md) for what each role can do.
@@ -167,9 +172,10 @@ Convivo/
├─ supabase/
│ ├─ config.toml # Local stack config (ports, auth, RLS defaults)
│ ├─ migrations/
│ │ ├─ 20260822000000_init.sql # schema, RLS, points RPCs
│ │ └─ 20260823000000_admin_app.sql # admin read RLS + reset_qr_token RPC
│ └─ seed.sql # Slots, sessions, 13 demo users, Ana's demo state
│ │ ├─ 20260822000000_init.sql # original schema (replaced by the Redesign)
│ │ ├─ 20260823000000_admin_app.sql # admin read RLS + reset_qr_token (superseded)
│ │ └─ 20260824000000_redesign.sql # ← current: multi-event model, RPCs, RLS, materials
│ └─ 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
└─ mockup/index.html # Original interactive mockup (design reference)