← back to AbramsEgo

build-queue/failed/36-affiliate-engine.md

18 lines

# Task 36 — affiliate engine: /go/:slug tracked redirects + registry (engine 2)

Read SPEC.md. ~12 min, surgical.

1. Create data/affiliates.json registry: [{slug, label, url, program, note, added}] — seed with
   3-5 DRAFT candidates relevant to the fleet-ops audience (e.g. hosting, monitoring, AI-tools
   affiliate programs); mark each `"status":"draft"` — Steve joins programs later (gated), so the
   urls are the products' plain pages for now.
2. server.js: GET /go/:slug → look up registry → append {ts, slug, ua, ref} to
   data/affiliate-clicks.jsonl → 302 to the url. Unknown slug → 404. Include /go/ in the
   PUBLIC_LANDING allowlist (only when the flag is 1).
3. Landing: a small tasteful "tools we run on" strip using /go/ links (renders only when the
   registry has non-draft entries — so nothing customer-facing changes now).
4. Engine pill: affiliate flips to "live" ONLY when ≥1 registry entry has status:"active" (Steve's
   switch = editing the entry after joining the program).
5. pm2 restart; curl /go/<seed-slug> → 302 + click row appended. Commit
   `feat(affiliate): tracked /go redirects + draft registry`. No program signups — draft only.