diff --git a/README.md b/README.md index 64d35cd..c1071f5 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,20 @@ **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:** Phases 0–2 complete. Now in the **Redesign** (Phases 3–6) — a new -> multi-event data model (contacts / events / registrations / sponsors), the -> admin app rebranded to **APPE Admin**, and new Convivo App behaviors. +> **Status:** Phases 0–6 complete and verified, including the full **Redesign** +> (Phases 3–6) — a new multi-event data model (contacts / events / registrations / +> sponsors), the admin app rebranded to **APPE Admin**, and new Convivo App +> behaviors. > > - **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. +> - **Phase 3** — Redesign data model: contacts / events / registrations / sponsors, slot types, session speakers + feedback/material. +> - **Phase 4** — APPE Admin: rebrand + Contacts / Registrations / Sponsors / Schedule / Activity / event mgmt. +> - **Phase 5** — Convivo App: 24h login, 5s polling, QR type badge, red dot, speaker material. +> - **Phase 6** — Branding: APPE favicon + icons for both apps. > -> **Next:** Phase 3 (data model) → 4 (APPE Admin) → 5 (Convivo App) → 6 -> (branding) → 7 (Pretix) → 8 (Sessionize). See [`roadmap.md`](./roadmap.md). +> **Next:** Phase 7 (Pretix) → 8 (Sessionize). See [`roadmap.md`](./roadmap.md). --- @@ -50,7 +54,9 @@ The schedule is **data-driven** (stored in Postgres), so times and sessions can | **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 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. +Staff and attendees use the **same app** — the role is the contact's +**registration type** for the active event and changes the Scan tab into a +Check-in tab. ## 4. Features @@ -95,7 +101,7 @@ Staff and attendees use the **same app** — the role is an attribute on the pro | Feedback — rating only | **+5** | | Feedback — rating + free text | **+10 total** | -Points are updated **transactionally** by Postgres RPCs (`security definer`): each RPC updates `profiles.points`, inserts the related row, and re-syncs the `leaderboard` mirror **in a single transaction**. This guarantees the leaderboard is always consistent and that duplicate actions (re-check-in, re-feedback) never double-award. +Points are updated **transactionally** by Postgres RPCs (`security definer`): each RPC updates `registrations.points`, inserts the related row, and re-syncs the `leaderboard` mirror **in a single transaction**. This guarantees the leaderboard is always consistent and that duplicate actions (re-check-in, re-feedback) never double-award. ## 6. Architecture @@ -137,21 +143,28 @@ The app talks to Supabase through **same-origin paths** (`/auth`, `/rest`, `/rea ## 7. Data model (Postgres) +The model is **multi-event**: people (`contacts`) register for `events` via +`registrations`, and all activity is scoped to `event_id` + `contact_email`. + | Table | Key fields | Notes | |---|---|---| -| `profiles` | id (= auth uid), email (unique), full_name, company, role (attendee/staff/admin), qr_token (unique), points | One row per attendee; id is the Supabase Auth user id | -| `slots` | id, name, start, end | 6 rows for 23 Oct | -| `sessions` | id, title, description, slot_id, room, speakers, capacity | 18 rows (3 per slot) | -| `preferences` | profile_id, session_id, slot_id | Unique per (profile, slot) — one pick per slot | -| `connections` | from_id, to_id, status (pending/accepted/rejected), created_at, resolved_at | Unique per unordered pair (via `least`/`greatest` index) | -| `checkins` | profile_id, session_id, staff_id, created_at | Unique per (profile, session) | -| `feedback` | profile_id, session_id, rating (1–5), comment, created_at | Unique per (profile, session); only after session end | -| `leaderboard` | profile_id, full_name, company, points, updated_at | Realtime mirror, kept in sync by the RPCs | -| `points_log` | profile_id, delta, category, created_at | Audit trail powering the per-category breakdown | +| `contacts` | email (PK), full_name, linkedin_url, show_email, show_linkedin, is_admin, qr_token (unique) | One row per person; mirrors `auth.users` (email + bcrypt(qr_token)) | +| `events` | id, name, start_date, end_date, location, is_active, + aggregates | Partial unique index → at most one active event | +| `registrations` | id, event_id, contact_email, type (attendee/speaker/staff/sponsor), checked_in, points | Unique (event_id, contact_email); points live here | +| `sponsors` | id, event_id, type, name, email, phone, paid, amount_eur, contact_email | `paid` gates visibility to non-admins | +| `slots` | id, event_id, type (session/lunch_break/coffee_break/keynote/close_up), name, slot_date, start_time, end_time | 6 rows for 23 Oct | +| `sessions` | id, event_id, slot_id, title, description, room, capacity, average_feedback, ai_generated_feedback, material_path | 18 rows (3 per session slot) | +| `session_speakers` | session_id, contact_email | Join; a session must have ≥1 speaker | +| `preferences` | event_id, contact_email, session_id, slot_id | Unique per (event, contact, slot) — one pick per slot | +| `connections` | event_id, from_email, to_email, status, created_at, resolved_at | Unique per unordered pair (via `least`/`greatest` index) | +| `checkins` | event_id, contact_email, session_id, staff_email, created_at | Unique per (event, contact, session) | +| `feedback` | event_id, contact_email, session_id, rating (1–5), comment, created_at | Unique per (event, contact, session); only after session end | +| `leaderboard` | event_id, contact_email, full_name, points, updated_at | Realtime mirror, kept in sync by the RPCs | +| `points_log` | event_id, contact_email, delta, category, created_at | Audit trail powering the per-category breakdown | -**Key RPCs** (all `security definer`, transactional): `lanyard_lookup`, `set_preference`, `clear_preference`, `create_connection_request`, `accept_connection`, `reject_connection`, `checkin_attendee`, `submit_feedback`, `adjust_points`, `get_agenda`, `get_public_profiles`. +**Key RPCs** (all `security definer`, transactional): `lanyard_lookup`, `get_active_event`, `get_agenda`, `get_public_contacts`, `get_leaderboard`, `set_preference`, `clear_preference`, `create_connection_request`, `accept_connection`, `reject_connection`, `checkin_attendee`, `submit_feedback`, `adjust_points`, `reset_qr_token`, `upsert_contact`, `create_registration`, `set_registration_type`, `evaluate_session_feedback`, `set_session_material`. -**RLS:** every table has policies. Profiles are self-or-admin; event tables are scoped to `auth.uid()`; slots/sessions are readable by any authenticated user and writable by admin; the leaderboard is readable by any authenticated user. +**RLS:** every table has policies. Contacts are self-or-admin; sponsors are visible only when `paid` (or to admins); schedule/registrations are readable per active event and writable by admin; the leaderboard is readable by any authenticated user. A `materials` storage bucket holds session materials (read for attendees, write for speakers/admins). ## 8. Tech stack @@ -181,9 +194,10 @@ Convivo/ │ └─ src/ # screens, components, lib, context ├─ supabase/ │ ├─ config.toml # Local stack config (ports, auth, RLS defaults) -│ ├─ migrations/ # 20260822000000_init.sql — schema, RLS, RPCs -│ └─ seed.sql # Slots, sessions, 13 demo users, Ana's demo state -├─ docker-compose.yml # Runs the app sidecar on the Supabase network +│ ├─ migrations/ # 20260824000000_redesign.sql — current schema, RLS, RPCs +│ └─ seed.sql # 1 event, 6 slots, 18 sessions, 14 contacts, demo state +├─ apps/admin/ # APPE Admin console (React + Vite + TS) +├─ docker-compose.yml # Runs the app sidecars on the Supabase network └─ mockup/index.html # Original interactive mockup (design reference) ``` @@ -243,7 +257,7 @@ Login = **QR code** (typed or scanned) + **email**. The QR token is the password | **Ana Silva** | attendee | `CVV-ANA-4821` | ana.silva@nubank.com | | **Bruno Costa** | staff | `CVV-BRU-1177` | bruno.costa@acme.com | | **Rita Lopes** | staff | `CVV-RIT-9034` | rita.lopes@globant.com | -| **Convivo Admin** | admin | `CVV-ADM-0001` | admin@appe.at | +| **APPE Admin** | admin | `CVV-ADM-0001` | admin@appe.at | | Tomás Ribeiro | attendee | `CVV-TOM-5566` | tomas.ribeiro@dataprev.com | | Sofia Almeida | attendee | `CVV-SOF-2299` | sofia.almeida@loop.com | | Marco Chen | attendee | `CVV-MRC-7712` | marco.chen@deepmind.com | @@ -259,7 +273,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. +5. Open the **APPE Admin** console on **:3001** → log in as **APPE Admin** (`CVV-ADM-0001` / admin@appe.at) → see the Dashboard, reset a contact's QR, adjust points, and edit the schedule. ## 13. Roadmap @@ -270,11 +284,11 @@ Full detail in [`roadmap.md`](./roadmap.md). | **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 console (Convivo Admin): Dashboard, Attendees, Schedule, Activity | ✅ | -| **3** | **Redesign — data model**: contacts / events / registrations / sponsors, slot types, session speakers + feedback/material | 🔨 next | -| **4** | **Redesign — APPE Admin**: rebrand + Contacts / Registrations / Sponsors / Schedule / Activity / event mgmt | ⬜ | -| **5** | **Redesign — Convivo App**: 24h login, 5s polling, QR type badge, red dot, speaker material | ⬜ | -| **6** | **Redesign — branding**: APPE favicon + icons for both apps | ⬜ | -| **7** | **Pretix** interface — sync tickets → contacts + registrations | ⬜ | +| **3** | **Redesign — data model**: contacts / events / registrations / sponsors, slot types, session speakers + feedback/material | ✅ | +| **4** | **Redesign — APPE Admin**: rebrand + Contacts / Registrations / Sponsors / Schedule / Activity / event mgmt | ✅ | +| **5** | **Redesign — Convivo App**: 24h login, 5s polling, QR type badge, red dot, speaker material | ✅ | +| **6** | **Redesign — branding**: APPE favicon + icons for both apps | ✅ | +| **7** | **Pretix** interface — sync tickets → contacts + registrations | ⬜ next | | **8** | **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. diff --git a/apps/admin/index.html b/apps/admin/index.html index e9acdb9..9a75c0b 100644 --- a/apps/admin/index.html +++ b/apps/admin/index.html @@ -2,15 +2,16 @@ - + + - + - Convivo Admin + APPE Admin
diff --git a/apps/admin/public/apple-touch-icon.png b/apps/admin/public/apple-touch-icon.png new file mode 100644 index 0000000..507781c Binary files /dev/null and b/apps/admin/public/apple-touch-icon.png differ diff --git a/apps/admin/public/favicon.png b/apps/admin/public/favicon.png new file mode 100644 index 0000000..e48048d Binary files /dev/null and b/apps/admin/public/favicon.png differ diff --git a/apps/admin/public/favicon.svg b/apps/admin/public/favicon.svg deleted file mode 100644 index 65fa75d..0000000 --- a/apps/admin/public/favicon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - C - diff --git a/apps/admin/public/icon-192.png b/apps/admin/public/icon-192.png index 8c1e1f9..83f8124 100644 Binary files a/apps/admin/public/icon-192.png and b/apps/admin/public/icon-192.png differ diff --git a/apps/admin/public/icon-512.png b/apps/admin/public/icon-512.png index 54772a4..8127ce9 100644 Binary files a/apps/admin/public/icon-512.png and b/apps/admin/public/icon-512.png differ diff --git a/apps/admin/public/manifest.webmanifest b/apps/admin/public/manifest.webmanifest index a55ad34..79937f4 100644 --- a/apps/admin/public/manifest.webmanifest +++ b/apps/admin/public/manifest.webmanifest @@ -1,13 +1,14 @@ { - "name": "Convivo Admin", - "short_name": "Convivo Admin", - "description": "Manage attendees, schedule, and points for the Convivo event.", + "name": "APPE Admin", + "short_name": "APPE Admin", + "description": "Manage contacts, registrations, sponsors, schedule, and points for APPE.", "start_url": "/", "display": "standalone", "background_color": "#f0f2f6", "theme_color": "#1f1b1b", "icons": [ { "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" }, - { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" } + { "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" }, + { "src": "/apple-touch-icon.png", "sizes": "180x180", "type": "image/png", "purpose": "any" } ] } diff --git a/apps/admin/src/App.tsx b/apps/admin/src/App.tsx index 040be93..a91631b 100644 --- a/apps/admin/src/App.tsx +++ b/apps/admin/src/App.tsx @@ -3,22 +3,28 @@ import { AuthProvider, useAuth } from './context/AuthContext'; import { ToastProvider } from './context/ToastContext'; import { Login } from './screens/Login'; import { Dashboard } from './views/Dashboard'; -import { Attendees } from './views/Attendees'; +import { Contacts } from './views/Contacts'; +import { Registrations } from './views/Registrations'; +import { Sponsors } from './views/Sponsors'; import { Schedule } from './views/Schedule'; import { Activity } from './views/Activity'; +import { Events } from './views/Events'; import { Spinner } from './components/ui'; -type View = 'dashboard' | 'attendees' | 'schedule' | 'activity'; +export type View = 'dashboard' | 'contacts' | 'registrations' | 'sponsors' | 'schedule' | 'activity' | 'events'; const NAV: { id: View; label: string; ico: string }[] = [ { id: 'dashboard', label: 'Dashboard', ico: '📊' }, - { id: 'attendees', label: 'Attendees', ico: '👥' }, + { id: 'contacts', label: 'Contacts', ico: '👥' }, + { id: 'registrations', label: 'Registrations', ico: '🎟️' }, + { id: 'sponsors', label: 'Sponsors', ico: '🤝' }, { id: 'schedule', label: 'Schedule', ico: '🗓️' }, { id: 'activity', label: 'Activity', ico: '⚡' }, + { id: 'events', label: 'Events', ico: '📅' }, ]; function Shell() { - const { profile, loading, signOut } = useAuth(); + const { contact, loading, signOut } = useAuth(); const [view, setView] = useState('dashboard'); if (loading) { @@ -29,16 +35,16 @@ function Shell() { ); } - if (!profile) return ; + if (!contact) return ; return (