Phase 2: Admin console (admin.appe.at)

A desktop-first React app for organizers, guarded to the admin role.

Backend (supabase/migrations/20260823000000_admin_app.sql):
- Admin-only SELECT policies on preferences, connections, feedback
- reset_qr_token RPC: regenerates a lanyard token, re-hashes it as the
  Auth password (old token stops working), and clears the attendee's
  sessions to force re-login

App (apps/admin, port 3001):
- Login: same QR+email flow, but non-admin sessions are rejected
- Dashboard: live stats + top points + recent activity
- Attendees: search, edit name/company/role, reset QR, adjust points
- Schedule: manage slots + sessions (create/edit/delete)
- Activity: check-ins / connections / feedback tables
- Same-origin proxy (Vite dev / nginx in Docker), same design tokens

Docker + scripts:
- convivo-admin service in docker-compose.yml (:3001)
- admin:dev / admin:build root scripts
- fixed db:reset script (supabase reset -> supabase db reset)

Docs: new frontend/admin-app.md; updated architecture, rls, rpcs,
docker, next-steps, and READMEs.

Verified: build clean, all views + flows browser-tested, Docker build +
proxy + login + admin guard confirmed. DB reset to clean seed.
This commit is contained in:
Lago committed 2026-08-22 19:47:22 +02:00
1 parent 0cbfb25714
commit cf70f39903
45 files changed
+4425 -87

No files matched your search

+16 -12
View File
@@ -2,11 +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:** Phase 0 + Phase 1 complete.
> **Status:** Phase 0 + Phase 1 + Phase 2 complete.
> - **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.
> - **Phase 2** — Admin console (desktop-first, admin-role only): Dashboard, Attendees (edit / reset QR / adjust points), Schedule (slots + sessions), Activity.
>
> Next: Phase 2 (Admin app), Phase 3 (Pretix ticketing interface), Phase 4 (Sessionize interface).
> Next: Phase 3 (Pretix ticketing interface), Phase 4 (Sessionize interface).
---
@@ -43,7 +44,7 @@ The schedule is **data-driven** (stored in Postgres), so times and sessions can
|---|---|
| **Attendee** | Log in, view agenda, mark preferences, scan peers to connect, get checked in, give feedback, view leaderboard |
| **Staff** | Everything an attendee can do, **plus** a Check-in mode: pick a session, scan attendee lanyards to check them in |
| **Admin** | Staff powers **plus** full read/write on all event data (used by the future Admin app) |
| **Admin** | Staff powers **plus** full read/write on all event data (used by the Admin console) |
Staff and attendees use the **same app** — the role is an attribute on the profile and changes the Scan tab into a Check-in tab.
@@ -197,20 +198,21 @@ npm run db:start
# 2. (Re)apply migrations + seed, then restart the stack
npm run db:reset
# 3. Run the app (Vite dev server on :3000, proxies to the core)
npm run app:dev
# 3. Run the apps (Vite dev servers, proxy to the core)
npm run app:dev # attendee app on :3000
npm run admin:dev # admin console on :3001
```
Open **http://localhost:3000**. Studio is at **http://localhost:54323** (user `postgres`, password `postgres`).
Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin). Studio is at **http://localhost:54323** (user `postgres`, password `postgres`).
### Option B — Docker (app as a sidecar)
### Option B — Docker (apps as sidecars)
```bash
# 1. Start the Supabase core (creates the supabase_network_Convivo network)
npm run db:start
# 2. Build + run the app container on :3000 (joins the Supabase network)
# 2. Build + run both app containers (joins the Supabase network)
docker compose up --build
```
Open **http://localhost:3000**. The app's nginx proxies the Supabase paths to the Kong container on the shared network.
Open **http://localhost:3000** (attendee) and **http://localhost:3001** (admin). Each app's nginx proxies the Supabase paths to the Kong container on the shared network.
> **Reset the demo data at any time:** `npm run db:reset` (re-applies migrations + seed).
@@ -218,7 +220,8 @@ Open **http://localhost:3000**. The app's nginx proxies the Supabase paths to th
| Service | Port |
|---|---|
| Convivo app | **3000** |
| Convivo app (attendee) | **3000** |
| Convivo admin | **3001** |
| Supabase API (Kong) | 54321 |
| Supabase Studio | 54323 |
| Postgres | 54322 |
@@ -249,6 +252,7 @@ Login = **QR code** (typed or scanned) + **email**. The QR token is the password
2. Scan **Marco** (`CVV-MRC-7712`) → send a connection request.
3. Log in as **Bruno** (staff) → the Scan tab becomes **Check-in** → pick a session → scan **Carla** (`CVV-CAR-6623`) → she gets +10.
4. Watch the **Leaderboard** update live.
5. Open the **admin console** on **:3001** → log in as **Convivo Admin** (`CVV-ADM-0001` / admin@appe.at) → see the Dashboard, reset an attendee's QR, adjust points, and edit the schedule.
## 13. Roadmap
@@ -256,8 +260,8 @@ Login = **QR code** (typed or scanned) + **email**. The QR token is the password
|---|---|---|
| **0** | Dockerized Supabase core: schema, RLS, transactional points RPCs, seed | ✅ |
| **1** | Attendee web PWA: login, Home, Agenda, Scan/Connect, Check-in, Feedback, Leaderboard, Profile | ✅ |
| **2** | **Admin app** (admin.appe.at) — manage attendees, sessions, points, event | ⬜ next |
| **3** | **Pretix** interface — sync tickets → attendees (QR tokens, roles) | ⬜ |
| **2** | **Admin app** (admin.appe.at) — manage attendees, sessions, points, event | ✅ |
| **3** | **Pretix** interface — sync tickets → attendees (QR tokens, roles) | ⬜ next |
| **4** | **Sessionize** interface — sync the real agenda (slots, sessions, speakers) | ⬜ |
> **Subdomains** (`convivo.appe.at`, `admin.appe.at`, `db.appe.at`, `pretix.eu`, `sessionize.com`) do not exist yet — everything runs on **localhost** for now.