Stabilize Product Builders v0.1 Demo Day workflow - #49
Open
SaharPak wants to merge 1 commit into
Open
Conversation
Implement the end-to-end Demo Day workflow: submit, admin review/approve, public listing, vote, select for a Demo Day, and a public Demo Day page. - Add pending/rejected statuses; submissions default to pending review - Admin approve/reject queue and Demo Day creation + line-up selection - demo_day_projects curation table; rebuilt public /demo-days (upcoming + archive) - Builders can view/edit their own pending projects (new self-read policy) - Fix RLS privilege escalations: block self-promotion to admin and builder self-approval via before-update triggers - Harden demo mode: richer mock data, Demo data banner, submit guard, and a proxy that degrades gracefully when Supabase env is missing - ADMIN_EMAILS allowlist auto-promotes trusted admins on sign-in (server-only) - Reproducible seed.sql, updated .env.example, README, MANUAL_TEST_PLAN, and STABILIZATION_REPORT
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stabilizes the app into a clean, reliable v0.1 that supports the real Tech Immigrants Demo Day workflow end to end:
submit → admin approve → public project → vote/support → select for Demo Day → public Demo Day pageThe repo already had a working weekly "Friday showcase" (immediate publishing + automatic top-3 snapshot). This PR adds the missing review/approve gate and manual Demo Day curation, fixes two RLS privilege-escalation holes, and hardens demo mode, while keeping the existing weekly features.
New end-to-end workflow
/demo-days.Security fixes
update profiles set is_admin = trueon their own row. Now enforced by aprotect_admin_flagbefore-update trigger.status = 'live'. Now aprotect_product_statustrigger restricts status changes to admins (builders may only withdraw →removed).Database changes
004_review_workflow_and_demo_curation.sql:pendingandrejectedtoproducts.status; default is nowpending.protect_admin_flagandprotect_product_statustriggers (security fixes above).demo_day_projectstable (admin-curated line-up:week_of,product_id,display_order,status) with public-read + admin-manage RLS.supabase/seed.sqlupdated — reproducible, idempotent demo data (admin account, projects incl. a pending one, votes, an upcoming Demo Day with line-up, a completed Demo Day with winners).demo_day_winnersauto-snapshot table is unchanged and still works.Manual Supabase steps required before production
001→004in the Supabase SQL Editor.supabase/seed.sql.product-imagesStorage bucket and enable Google OAuth..env.example→.env.localand set env vars (NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY,SUPABASE_SERVICE_ROLE_KEY,CRON_SECRET).ADMIN_EMAILS=you@example.com(auto-promotes trusted emails to admin on sign-in) or runupdate profiles set is_admin = true ....Works in demo mode without any config
With no/placeholder Supabase env, the app runs on read-only sample data: home feed, leaderboard, project detail, an upcoming Demo Day with a sample line-up, the pending-project owner view, a "Demo data" banner, and a friendly demo guard on
/submit. The proxy skips auth entirely so there are no redirect loops or blank crashes.Tested
npm install,npm run lint,npm run buildall pass (13 routes)./,/demo-days,/submit,/leaderboard,/p/p1,/p/p4(pending banner),/u/alexbuildsreturn 200 with expected content..next/static).MANUAL_TEST_PLAN.mdfor 18 manual test groups including RLS/security checks.Known limitations
seed.sqlinserts anauth.usersrow directly (relies on pgcrypto, on by default in Supabase); convenience for fresh projects, not tested against every Supabase version.Next 5 recommended tasks
display_order."use server"actions withrevalidatePath, add unit tests for status transitions + RLS.Notes
.env.localis gitignored; only safe placeholder emails).