Historical context from before the saved-link simplification. For the active product and setup, see architecture.
- Node.js 22+ (engines field in
package.json; CI uses 24). - pnpm 10+ (the
packageManagerfield pins the exact version). - Wrangler for the isolated local D1 database (already installed by
pnpm install). - A Cloudflare account with an R2 bucket
reader-pdfsbound asPDFS_BUCKET. - A Google OAuth client (Google Cloud Console → APIs & Services → Credentials)
with a redirect URI for
BETTER_AUTH_URL(e.g.http://localhost:8787/api/auth/callback/googlein dev).
pnpm installcp .env.example .env.localEdit .env.local (see operations/env.md for the full
list and validation):
BETTER_AUTH_SECRET(openssl rand -base64 32),BETTER_AUTH_URLGOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRETAI_GATEWAY_API_KEY(free-ai gateway) — optional for BYOK-only devLOCAL_AI_URL(optional; defaults tohttp://127.0.0.1:3456)
R2 credentials are only needed for production / wrangler dev; the binding
itself is provided by wrangler dev from wrangler.toml.
pnpm db:migrate:local # tracked migrations → isolated local D1See operations/runbooks/migrate-schema.md for migration discipline.
pnpm dev # Worker (wrangler dev, :8787) + Vite SPA (:5173) + local-ai, concurrently- Worker-served app:
http://localhost:8787 - Vite SPA only (proxies
/api→ 8787):http://localhost:5173 - Local AI providers are shown only in development mode.
If you only need the SPA:
pnpm dev:spaIf you only need the Worker:
pnpm dev:workercd packages/chrome-extension
pnpm install
pnpm dev # vite build --watch → dist/Then in Chrome: chrome://extensions → enable Developer mode → Load
unpacked → select packages/chrome-extension/dist. See
packages/chrome-extension/README.md.
pnpm --filter ./landing-astro devThe landing is overlaid onto dist/index.html during cf:build — see
operations/deploy.md.
See commands.md for the full script map. The essentials:
pnpm typecheck # tsc --noEmit (app + worker tsconfigs)
pnpm test # vitest run
pnpm test:e2e # playwright
pnpm lint # biome check .
pnpm format # biome format --write .
pnpm docs:check # validate docs/ links + structure (see scripts/check-docs.mjs)