$ whoami
> someone who just typed their email into /resume
$ cat ./README.md | head -2
> a gated resume download that counts real interest, not just hits
$ ./reveal --app=resume
> booting write-up...
The whole site is static — no server, no database, no API routes. The resume download is the one deliberate exception: a small, real backend that exists for exactly one job. It moved from AWS to GCP along with the rest of the site — see how ch-ai.in itself is built for why.
A static link works fine right up until you want to know whether anyone's actually looking at it. Three decisions shaped this instead:
Instant, on-screen link — not emailed. Emailing the link adds latency, a mail-sending dependency, and a reason for the link to end up in spam. A signed URL handed back immediately is simpler and just as safe, as long as it expires fast.
Firestore for telemetry — not a JSON file in a bucket. A shared JSON file has no atomic read-modify-write: two requests landing close together can race and clobber each other's write. Firestore costs about the same at this traffic level and removes the race entirely — same reasoning DynamoDB served on the AWS version.
Turnstile + a honeypot field — not Cloud Armor. A free, invisible CAPTCHA plus a hidden form field bots fill in but humans never see catches the overwhelming majority of abuse for zero added cost. A WAF is a reasonable next step if that ever stops being true, not a day-one requirement — true on either cloud.
The static site and this one dynamic endpoint are both served through the same Firebase Hosting site — /api/resume/** is a rewrite pointed at a Cloud Function instead of a static file. Same domain, so the browser never has to deal with CORS.
Everything in the request/response cycle is synchronous except the Firestore write, which is fire-and-forget — a logging failure should never be the reason a real visitor doesn't get their resume.
The AWS version had one more layer here worth being honest about: a Lambda Function URL has no equivalent of S3's Origin Access Control, so what actually closed that gap was a shared secret — CloudFront injected an X-Origin-Verify header, and the Lambda rejected anything missing it. Firebase Hosting rewrites don't support injecting a custom header into the proxied request, so there's no equivalent trick available here — this function has to allow unauthenticated invocation for the rewrite to reach it at all, which makes its own Cloud Run URL just as reachable directly. In practice that's a small difference: the honeypot field and Turnstile below are the real gate on either cloud, this is just one fewer (mostly cosmetic) layer on top of them.
company input real visitors never see or fill. Anything in it gets a convincing 200 response with no real URL, rather than an error that would teach a bot to leave it blank.siteverify endpoint — checked for success, and that the token's action and hostname match this exact integration, per Cloudflare's own defense-in-depth guidance. A network hiccup talking to Cloudflare fails closed (rejects the submission) rather than skipping the check.GetObject-equivalent GCS URL, good for 600 seconds — long enough to click a button, short enough that a leaked or shared link is worthless within the hour. Signed via the function's own service-account identity through the IAM API, not a private key file.The Cloud Function, its Firestore database, the private resume-asset GCS bucket, its dedicated service account, and the IAM bindings that connect them all live in one CDKTF construct (resume-api.ts) inside the same infra-gcp stack that provisions Cloud DNS and the Firebase project — one cdktf deploy, one piece of state, same pattern the AWS version used.
The function's service account is scoped to exactly this bucket and this Firestore database — nothing broader — plus one narrow grant to sign blobs as itself, which is what lets it mint V4 signed URLs without a private key file. Turnstile's secret key is a Terraform variable, supplied at deploy time and never written to a file in this repo. Unlike the static site's content, this stack doesn't deploy from CI yet — it's still a hand-run cdktf deploy, same as the rest of infra-gcp for now.