mirror of
https://github.com/hanzo-apps/waitlist.git
synced 2026-10-30 14:48:32 +00:00
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.
12 lines
301 B
JSON
12 lines
301 B
JSON
{
|
|
"name": "@hanzo/waitlist-mock-api",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"description": "Reference implementation of the /v1/waitlist/* contract. In-memory. Used by the demo and as a spec.",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "node server.js",
|
|
"start": "node server.js"
|
|
}
|
|
}
|