This is a separate export of Clario's current design and interactions, adapted to standard Next.js and a PostgreSQL waitlist backend. The existing Sites deployment is unchanged.
Requires Node.js 22 or newer.
npm ci
cp .env.example .env.localFill in DATABASE_URL with a PostgreSQL provider's pooled TLS connection URL and RATE_LIMIT_SECRET with a random secret. Never commit credentials. The database URL must remain server-only; do not prefix it with NEXT_PUBLIC_.
npm run db:setup
npm run dev- Extract this archive and push its contents to a GitHub repository. Use this folder as the repository root.
- Import that repository in Vercel and use the Next.js framework preset.
- Set DATABASE_URL and RATE_LIMIT_SECRET in Vercel environment variables for each environment you intend to use. Use separate databases for preview and production.
- Run
npm run db:setuponce against the intended database before accepting submissions. - Deploy. The build does not require database credentials, but registration does. The endpoint returns an error, never a false saved confirmation, when storage is unavailable.
- Test
/,/home,/get-started, navigation, and a waitlist submission. Redeploy after changing runtime environment variables.
Build command: npm run build. Output: default Next.js output; do not configure dist as the output directory. npm start is for a local production smoke test.
The archive contains no subscriber records. Existing registrations remain in the original database. Export those records securely into a JSON array with fields email, name, preference, use_case, created_at, and consent_version. Then:
npm run db:import -- /absolute/path/to/waitlist.jsonThe import uses a transaction, retains timestamps and consent versions, and leaves existing matching emails unchanged. Keep exports outside your repository. Verify the row counts and sample entries before directing production traffic to Vercel. Existing registrations are not migrated automatically.
- POST
/api/waitlist: same-origin check, JSON input validation, honeypot, bounded field lengths, parameterized PostgreSQL queries, and duplicate-safe insert. - Rate limiting: ten attempts per ten-minute window, stored in PostgreSQL using an HMAC of the window and Vercel's forwarded client address. No raw IP is stored. Old keys are deleted during subsequent submissions. Outside Vercel, configure a trusted client-address source before production; the default fallback groups non-Vercel requests together.
- No email delivery service is configured. Successful registration means stored interest, not a confirmation email sent.
- Use a pooled connection URL suited to serverless functions. TLS behavior is controlled by your provider's connection URL; certificate verification is not disabled by application code.
Run npm run typecheck and npm run build. Database persistence and migration must also be tested with your actual database before launch.
Documentation: https://nextjs.org/docs/app/getting-started/deploying and https://node-postgres.com/features/queries