← All recipes

Monorepo Turbo

Customize your project context

Your project

Prefer terminal? npx github:Pranavoro/tailormd init monorepo-turbo

Live preview — CLAUDE.md

# My Monorepo

TailorMD recipe: **Monorepo Turbo**

## Stack

- **Package manager:** pnpm
- **Apps:** web, api
- **Shared packages:** ui, config, types
- **Deploy strategy:** Per-app Vercel projects

## Folder map

```
apps/
  web/             # from web, api
  api/
packages/
  ui/              # from ui, config, types
  config/
  types/
turbo.json
package.json       # workspace root
```

## Non-negotiables

- Package boundaries are strict — apps import packages, never the reverse
- Shared code goes in `packages/`, not duplicated across apps
- Run affected tasks only: `turbo run <task> --filter=...[origin/main]`
- No circular dependencies between packages
- Lockfile committed; workspace protocol for internal deps (`workspace:*`)
- Each app owns its deploy config (Per-app Vercel projects)

## Naming and style

- Package names: `@My Monorepo/<package>` or scoped per org convention
- Apps: short nouns (`web`, `api`, `docs`)
- Shared packages: purpose-driven (`ui`, `types`, `config`, `db`)
- Import from package entry points only — no deep imports into `src/`

## Commands

```bash
# pnpm at repo root
turbo run dev                    # all apps
turbo run build                  # full build
turbo run test --filter=...[origin/main]   # affected only
turbo run lint
turbo run build --filter=web     # single app
```

## Ship checklist

Before merging or deploying:

- [ ] Affected packages build (`turbo run build --filter=...[origin/main]`)
- [ ] Affected tests pass
- [ ] Lint clean across changed packages
- [ ] No circular dependency introduced
- [ ] Internal package versions consistent (workspace refs)
- [ ] App-specific env vars documented per app
- [ ] Deploy config valid for changed apps (Per-app Vercel projects)

## Apps (web, api)

- Each app has its own `package.json`, tsconfig, and deploy target
- Cross-app imports forbidden — share via `packages/`

## Shared packages (ui, config, types)

- `types` — shared TypeScript interfaces only, no runtime deps
- `ui` — presentational components, no app-specific routing
- `config` — eslint, tsconfig, tailwind presets

## Deploy (Per-app Vercel projects)

- **Per-app Vercel projects:** each app in `apps/` maps to one Vercel project
- **Single Docker image:** multi-stage build per app target
- **Kubernetes:** one Helm chart per app or unified chart with per-app values