Phase 0 + 1: Dockerized Supabase core + attendee PWA
Phase 0 — Supabase core (Docker via CLI): - Schema: profiles, slots, sessions, preferences, connections, checkins, feedback, leaderboard (Realtime mirror), points_log - RLS on every table; transactional security-definer points RPCs - Seed: 6 slots, 18 sessions, 13 demo users (QR token as auth password) Phase 1 — Attendee web PWA (React + Vite + TS): - Login via QR token + email (GoTrue, no email sent) - Home, Agenda, Scan/Connect, staff Check-in, Feedback, live Leaderboard, Profile - Same-origin proxy to Supabase (Vite dev / nginx in Docker) - Docker: multi-stage build -> nginx sidecar on the Supabase network 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:
commit
63aa4ecfc8
45 files changed
+6922
No files matched your search
@@ -0,0 +1,160 @@
|
||||
-- =============================================================================
|
||||
-- Convivo — Phase 0: seed data
|
||||
-- Ports the mockup's slots/sessions/people into real Supabase Auth users + rows.
|
||||
-- The QR token is the Auth password (QR + email login, no email sent).
|
||||
-- =============================================================================
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SLOTS (23 Oct)
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.slots (id, name, slot_date, start_time, end_time) values
|
||||
(1, 'Slot 1', '2026-10-23', '09:00:00', '09:45:00'),
|
||||
(2, 'Slot 2', '2026-10-23', '10:00:00', '10:45:00'),
|
||||
(3, 'Slot 3', '2026-10-23', '11:30:00', '12:15:00'),
|
||||
(4, 'Slot 4', '2026-10-23', '13:15:00', '14:00:00'),
|
||||
(5, 'Slot 5', '2026-10-23', '14:00:00', '14:45:00'),
|
||||
(6, 'Slot 6', '2026-10-23', '15:00:00', '15:45:00')
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- SESSIONS (18 — 3 per slot)
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.sessions (id, title, description, slot_id, room, capacity, speakers) values
|
||||
('10000000-0000-0000-0000-000000000001', 'Opening Keynote: The Next Decade of AI', 'A wide-angle look at where AI is heading over the next ten years — and what it means for product teams.', 1, 'Main Stage', 300, 'Dr. Elena Vasquez'),
|
||||
('10000000-0000-0000-0000-000000000002', 'Designing for Trust in AI Products', 'Practical patterns for making AI features transparent, explainable, and safe for your users.', 1, 'Room A', 80, 'Marco Chen'),
|
||||
('10000000-0000-0000-0000-000000000003', 'From Hackathon to Product', 'How a weekend prototype became a product with 40k users — the messy middle included.', 1, 'Room B', 60, 'Sofia Almeida'),
|
||||
('10000000-0000-0000-0000-000000000004', 'AI in Practice: Lessons from Production', 'Lessons learned shipping LLM features to production: latency, cost, evals, and the surprises.', 2, 'Main Stage', 300, 'Bruno Costa'),
|
||||
('10000000-0000-0000-0000-000000000005', 'The Introvert''s Guide to Networking', 'Small, low-energy ways to have big conversations at any event. (Yes, this one is for you.)', 2, 'Room A', 80, 'Rita Lopes'),
|
||||
('10000000-0000-0000-0000-000000000006', 'Building with Dataverse: Beyond the Basics', 'Go beyond the basics: relationships, security roles, and automations that actually scale.', 2, 'Room B', 60, 'Tomás Ribeiro'),
|
||||
('10000000-0000-0000-0000-000000000007', 'Scaling Teams at 10x', 'What breaks when you grow 10x in two years, and the rituals that kept us sane.', 3, 'Main Stage', 300, 'Julia Santos'),
|
||||
('10000000-0000-0000-0000-000000000008', 'Security by Design', 'Baking security into the product from day one instead of bolting it on at the end.', 3, 'Room A', 80, 'Pedro Nunes'),
|
||||
('10000000-0000-0000-0000-000000000009', 'Data Storytelling', 'Turn dashboards into narratives your stakeholders actually remember.', 3, 'Room B', 60, 'Carla Mendes'),
|
||||
('10000000-0000-0000-0000-000000000010', 'The Future of Work', 'Hybrid, async, and AI-augmented: where work is going and how to prepare for it.', 4, 'Main Stage', 300, 'Dr. Elena Vasquez'),
|
||||
('10000000-0000-0000-0000-000000000011', 'Prototyping with AI', 'From idea to clickable prototype in an afternoon — tools and workflows that work.', 4, 'Room A', 80, 'Diego Ferreira'),
|
||||
('10000000-0000-0000-0000-000000000012', 'Pricing SaaS in 2026', 'Usage-based, seat-based, or hybrid? What is actually working right now.', 4, 'Room B', 60, 'Marina Costa'),
|
||||
('10000000-0000-0000-0000-000000000013', 'Community-Led Growth', 'Building a community that sells for you — case studies and playbooks.', 5, 'Main Stage', 300, 'Lucas Oliveira'),
|
||||
('10000000-0000-0000-0000-000000000014', 'Accessibility First', 'Why accessible products are better products, and how to start this sprint.', 5, 'Room A', 80, 'Carla Mendes'),
|
||||
('10000000-0000-0000-0000-000000000015', 'The Art of the Demo', 'Structure, pacing, and the moments that make a demo land.', 5, 'Room B', 60, 'Pedro Nunes'),
|
||||
('10000000-0000-0000-0000-000000000016', 'Closing Panel: What''s Next', 'Founders, researchers, and builders on what comes next — with audience Q&A.', 6, 'Main Stage', 300, 'Elena · Bruno · Rita'),
|
||||
('10000000-0000-0000-0000-000000000017', 'Open Space: Your Ideas', 'You bring the topic, we bring the room. 45 minutes of your ideas.', 6, 'Room A', 80, 'Facilitated by Ana Silva'),
|
||||
('10000000-0000-0000-0000-000000000018', 'Lightning Talks', 'Eight speakers, five minutes each. Fast, fun, and unpredictable.', 6, 'Room B', 60, '8 speakers')
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- AUTH USERS (QR token = password). 12 attendees + 1 admin.
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- NOTE: confirmation_token is set to '' (not NULL) because GoTrue's password
|
||||
-- grant cannot scan a NULL confirmation_token on manually-inserted users.
|
||||
insert into auth.users (instance_id, id, aud, role, email, encrypted_password, email_confirmed_at, confirmation_token, recovery_token, email_change_token_new, email_change, raw_app_meta_data, raw_user_meta_data, created_at, updated_at, confirmation_sent_at, last_sign_in_at) values
|
||||
('00000000-0000-0000-0000-000000000000', '11111111-1111-1111-1111-111111111111', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ANA-4821', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Ana Silva"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '22222222-2222-2222-2222-222222222222', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-BRU-1177', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Bruno Costa"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '33333333-3333-3333-3333-333333333333', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-RIT-9034', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Rita Lopes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '44444444-4444-4444-4444-444444444444', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-TOM-5566', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Tomás Ribeiro"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '55555555-5555-5555-5555-555555555555', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-SOF-2299', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Sofia Almeida"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '66666666-6666-6666-6666-666666666666', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-MRC-7712', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marco Chen"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '77777777-7777-7777-7777-777777777777', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-JUL-3345', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Julia Santos"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '88888888-8888-8888-8888-888888888888', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-PED-8801', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Pedro Nunes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', '99999999-9999-9999-9999-999999999999', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-CAR-6623', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Carla Mendes"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-DIE-4458', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Diego Ferreira"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-MNA-2210', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Marina Costa"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'cccccccc-cccc-cccc-cccc-cccccccccccc', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-LUC-9987', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Lucas Oliveira"}', now(), now(), now(), now()),
|
||||
('00000000-0000-0000-0000-000000000000', 'dddddddd-dddd-dddd-dddd-dddddddddddd', 'authenticated', 'authenticated', '[email protected]', crypt('CVV-ADM-0001', gen_salt('bf')), now(), '', '', '', '', '{"provider":"email","providers":["email"]}', '{"full_name":"Convivo Admin"}', now(), now(), now(), now())
|
||||
on conflict (id) do nothing;
|
||||
|
||||
insert into auth.identities (id, provider_id, identity_data, provider, user_id, created_at, updated_at, last_sign_in_at) values
|
||||
('11111111-1111-1111-1111-111111111111', '11111111-1111-1111-1111-111111111111', '{"sub":"11111111-1111-1111-1111-111111111111","email":"[email protected]"}', 'email', '11111111-1111-1111-1111-111111111111', now(), now(), now()),
|
||||
('22222222-2222-2222-2222-222222222222', '22222222-2222-2222-2222-222222222222', '{"sub":"22222222-2222-2222-2222-222222222222","email":"[email protected]"}', 'email', '22222222-2222-2222-2222-222222222222', now(), now(), now()),
|
||||
('33333333-3333-3333-3333-333333333333', '33333333-3333-3333-3333-333333333333', '{"sub":"33333333-3333-3333-3333-333333333333","email":"[email protected]"}', 'email', '33333333-3333-3333-3333-333333333333', now(), now(), now()),
|
||||
('44444444-4444-4444-4444-444444444444', '44444444-4444-4444-4444-444444444444', '{"sub":"44444444-4444-4444-4444-444444444444","email":"[email protected]"}', 'email', '44444444-4444-4444-4444-444444444444', now(), now(), now()),
|
||||
('55555555-5555-5555-5555-555555555555', '55555555-5555-5555-5555-555555555555', '{"sub":"55555555-5555-5555-5555-555555555555","email":"[email protected]"}', 'email', '55555555-5555-5555-5555-555555555555', now(), now(), now()),
|
||||
('66666666-6666-6666-6666-666666666666', '66666666-6666-6666-6666-666666666666', '{"sub":"66666666-6666-6666-6666-666666666666","email":"[email protected]"}', 'email', '66666666-6666-6666-6666-666666666666', now(), now(), now()),
|
||||
('77777777-7777-7777-7777-777777777777', '77777777-7777-7777-7777-777777777777', '{"sub":"77777777-7777-7777-7777-777777777777","email":"[email protected]"}', 'email', '77777777-7777-7777-7777-777777777777', now(), now(), now()),
|
||||
('88888888-8888-8888-8888-888888888888', '88888888-8888-8888-8888-888888888888', '{"sub":"88888888-8888-8888-8888-888888888888","email":"[email protected]"}', 'email', '88888888-8888-8888-8888-888888888888', now(), now(), now()),
|
||||
('99999999-9999-9999-9999-999999999999', '99999999-9999-9999-9999-999999999999', '{"sub":"99999999-9999-9999-9999-999999999999","email":"[email protected]"}', 'email', '99999999-9999-9999-9999-999999999999', now(), now(), now()),
|
||||
('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '{"sub":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","email":"[email protected]"}', 'email', 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', now(), now(), now()),
|
||||
('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '{"sub":"bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb","email":"[email protected]"}', 'email', 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', now(), now(), now()),
|
||||
('cccccccc-cccc-cccc-cccc-cccccccccccc', 'cccccccc-cccc-cccc-cccc-cccccccccccc', '{"sub":"cccccccc-cccc-cccc-cccc-cccccccccccc","email":"[email protected]"}', 'email', 'cccccccc-cccc-cccc-cccc-cccccccccccc', now(), now(), now()),
|
||||
('dddddddd-dddd-dddd-dddd-dddddddddddd', 'dddddddd-dddd-dddd-dddd-dddddddddddd', '{"sub":"dddddddd-dddd-dddd-dddd-dddddddddddd","email":"[email protected]"}', 'email', 'dddddddd-dddd-dddd-dddd-dddddddddddd', now(), now(), now())
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- PROFILES
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.profiles (id, email, full_name, company, role, qr_token, points) values
|
||||
('11111111-1111-1111-1111-111111111111', '[email protected]', 'Ana Silva', 'Nubank', 'attendee', 'CVV-ANA-4821', 40),
|
||||
('22222222-2222-2222-2222-222222222222', '[email protected]', 'Bruno Costa', 'Acme Corp', 'staff', 'CVV-BRU-1177', 140),
|
||||
('33333333-3333-3333-3333-333333333333', '[email protected]', 'Rita Lopes', 'Globant', 'staff', 'CVV-RIT-9034', 95),
|
||||
('44444444-4444-4444-4444-444444444444', '[email protected]', 'Tomás Ribeiro', 'Dataprev', 'attendee', 'CVV-TOM-5566', 88),
|
||||
('55555555-5555-5555-5555-555555555555', '[email protected]', 'Sofia Almeida', 'Loop', 'attendee', 'CVV-SOF-2299', 76),
|
||||
('66666666-6666-6666-6666-666666666666', '[email protected]', 'Marco Chen', 'DeepMind', 'attendee', 'CVV-MRC-7712', 70),
|
||||
('77777777-7777-7777-7777-777777777777', '[email protected]', 'Julia Santos', 'iFood', 'attendee', 'CVV-JUL-3345', 64),
|
||||
('88888888-8888-8888-8888-888888888888', '[email protected]', 'Pedro Nunes', 'Microsoft', 'attendee', 'CVV-PED-8801', 58),
|
||||
('99999999-9999-9999-9999-999999999999', '[email protected]', 'Carla Mendes', 'QuintoEssencial', 'attendee', 'CVV-CAR-6623', 52),
|
||||
('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', '[email protected]', 'Diego Ferreira', 'Stone', 'attendee', 'CVV-DIE-4458', 35),
|
||||
('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', '[email protected]', 'Marina Costa', 'OLX', 'attendee', 'CVV-MNA-2210', 28),
|
||||
('cccccccc-cccc-cccc-cccc-cccccccccccc', '[email protected]', 'Lucas Oliveira', 'USP', 'attendee', 'CVV-LUC-9987', 15),
|
||||
('dddddddd-dddd-dddd-dddd-dddddddddddd', '[email protected]', 'Convivo Admin', 'Convivo', 'admin', 'CVV-ADM-0001', 0)
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- LEADERBOARD (mirror of points)
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.leaderboard (profile_id, full_name, company, points)
|
||||
select id, full_name, company, points from public.profiles
|
||||
on conflict (profile_id) do update
|
||||
set full_name = excluded.full_name, company = excluded.company, points = excluded.points, updated_at = now();
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- POINTS LOG
|
||||
-- Ana: a coherent breakdown (2 checkins, 2 connections, 1 feedback = 40).
|
||||
-- Everyone else: a single 'admin' seed entry for their starting points.
|
||||
-- -----------------------------------------------------------------------------
|
||||
insert into public.points_log (profile_id, delta, category) values
|
||||
('11111111-1111-1111-1111-111111111111', 10, 'checkin'),
|
||||
('11111111-1111-1111-1111-111111111111', 10, 'checkin'),
|
||||
('11111111-1111-1111-1111-111111111111', 5, 'connection'),
|
||||
('11111111-1111-1111-1111-111111111111', 5, 'connection'),
|
||||
('11111111-1111-1111-1111-111111111111', 10, 'feedback'),
|
||||
('22222222-2222-2222-2222-222222222222', 140, 'admin'),
|
||||
('33333333-3333-3333-3333-333333333333', 95, 'admin'),
|
||||
('44444444-4444-4444-4444-444444444444', 88, 'admin'),
|
||||
('55555555-5555-5555-5555-555555555555', 76, 'admin'),
|
||||
('66666666-6666-6666-6666-666666666666', 70, 'admin'),
|
||||
('77777777-7777-7777-7777-777777777777', 64, 'admin'),
|
||||
('88888888-8888-8888-8888-888888888888', 58, 'admin'),
|
||||
('99999999-9999-9999-9999-999999999999', 52, 'admin'),
|
||||
('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 35, 'admin'),
|
||||
('bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 28, 'admin'),
|
||||
('cccccccc-cccc-cccc-cccc-cccccccccccc', 15, 'admin');
|
||||
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- ANA'S DEMO STATE (so the app looks alive on first login)
|
||||
-- -----------------------------------------------------------------------------
|
||||
-- Preferences: one pick per slot (matches the mockup).
|
||||
insert into public.preferences (profile_id, session_id, slot_id) values
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', 1),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000004', 2),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000009', 3),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000011', 4),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000013', 5),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000016', 6)
|
||||
on conflict (profile_id, slot_id) do nothing;
|
||||
|
||||
-- Check-ins: Ana is checked into Slot 1 (s2) and Slot 2 (s4), by staff Bruno.
|
||||
insert into public.checkins (profile_id, session_id, staff_id) values
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', '22222222-2222-2222-2222-222222222222'),
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000004', '22222222-2222-2222-2222-222222222222')
|
||||
on conflict (profile_id, session_id) do nothing;
|
||||
|
||||
-- Connections: accepted with Bruno & Rita; incoming from Sofia; outgoing to Julia.
|
||||
insert into public.connections (id, from_id, to_id, status, created_at, resolved_at) values
|
||||
('e0000000-0000-0000-0000-000000000001', '11111111-1111-1111-1111-111111111111', '22222222-2222-2222-2222-222222222222', 'accepted', now() - interval '2 hours', now() - interval '2 hours'),
|
||||
('e0000000-0000-0000-0000-000000000002', '33333333-3333-3333-3333-333333333333', '11111111-1111-1111-1111-111111111111', 'accepted', now() - interval '90 minutes', now() - interval '90 minutes'),
|
||||
('e0000000-0000-0000-0000-000000000003', '55555555-5555-5555-5555-555555555555', '11111111-1111-1111-1111-111111111111', 'pending', now() - interval '15 minutes', null),
|
||||
('e0000000-0000-0000-0000-000000000004', '11111111-1111-1111-1111-111111111111', '77777777-7777-7777-7777-777777777777', 'pending', now() - interval '5 minutes', null)
|
||||
on conflict (id) do nothing;
|
||||
|
||||
-- Feedback: Ana rated Slot 1 (s2).
|
||||
insert into public.feedback (profile_id, session_id, rating, comment) values
|
||||
('11111111-1111-1111-1111-111111111111', '10000000-0000-0000-0000-000000000002', 5, 'Great patterns, very practical. Wish it were longer!')
|
||||
on conflict (profile_id, session_id) do nothing;
|
||||
Reference in new issue
Block a user