ding ding ding: https://dm.chillidonut.com/
|
|
hai 1 mes | |
|---|---|---|
| client | hai 1 mes | |
| docs | hai 1 mes | |
| drizzle | hai 1 mes | |
| public | hai 1 mes | |
| scripts | hai 1 mes | |
| src | hai 1 mes | |
| tests | hai 1 mes | |
| .dev.vars.example | hai 1 mes | |
| .gitignore | hai 1 mes | |
| .prettierignore | hai 1 mes | |
| .prettierrc | hai 1 mes | |
| README.md | hai 1 mes | |
| drizzle.config.ts | hai 1 mes | |
| package.json | hai 1 mes | |
| pnpm-lock.yaml | hai 1 mes | |
| tsconfig.json | hai 1 mes | |
| wrangler.toml | hai 1 mes |
Spec: docs/spec.md (exported from the Claude Doc, which is the editable source). Learnings: docs/blog/.
Hono + Better Auth (phone OTP + anonymous) + D1/Drizzle + one Durable Object per hand + Jev (TypeSafe System One) for live odds and the lever.
pnpm install
cp .dev.vars.example .dev.vars # then paste TYPESAFE_API_KEY + BETTER_AUTH_SECRET
pnpm db:migrate:dev # local D1 (miniflare)
pnpm dev # http://localhost:8787 — OTP codes print to this console
Open / on two phones on the same LAN (or wrangler dev --ip 0.0.0.0), "Jump in" with a name, create a hand, open /h/<id> on the other phone.
pnpm dev — wrangler dev, local D1 + DO, hot reloadpnpm cf-typegen — regenerate worker-configuration.d.ts after editing wrangler.tomlpnpm auth:update then pnpm db:generate — after changing Better Auth pluginspnpm db:migrate:dev / pnpm db:migrate:prodpnpm deploy — wrangler deploy (first time: create D1, paste its id into wrangler.toml, and configure the production secrets listed below)pnpm exec wrangler versions upload gives a preview URL without touching prodProduction uses Twilio because wrangler.toml sets OTP_MODE=twilio. Configure secrets without adding them to a file or Git:
pnpm exec wrangler secret put TYPESAFE_API_KEY
pnpm exec wrangler secret put BETTER_AUTH_SECRET
pnpm exec wrangler secret put TWILIO_ACCOUNT_SID
pnpm exec wrangler secret put TWILIO_AUTH_TOKEN
pnpm exec wrangler secret put TWILIO_FROM
BETTER_AUTH_URL is optional. Set it as a Wrangler variable or secret when production needs a fixed canonical origin; otherwise auth uses the origin of each incoming Cloudflare request. Local development explicitly uses OTP_MODE=console from .dev.vars.
src/hand.ts — the Hand DO: state, WebSocket fan-out, chips/veto/lock, debounced Jev odds, the lever (seeded sample), roundssrc/jev.ts — typed Jev clientsrc/dealer.ts — human-authored dealer line bank; Jev picks by tagsrc/auth/index.ts — phone OTP (console in dev, Twilio when OTP_MODE=twilio) + anonymouspublic/index.html — mobile client: felt table, chip stacks, live odds bars, lever, reels reveal with near-miss, roundswrangler.toml [vars].PICK_INSTRUCTIONS — the "semi-decision-makery" dial. Edit and hot-reload.scripts/drive.sh runs a full two-member hand against a running dev server (sign-in, chips, veto, lock, pull, again, accept) and prints odds, winner, reel order and dealer line.
Options agent (screenshot intake / "More options" regen — the client prompts for labels), tables, ledger, rubber-banding, expiry alarms, run structure.