A reusable fundraising platform for Last Man Standing competitions. Payments happen outside the app; administrators record and confirm them in the dashboard. The app provides a live member view, entrant management, prize/fundraising totals, picks, results and an audit trail.
npm install
cp .env.example .env.local # add your PostgreSQL connection
npm run devOpen http://localhost:3000.
Set PRISMA_DATABASE_URL in .env.local and in Vercel. It must be a PostgreSQL connection string and
must never use a NEXT_PUBLIC_ prefix.
Set AUTH_SECRET to a long random secret in both places (openssl rand -base64 32). The application
passes this value directly to NextAuth; it is required in Vercel at runtime. Authentication is
invite-only: public sign-up is deliberately unavailable. Create the first account locally with
BOOTSTRAP_USER_EMAIL, BOOTSTRAP_USER_PASSWORD (12+ characters), and optionally BOOTSTRAP_USER_NAME,
then run npm run user:create.
For the platform owner account, also set BOOTSTRAP_USER_ROLE=PLATFORM_ADMIN. A separate recovery-only
account may use BREAKGLASS_SUPPORT; it can provision or recover organiser access but is deliberately
blocked from participant names, contact details, entries, and picks.
Set a separate random CRON_SECRET in Vercel. The included hourly Vercel Cron request locks overdue open
gameweeks and assigns eligibility-aware autopicks. Vercel sends this secret to the cron endpoint.
Generate the client and create migrations locally:
set -a; source .env.local; set +a
npx prisma generate
npx prisma migrate dev --name initial_schemaThe initial migration is committed in prisma/migrations. For a production deployment, run
npm run prisma:deploy with PRISMA_DATABASE_URL configured in that environment; do not use
migrate dev against production.
Repo is already wired to origin:
git add .
git commit -m "Setup Next.js, Supabase, docs, infra"
git push -u origin main(Push from your machine so you can authenticate with GitHub.)
- Go to vercel.com and sign in with GitHub.
- Add New → Project and import the
lastmanrepo. - In Settings → Environment Variables add:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY
- Deploy. Vercel will run
next buildand host the app. - Add
PRISMA_DATABASE_URLto Vercel. Run production migrations explicitly as part of deployment once the initial schema is approved.
- Spec: docs/mvp/rvr-lms-app-spec.md (full), docs/SPEC.md (summary)
- Decisions: docs/DECISIONS.md
- Runbook: docs/RUNBOOK.md
- Infra: infra/README.md
npm run dev— local dev servernpm run build— production buildnpm run start— run production build locallynpm run lint— ESLint
- Next.js (App Router), TypeScript, Tailwind
- Prisma + PostgreSQL — database access and migrations
- Vercel — Hosting