A modern pnpm + Turborepo monorepo containing a web frontend, backend API, and shared packages. This setup is designed for type safety, fast builds, and scalable collaboration.
calculories/
├── apps/
│ └── web/ # Frontend (Next.js)
│
├── packages/
│ └── shared-types/ # Shared TypeScript types (DTOs, interfaces)
│
├── turbo.json # Turborepo pipeline configuration
├── pnpm-workspace.yaml
├── package.json # Workspace root configuration
└── README.md
- Package Manager: pnpm (workspace-based)
- Monorepo Tooling: Turborepo
- Frontend: Next.js + React
- Backend: Next.js
- Language: TypeScript
- Node.js 20+
- pnpm v10+
npm install -g pnpmFrom the repository root:
pnpm installpnpm will install all workspace dependencies and link local packages automatically.
pnpm devShared types live in:
packages/shared-types
They are consumed using workspace dependencies:
import type { User } from "@calculories/shared-types";- One source of truth for DTOs
- No duplicated types between frontend and backend
- End-to-end type safety
Turborepo handles:
- Incremental builds
- Task caching
- Dependency-aware pipelines
Example (from turbo.json):
webdepend onshared-types#build
- Prettier formats all files
- ESLint is configured per app
- Formatting is enforced via editor + CI (recommended)
-
Create a feature branch
git checkout -b feat/my-feature
-
Make changes
-
Ensure builds pass:
pnpm build
-
Commit with clear messages
-
Open a Pull Request