Files
Hanzo AI 6df0bfecf4 feat(apps/mock-api): reference impl of /v1/waitlist/* contract
Adds apps/mock-api/ — a ~200-line Node http server that implements the
exact wire format of plugins/waitlist (Base Go plugin). Used by the
demo so the full Join → Success-with-rank-and-share flow works
standalone with no Base instance. Doubles as an executable spec for
anyone reimplementing the contract in another language.

Storage is in-memory; restart drops state. Implements:
- POST /v1/waitlist/join     idempotent on (waitlist, email), atomic
                             referral credit, collision-safe refCode
- GET  /v1/waitlist/status   rank + share URL
- GET  /v1/waitlist/export   CSV, Bearer-auth via WAITLIST_ADMIN_SECRET

Same anti-abuse defenses as the Go plugin: crypto/rand refCodes from a
36-char alphabet that excludes confusing glyphs, disposable email
blocklist, per-IP sliding-window rate limit (5/IP/hour default), email
normalization. Turnstile is a host-side concern in the mock.

Wired into the demo via NEXT_PUBLIC_BASE_URL=http://localhost:8090.
README updated to document the two-terminal dev flow.
2026-06-10 08:08:12 -07:00

25 lines
473 B
JSON

{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**", "dist/**"]
},
"dev": {
"cache": false,
"persistent": true,
"dependsOn": ["^build"]
},
"lint": {
"dependsOn": ["^lint"]
},
"typecheck": {
"dependsOn": ["^typecheck"]
},
"test": {
"dependsOn": ["^test"],
"outputs": ["coverage/**"]
}
}
}