Yes, Chef! #
A Cooklang recipe app on the AT Protocol: an offline-first SvelteKit PWA on Cloudflare Workers,
with ATProto sign-in. Design: ARCHITECTURE.md. Issues: bug ls (roadmap
a0443c7).
Layout #
apps/web SvelteKit 3 + adapter-cloudflare (yeschef-web): pages, API routes, PWA
apps/core plain Worker (yeschef-core): /oauth/*, SessionDO, StateDO, D1 migrations
packages/recipe pure TS: conversion, quantities (scale, convert, round)
packages/lexicons at.yeschef.* lexicons and NSIDs
spikes/* throwaway, each its own pnpm root
testdata/ Copy Me That export (the conversion corpus)
Develop #
Everything runs in the devenv shell (direnv allow, or devenv shell).
just check # install, types, svelte-check and unit tests for apps/* and packages/*
just dev # local D1 migrations, then core (wrangler dev) and web (vite dev)
just test # `just check`, then every spike's tests
just dev serves the app on http://127.0.0.1:5173 (ports move per jj workspace:
$YESCHEF_WEB_PORT, $YESCHEF_CORE_PORT). Vite proxies /oauth/* to core, and dev sign-in uses
the ATProto loopback client, so no key is needed. Only ALLOWED_DIDS (apps/core/wrangler.jsonc)
can sign in.
Deploy #
just deploy applies the remote D1 migrations, then deploys yeschef-core and yeschef-web to
https://yeschef.at, with credentials from the secrets vault. yeschef.at is kept apart from
rtw.run: its own zone, its own API token, its own vault entries.
| Vault entry | What |
|---|---|
yeschef/cloudflare_api_token |
a token for this project only (below) |
yeschef/cloudflare_account_id |
the Cloudflare account that holds the yeschef.at zone |
yeschef/oauth-private-key-jwk |
the OAuth client key: cd apps/core && pnpm run gen-key | secrets encrypt yeschef/oauth-private-key-jwk |
The API token (Cloudflare dashboard → My Profile → API Tokens → Create Custom Token):
- Account permissions: Workers Scripts: Edit, D1: Edit, Account Settings: Read.
- Zone permissions: Zone: Read, Workers Routes: Edit, DNS: Edit (the web Worker's custom domain creates its DNS record and certificate).
- Zone resources: Include → Specific zone → yeschef.at only. Account resources: the one account. That keeps the token off the rtw.run zone's DNS and routes, but Workers and D1 permissions are account-wide: Cloudflare can't limit them to some scripts or databases, so only a separate Cloudflare account would keep this token away from ride's Workers and D1.
Once: add yeschef.at as a zone (nameservers at the registrar), wrangler d1 create yeschef and put
its id in both wrangler.jsonc files (just deploy refuses the all-zero placeholder). CI
(.tangled/workflows/ci.yml) runs just check on every push to main; it never deploys.