Files
Convivo/docs/frontend
2f3952dc71 Fixes & Refinements: QR token on registration, role caps, connection detail + red dot, admin schedule/sponsors
Datamodel:
- Move qr_token from contacts to registrations (per event); new migration
  20260826000000. lanyard_lookup / create_connection_request / checkin_attendee
  resolve via registrations + active event.
- reset_qr_token -> reset_registration_qr_token (fixes ambiguous 'email' col).
- upsert_contact drops the token arg; create_registration generates + syncs it.
- Pretix sync writes the token to the registration (keeps it on re-sync).

Registration types:
- Distinct pill colors; red reserved for Staff (both apps).
- Roles capitalized everywhere (Attendee/Speaker/Sponsor/Staff); 'Attendee'
  hidden only at the Home footer.
- Reset-token button moved from Contacts to Registrations (per registration).

Sessions (APPE Admin):
- Slot types capitalized; material submitted/not-submitted state.
- Speaker selection = multi-select search dropdown.
- Fix 'a session must have a speaker' on edit (diff-based setSessionSpeakers)
  and the file-upload bug (speaker save no longer aborts first).

APPE Admin:
- Sponsors contact lookup = search field (filter + pick).

Convivo App:
- Other people's QR codes hidden; connection detail sheet shows public info +
  points.
- Connect red dot recalculates immediately on accept/decline/send.
- 'My picks today' = 2 rows (current + next); 'tap to change' links to Agenda.

Docs updated across backend + frontend.

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]>
2026-08-23 10:39:21 +02:00
..

Frontend

There are two React apps, both talking to the same Supabase core through same-origin paths:

  • Attendee PWA — a mobile-first single-page app in apps/convivo/. The same app for attendees, staff, and admins — the user's is_admin flag changes what they see (e.g. the Scan tab becomes a Check-in tab for staff).
  • Admin console (APPE Admin) — a desktop-first app in apps/admin/, guarded to the is_admin flag. See admin-app.md.
File What it covers
app-structure.md Attendee app: entry, contexts, the event hook, the tab shell, the demo clock
screens.md Attendee app: Login, Home, Agenda, Scan/Check-in, Connections, Feedback, Leaderboard, Profile
api-client.md The typed API wrapper + how the app talks to Supabase (auth, REST, realtime)
admin-app.md Admin console: views, the admin auth guard, QR reset, points, schedule

Tech

Concern Choice
Framework React 18 + TypeScript
Build Vite 5
Supabase client @supabase/supabase-js
QR scan html5-qrcode (camera) with manual-entry fallback
QR render qrcode.react
Styling Hand-rolled CSS ported from the mockup (src/styles.css)
PWA public/manifest.webmanifest + icons

Source layout

apps/convivo/src/
├─ main.tsx            # ReactDOM entry
├─ App.tsx             # Providers + Shell (tab nav + Feedback takeover)
├─ styles.css          # All styling (ported from mockup/index.html)
├─ context/
│  ├─ AuthContext.tsx  # session + contact + registration + signOut
│  └─ ToastContext.tsx # transient toasts
├─ lib/
│  ├─ supabase.ts      # createClient (same-origin)
│  ├─ api.ts           # typed wrapper over rpc/from
│  ├─ types.ts         # TS types mirroring the DB
│  ├─ time.ts          # event clock + slot status + formatting
│  ├─ useEvent.ts      # loads the active event + agenda, exposes it grouped
│  └─ usePolling.ts    # 5s visibility-aware polling hook
├─ components/
│  └─ ui.tsx           # Avatar, Spinner, Empty, Sheet, QrImage, Scanner
└─ screens/
   ├─ Login.tsx  Home.tsx  Agenda.tsx  Scan.tsx
   ├─ Connections.tsx  Feedback.tsx  Leaderboard.tsx  Profile.tsx

Data flow (high level)

  • Auth — AuthContext holds the Supabase session + the current Contact and Registration. See app-structure.md.
  • Event data — useEvent() loads the active event + agenda via the get_agenda() RPC and exposes it grouped by slot plus the event clock. See app-structure.md.
  • Per-screen data — each screen fetches what it needs through the typed api client (e.g. Home fetches preferences + check-ins).
  • Live updates — the Leaderboard subscribes to Realtime on the leaderboard table; Connections polls every 5s while the tab is visible (usePolling). See screens.md#leaderboard.

The app only ever uses the anon key + the user's session JWT; all security is enforced by RLS in the database. See ../backend/rls.md.