Turborepo monorepo project structure

Turborepo monorepo project structure

Explorer

  • .git…
  • .turbo…, not committed
  • .vscodenew
  • settings.jsonnew
  • .gitignore
  • .npmrc
  • .nvmrcnew
  • AGENTS.md
  • README.md
  • apps
  • docker-compose.ymlnew
  • node_modules…, not committed
  • package.json
  • packages
  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • turbo.json
  • turbonew
  1. # Create the monorepo from the basic starter with pnpm

    npx create-turbo@latest my-turborepo -m pnpm
  2. # Run every app in dev mode (web on 3000, docs on 3001)

    cd my-turborepo && pnpm dev
  3. # Install the turbo CLI globally so you can type turbo instead of pnpm turbo

    pnpm add -g turbo
  4. # Add a new internal package from a generator

    turbo gen workspace --name @repo/validators
  5. # Add a dependency to one package only

    pnpm add zod --filter @repo/validators
  6. # Connect the remote cache (Vercel or self-hosted)

    turbo login && turbo link
  7. # Run only what a change affects, as CI does

    turbo run lint check-types test build --affected
  8. # Make a pruned copy of one app for its Docker image

    turbo prune web --docker
  9. # Add Changesets when packages are published

    pnpm add -Dw @changesets/cli && pnpm changeset init