This repo uses pnpm (version pinned in package.json's packageManager field). Install dependencies and run the development server:
pnpm install
pnpm devOpen http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.
When an admin runs matching, the server generates two shared conversation starters
per selected pair with Anthropic and stores them in curr_matches.conversation_starters
(JSONB). Both participants see the same saved items on /match; viewing or refreshing
a match never calls Anthropic. Starters are generated for new matches only, and are
not archived in previous_matches.
Set these server-side environment variables in the root .env and in your deployment:
LLM_API_KEY=<your Anthropic API key>
# Optional model override; the default is claude-haiku-4-5-20251001.
ANTHROPIC_MODEL=claude-haiku-4-5-20251001Do not prefix the LLM key with NEXT_PUBLIC_ or commit it. If the column has not
already been added, run scripts/curr_matches.sql in the Supabase SQL editor; its
column addition is safe to rerun.
Only relevant survey fields are sent to Anthropic, with multiple-choice answers decoded to text. Emails, names, social links, pronouns, matching preferences, and embeddings are excluded. Responses must contain exactly two distinct, nonempty items of at most 240 characters each. Missing credentials, unavailable profiles, API failures, and invalid output fall back to two generic questions. Old matches without saved starters also display generic questions.
Generation uses at most four concurrent requests, a 12-second request timeout, one SDK retry, and a shared 30-second deadline for loading profiles and generating the round's starters. Pairs left when that deadline expires receive fallback questions. The matching route runs with a 60-second function duration (the Hobby plan ceiling), which must fit local embedding generation, this deadline, and database writes. Larger events may need a durable background job.
Manual pairs (manual_match_pairs) get conversation starters like any other pair.
Embeddings are generated locally (see src/lib/matchmaker/embedder.ts), so neither
matching nor starters need an OpenAI key.
Run pnpm test for mocked Anthropic/Supabase checks, including validation,
fallbacks, profile filtering, concurrency, and cached embeddings.
These tests do not use real credentials or call live services.