Acme Inc.

One Worker. Web and mobile both call it.

TanStack Start, Expo, Better Auth, oRPC, Drizzle on Neon, files on R2. Clone, run pnpm setup, push.

The stack

Apps

  • apps/web

    TanStack Start, shadcn, i18n, SEO. File routes. The landing and this architecture session are public. Dashboard routes sit behind auth.

  • apps/mobile

    Expo Router, NativeTabs, the same oRPC client type. Passkeys and 2FA share the Worker session story.

Packages

  • packages/api

    oRPC routers and zod contracts. MCP tools and webhooks live here. The client type is import type only.

  • packages/app-update

    Compares the running app version to admin config and tells the client whether to prompt.

  • packages/auth

    Better Auth with Drizzle, passkeys, 2FA, admin impersonation. Session cookies hit the Worker, not a second auth host.

  • packages/config

    Shared tsconfig and the oxlint client-boundary rules. No runtime.

  • packages/db

    Drizzle schema on Neon. The schema barrel is the one sanctioned aggregate, and only server code can reach it.

  • packages/email

    One sendEmail seam. Templates are pure. Production uses Cloudflare Email or Resend. Dev prints to the console.

  • packages/env

    env/server is Worker-only. env/web is the public subset. Native has its own leaf for Expo.

  • packages/errors

    Shared error codes and i18n keys. Clients map codes to strings. They never import the server error factory.

  • packages/flags

    Flag registry is a leaf. The DB repo is a separate subpath so a client import cannot pull Drizzle.

  • packages/intl

    i18next plus a React provider. Server language is resolved from cookie and query.

  • packages/project-setup-cli

    pnpm setup. Rename, env files, Neon, GitHub and Worker secrets.

  • packages/storage

    R2 through files-sdk. Uploads are namespaced per user. The Worker mints URLs or proxies bytes.

  • packages/ui

    shadcn and ReUI primitives. Tokens in globals.css. This is the visual authority for web.

  • packages/widgets

    iOS and Android home-screen todo widgets. Gated by a feature flag and native rebuild.

Agent plugin

  • plugins/agent-plugin

    agent-plugin. Agent Plugins 1.0 package: MCP over OAuth, draft-only writes, and skills. Lives in plugins/agent-plugin.

packages/api

api

oRPC routers and zod contracts. MCP tools and webhooks live here. The client type is import type only.

Client / server cut

Client and server cutFour layers. Clients import leaves. The Worker owns api, auth, and email. Neon and R2 sit below the Worker.CLIENTSapps/web · apps/mobileLEAVESapi/client · *.enums.ts · *.schema.ts · errors · intlWORKERapi routers · auth · email · flags/repo · env/serverDATAdb / Neon · storage / R2

What ships

  • Auth is already wired

    Password, OAuth, passkeys, and 2FA. Admin impersonation lives in the dashboard.

  • One typed cut

    Router inputs and outputs stay in Zod. Web and mobile import the same contracts.

  • A Worker per PR

    Open a PR and Actions stands up a throwaway Worker. Merge to main ships production.