Skip to content

Worker Factory & Member API

createApp() (src/api/index.ts) is the factory that assembles the OpenAPIHono app — middleware chain, route registration, error envelope — and is reused everywhere the API runs: the Worker entry (src/worker.ts) and the test harness (tests/helpers/test-worker.ts) both build the app from the same factory, so tests exercise the real middleware/route wiring. See Worker API & Clerk Auth for the chain.

List sharing is the membership surface (src/api/routes/list-members.ts, registerListMembersRoutes) backed by createListMembersRepository (src/db/repositories/list-members.ts):

  • Add/remove Members of a List — owner-only; a List can only be shared with registered Users (Product Brief §5.2).
  • Membership changes drive notifyMembership(...) (signals the list’s users and the affected user) and, on removal, client-side evictRevoked(...) (see DB Schema & Notify-Affected, Sync-Core Reconcilers).
  • The ShareSurface.tsx island is the client UI for managing Members.
  • Assignment (spec 012) is membership-dependent: a Task may be assigned only to a Member; removing a Member clears their assignments.

Related: Worker API & Clerk Auth, Idempotency & List-Members Repos, Group & List Context Menus (the share entry point).