Skip to content

feat: waitlist with admin approval and invite mails - #6

Merged
cubetribe merged 1 commit into
mainfrom
feat/waitlist
Nov 9, 2026
Merged

cubetribe merged 1 commit into
mainfrom
feat/waitlist

Conversation

@cubetribe

Copy link
Copy Markdown
Collaborator

What

A public waitlist so we can invite the WhatsApp and forum community, plus an admin area for approving people.

  • /warteliste: name, email and a consent checkbox. Entering the same address twice keeps one entry and shows the same response, so nobody can find out whether an address is already on the list. Spam protection is a hidden field that only bots fill in and a cap of 60 entries per 10 minutes. No captcha, as the masterplan asks.
  • /admin (admins only): filter by Open/Approved/Rejected, search, approve, reject and delete (with confirmation). A sidebar badge shows how many requests are open.
  • Approve & invite issues a Golden Ticket for Vibecoding Germany (30 days, creator_id = admin) without using up the admin's own 3-ticket budget. The invitation is then sent by email, through the same Vibecoding Germany SMTP account Supabase Auth already uses. Invite all open works through the queue one entry at a time. Each send is logged (invited_at, invite_count).
  • If SMTP isn't configured, the admin area falls back to a prefilled mailto: and copy-link.

How

  • supabase/migrations/0002_waitlist.sql only adds things; the 6 core tables are unchanged. It adds public.waitlist_entries (only admins can read it, no direct writes), private.admins (no client access), and the RPCs join_waitlist (anon), is_admin, approve_waitlist_entry, reject_waitlist_entry, delete_waitlist_entry and mark_waitlist_invited. The current owner of Vibecoding Germany is added as admin; bootstrap-owner.sql does the same on fresh projects.
  • POST /api/admin/waitlist/invite runs with the logged-in user's Supabase session, and the database decides whether they are an admin. A custom header (x-humans-only: admin) plus a JSON-only content type keep other sites from triggering the route. Links in the mail always use SITE_URL, never the request host. SMTP errors are logged on the server only, never sent to the browser.
  • SMTP settings come from server-only env vars (SITE_URL, SMTP_HOST/PORT/USER/PASSWORD/FROM, optional SMTP_REPLY_TO). They are never NEXT_PUBLIC_* and no credentials are in the repo. New dependency: nodemailer pinned to 10.2.1 (more than two weeks old).

Deployment order (important)

  1. Apply 0002_waitlist.sql to the live Supabase project.
  2. Deploy the web app. The new version calls is_admin() on load and won't work before the migration is applied.
  3. Add the SMTP env vars to the release's .env.production on the VPS and restart PM2.
  4. Send a test invite to yourself.

Details: docs/DEPLOYMENT.md, docs/FLUTTER_CONTRACT.md.

Validation

  • python3 supabase/tests/contract.py: 74/74 (23 new waitlist checks)
  • npm run lint, npm run typecheck, npm test (21/21), npm run build: green
  • Real mail template sent through nodemailer to a local SMTP sink; HTML rendering checked
  • Demo mode at 375px and on desktop: join, approve, simulated invite-all, non-admin locked out

Not yet verified: the migration and the invite route against hosted Supabase with a real session, and actual delivery through the Vibecoding Germany SMTP (spam score, rate limits).

Release impact

Minor (new feature, likely 2.1.0). Per the repo's release law this needs a separate release request; app/package.json is not bumped here.

🤖 Generated with Claude Code

Community members can join a public waitlist (/warteliste) with name,
email and consent. Admins approve entries in /admin, which issues a
Golden Ticket for Vibecoding Germany without consuming their own
three-ticket budget, and sends the invitation via the existing
Vibecoding Germany SMTP account (server-side env only). Without SMTP
configuration the admin area falls back to mailto and copy-link.

- supabase: additive migration 0002 (waitlist_entries, private.admins,
  join/approve/reject/delete/mark-invited RPCs), owner backfilled as admin
- app: waitlist page, admin page, invite API route, nodemailer 10.2.1
- tests: 74 SQL contract checks, 21 app tests
- docs: deployment order, SMTP env vars, Flutter contract, validation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cubetribe
cubetribe merged commit a585ba1 into main Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant