Chapter 06 — tests-workers, Vercel Edge backend

Chapter 06 — tests-workers, Vercel Edge backend#

Three HTTP endpoints, two libs (@upstash/redis, otplib), zero Next.js app code. The bare minimum to coordinate parallel tests against Igoristan.

Outline#

#FileTopic
0101-stack-edge.mdStack Vercel Edge Functions, runtime: "edge", Upstash Redis, otplib.
0202-otp-endpoint.mdGET /api/otp — generation + Redis SET + free payload.
0303-otp-history.mdGET /api/otp-history — Redis SCAN + return of every event.
0404-corsicadex.mdGET /api/corsicadex?id=N — static lookup.
0505-is-authorized.mdisAuthorized.ts — x-api-key vs apiKey query param.
0606-redis-upstash.mdlib/redis.ts — Upstash config.
0707-otp-coordination-flow.mdFull OTP flow: Igoristan ↔ workers ↔ Ocarina ↔ Redis.

Goals#

  • 3 .ts endpoints.
  • 2 lib/ files.
  • 1 consts/ file.
  • Total: ~7 TypeScript code files, plus package.json and vercel.json.

Goal: deployable in 30 seconds by a human.