Skip to content

0011 Host the invite-only demo on Cloudflare

  • Status: Accepted
  • Date: 2026-12-05

Context

Milestone 2 starts with a small, invite-only demo for 5 to 10 testers (Demo site plan). A tester enters an invite code, uploads a CV, gets the remarks, questions, and draft profile that profiler/cv_to_profile.py produces (ADR 0010), confirms an email address, and then receives daily picks ranked for that profile.

The site needs:

  • a small web page and a server-side function, so the Anthropic and Resend keys never reach the browser
  • a database for testers' email addresses, profiles, and the hashes of jobs already sent
  • a bot check on the forms
  • a way for the daily GitHub Actions run to read the profiles and record what it sent
  • no cost, or almost none, at 10 users

The maintainer has bought the domain wfheaven.app at Cloudflare, so its DNS is managed there.

The architecture overview had planned FastAPI and Supabase. That plan predates the demo's scope and the domain purchase, and no code was written for it.

Options considered

Facts from the providers' own pages, read on 2026-12-05.

Cloudflare: Workers with static assets, D1, Turnstile Vercel Hobby and Supabase Free
Allowed use Free plan, no use restriction found Vercel Hobby is for "personal or non-commercial use" only (terms). A free demo fits, but a later paid service wouldn't.
Requests and compute 100,000 requests a day; 10 ms of CPU per request, and waiting on the network doesn't count (limits) 1,000,000 function calls a month, up to 300 s each (Hobby)
CV upload size 100 MB request bodies 4.5 MB request bodies (function limits)
Database D1 (SQLite): 500 MB per database, 5 million rows read and 100,000 written a day (D1 pricing) Supabase (PostgreSQL): 500 MB, 2 projects, paused after 1 week without activity (pricing)
Data location D1 eu jurisdiction, set when the database is created (data location) Supabase region Frankfurt, eu-central-1 (regions)
Encryption at rest D1: AES-256 (data security) Supabase: yes
Keys kept server-side Worker secrets: encrypted, and not shown again after they're set (secrets) Vercel environment variables
Bot check Turnstile: free, unlimited challenges (plans) A third service, or Turnstile anyway
Access from GitHub Actions D1 HTTP API: POST .../d1/database/{id}/query with an API token (API) Supabase REST API with a service key
Domain and DNS Already at Cloudflare DNS records point to Vercel
Vendors One Two, plus Cloudflare for DNS
Cost at 10 users USD 0; USD 5 a month for Workers Paid if 10 ms of CPU is too little USD 0; Vercel Pro USD 20 a month, Supabase Pro from USD 25 a month

Decision

Host the demo on Cloudflare:

  • Workers with static assets serve the page and the server-side endpoints at wfheaven.app. Pages Functions are billed as Workers anyway.
  • D1, created in the eu jurisdiction, stores testers, profiles, invite codes, and the keyed hashes of sent jobs (ADR 0012). It never stores a CV or job data.
  • Turnstile checks for bots on the invite and sign-up forms, and the Worker verifies each token on the server.
  • Worker secrets hold the Anthropic key, the Turnstile secret, and a Resend key for the confirmation email. GitHub Actions keeps its own Resend key for the daily email, so each key can be revoked on its own.

The Worker is written in TypeScript. Python Workers exist, but Cloudflare says WebAssembly support for Python packages is still in early stages. The site does three small things: check the code, call Claude, and store rows. The daily ranking stays in Python, in GitHub Actions.

To keep one source of truth, the prompt and the JSON schema move from profiler/cv_to_profile.py into a shared file that both the Python prototype and the Worker read. The daily run checks every stored profile with the profile rules the ranker uses (profile_from_dict) and skips a profile that fails, so a check that's missing from TypeScript can't break ranking.

The maintainer's profile, profiles/gergely.yaml, stays in the repository as the reference profile, and is also loaded into D1 as one tester.

One switch for going public

The invite check is one setting, INVITE_REQUIRED, read in one place in the Worker, demo/src/access.ts. Anything but exactly false keeps it on, so a typo can't open the site.

  • true, the demo: a valid invite code is needed, and each code allows 3 CVs.
  • false, a public site: no code. The per-code limit is replaced by a per-visitor limit, counted by an HMAC of the IP address with a secret key, and later by a per-email limit once sign-up exists. If the key is missing, the site stays closed.

The daily cap and the Anthropic spend limit apply in both modes. Going public needs no code change, only this setting, a secret, and the reviews in Milestone 3 of the roadmap. See Demo site.

Consequences

  • Everything runs on the free plans: Workers, D1, and Turnstile on Cloudflare, Resend Free (100 emails a day), and Anthropic usage of about USD 0.03 per CV.
  • Risk: 10 ms of CPU per request. Time spent waiting on Anthropic doesn't count, but encoding a large PDF to base64 does. Phase 1 measures it with real CVs. If it's too tight: limit uploads to 5 MB, or move to Workers Paid for USD 5 a month.
  • Risk: the D1 HTTP API has no published rate limit or service level for outside callers. The daily run makes a few queries a day. If it becomes a problem, a Worker endpoint protected by a secret token can take its place.
  • The eu jurisdiction can't be added later. The database must be created with it.
  • A second language, TypeScript, enters the project, for the site only.
  • The overview's planned FastAPI and Supabase stack is replaced by this decision.

Open questions

  • Does the 10 ms CPU limit hold for a 5 MB PDF? Measured in Phase 1.
  • For Milestone 3 and a paid service, revisit the free-plan limits.