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

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:
committed 2026-08-23 02:53:16 +02:00
1 parent 2f53d47578
commit 7605c9bbf4
64 files changed
+4593 -1371

No files matched your search

+27 -13
View File
@@ -23,18 +23,22 @@ see [api-client.md](./api-client.md).
## AuthContext (`context/AuthContext.tsx`)
Holds the Supabase **session**, the current **`Profile`**, and a `loading` flag.
Holds the Supabase **session**, the current **`Contact`**, the current
**`Registration`**, and a `loading` flag.
- On mount, reads the persisted session (`supabase.auth.getSession()`) and loads
the profile for that user id.
the contact + registration for that user's email.
- Subscribes to `onAuthStateChange` so login/logout anywhere updates the context.
- `loadProfile(userId)` fetches `profiles` where `id = userId` (RLS returns only
the caller's own row — see [../backend/rls.md](../backend/rls.md)).
- Exposes: `session`, `user`, `profile`, `loading`, `refreshProfile()`, `signOut()`.
- `loadContact(email)` fetches `contacts` where `email = email` (RLS returns only
the caller's own row — see [../backend/rls.md](../backend/rls.md));
`loadRegistration(email)` fetches the caller's `registrations` row for the
active event.
- Exposes: `session`, `user`, `contact`, `registration`, `loading`,
`refresh()`, `signOut()`.
> The profile is the app's source of truth for the current user's `role` and
> `points`. After any points-changing action, screens call `refreshProfile()` to
> re-fetch.
> The contact is the app's source of truth for the current user's `is_admin`
> (staff powers) and `qr_token`; the registration holds the user's `type` and
> `points`. After any points-changing action, screens re-fetch.
## ToastContext (`context/ToastContext.tsx`)
@@ -43,21 +47,24 @@ Used for login success, connection results, check-in results, and RPC errors.
## The event hook (`lib/useEvent.ts`)
Loads the agenda **once** and exposes it in a convenient shape:
Loads the active event + agenda and exposes it in a convenient shape:
```ts
interface EventData {
event: Event | null; // the active event (name, dates, location)
slots: { slot: Slot; sessions: Session[] }[]; // grouped, ordered by slot id
sessionById: Map<string, Session>;
slotById: Map<number, Slot>;
now: Date; // the (simulated) event clock
loading: boolean;
error: string | null;
reload: () => void; // re-fetch (e.g. after a material upload)
}
```
- Calls `getAgenda()` (the `get_agenda()` RPC) and groups the flat rows with
`groupAgenda()` (see [api-client.md](./api-client.md)).
`groupAgenda()` (see [api-client.md](./api-client.md)); also loads the active
event via `getActiveEvent()`.
- Every screen that needs the schedule calls `useEvent()` — the agenda is fetched
per screen mount (cheap, and keeps each screen self-contained).
@@ -84,6 +91,13 @@ At `10:20`, **Slot 1 (09:00–09:45) is `done`** and **Slot 2 (10:00–10:45) is
> clock just decides which slot is "live" for display. To use the real clock,
> replace `DEFAULT_NOW` with `new Date()`.
## The polling hook (`lib/usePolling.ts`)
`usePolling(fn, ms, enabled)` runs `fn` every `ms` milliseconds, but **only while
the tab is visible** (`document.visibilityState === 'visible'`), and re-runs
immediately when the tab becomes visible again. No background polling. Used by
the Connections screen (5s) and the Shell's pending-connection red dot (5s).
## The Shell (`App.tsx`)
The `Shell` is the navigation container. Render logic, in order:
@@ -100,11 +114,11 @@ The `Shell` is the navigation container. Render logic, in order:
| `home` | 🏠 Home | `Home` | default tab |
| `agenda` | 📅 Agenda | `Agenda` | |
| `scan` | 📷 **Scan** / **Check-in** | `Scan` | label is role-aware (below) |
| `connections` | 🤝 Connect | `Connections` | |
| `connections` | 🤝 Connect | `Connections` | red dot when there are pending incoming requests |
| `profile` | 👤 Profile | `Profile` | |
- **Role-aware Scan tab:** if `profile.role` is `staff` or `admin`, the tab label
is **"Check-in"** and the `Scan` screen defaults to staff mode. Otherwise it's
- **Role-aware Scan tab:** if `contact.is_admin` is true, the tab label is
**"Check-in"** and the `Scan` screen defaults to staff mode. Otherwise it's
**"Scan"**.
- **Leaderboard** is *not* a tab — it's reached from the Home points pill and the
Home quick-actions. It renders as a tab in the shell but is opened via