Skip to content

Layout

Where the app, the Worker and the schemas live.

  • src/app: the React app. Routes are files in src/app/routes (TanStack Router); data lives in TanStack DB collections in src/app/data, stored on the device in IndexedDB.
  • src/worker: the Worker. It serves /api/*, /mcp, /oauth/*, /.well-known/oauth-* and /connect; everything else is the static app. Notebook is the Durable Object that devices sync against.
  • src/worker/schema.ts and src/worker/notebookSchema.ts: the Drizzle schemas of the D1 database (accounts, passkeys, calendar feeds) and of each Notebook (synced rows, reminder devices).
  • migrations/d1 and migrations/notebook: migrations generated by drizzle-kit. D1 ones are applied with bun run db:migrate; each Notebook applies its own when it wakes.
  • cloudflare.config.ts: Worker name, static assets and Durable Object declaration, read by cf.