Monorepo layout
How the Zero To Shipped pnpm + Turborepo workspace is organized.
Zero To Shipped is a pnpm workspace orchestrated with Turborepo. Application code lives under apps/, shared libraries under packages/, and root scripts delegate to the right package.
Top-level layout
Apps
| App | Package | Purpose |
|---|---|---|
| Web | web | Primary product: App Router UI, /api/trpc, /api/rest, /api/mcp, auth |
| Mobile | @zts/mobile | Expo app using @zts/trpc and Better Auth Expo plugin |
| Extension | @zts/extension | Chrome extension sharing session + tRPC with the web app |
Packages
| Package | Import | Role |
|---|---|---|
@zts/trpc | @zts/trpc/server/api/root | Single API surface for web, mobile, extension, REST, and MCP |
@zts/auth | @zts/auth, @zts/auth/client | Better Auth server + client |
@zts/db | @zts/db | Prisma client and extensions |
@zts/env | @zts/env, @zts/env/client | Server and client env validation |
@zts/shared | @zts/shared/... | Cross-app config and types |
@zts/email | @zts/email | Outbound email |
@zts/sdk | @zts/sdk | REST client from OpenAPI (see Public API) |
@zts/cli | zts binary | Terminal access to REST (see Public API) |
Common commands
From the repository root (with .env at the root — loaded via scripts/with-root-env.mjs for web):
Filter a single app or package:
Where the API lives
- tRPC procedures and router:
packages/trpc/src/ - Next.js route handlers (wire-up only):
apps/web/src/app/api/trpc/[trpc]/route.ts→/api/trpcrest/[...path]/route.ts→/api/restopenapi.json/route.ts→/api/openapi.json[transport]/route.ts→/api/mcp
First-party clients (web RSC, mobile, extension) call tRPC. Integrations, scripts, and agents use REST, SDK, CLI, or MCP as described in Public API.
Turborepo
turbo.json defines dev, build, typecheck, and test with shared globalEnv so cached tasks see the same env keys as production builds. Root pnpm dev runs turbo dev --filter=web; mobile and extension use dedicated root scripts because they are long-running dev processes outside that filter.
Related docs
- Quick Start — clone, env, migrate, run
- Folder structure — App Router layout inside
apps/web - Mobile — Expo app
- Browser extension — WXT extension
- Public API — REST, OpenAPI, SDK, MCP, CLI