A pnpm workspace with two apps under apps/:
apps/client: Next.js appapps/server: NestJS API
- Node.js 22.x
- pnpm 10.16.1 (repo is pinned via
packageManager) - Postgres (local) for server development
pnpm install- Add a runtime dependency
pnpm add <pkg> --filter client pnpm add <pkg> --filter server
- Add a dev dependency
pnpm add -D <pkg> --filter client pnpm add -D <pkg> --filter server
- Remove a dependency
pnpm remove <pkg> --filter client pnpm remove <pkg> --filter server
- Add the same dependency to both apps
pnpm add <pkg> --filter client --filter server
- Defined in
pnpm-workspace.yamlwithpackages: - apps/*. - Root
package.jsoncontains scripts to run each app and both together.
- Ensure a local Postgres is running and
DATABASE_URLis set (used by CI and local):export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
- Generate Prisma client:
pnpm -r --filter server run prisma:generate
- Create/update schema in your DB:
pnpm --filter server exec prisma db push
pnpm dev— run client and server in parallelpnpm build— build both apps in parallelpnpm start— start both apps in parallel (expects they are built)pnpm dev:client— run Next.js dev serverpnpm dev:server— run NestJS in watch modepnpm build:client/pnpm build:serverpnpm start:client/pnpm start:serverpnpm lint:client/pnpm lint:server
- Server tests (Jest):
pnpm --filter server test pnpm --filter server test:cov pnpm --filter server test:e2e
- Client default dev URL:
http://localhost:3000 - Server default port:
3000 - To run both together, use
pnpm dev.
If you hit a port conflict (EADDRINUSE: 3000), adjust one app’s port via env:
- Next.js:
PORT=3001 pnpm dev:client - NestJS: configure
apps/server/src/main.tsto readprocess.env.PORTwith a fallback.
- Config at
.changeset/config.json(targetsapps/*, base branchmain). - Create a changeset:
pnpm changeset
- Apply versions and update lockfile:
pnpm version-packages
- Build and publish (skips private apps):
pnpm release
- Hooks installation: hooks are installed on
pnpm installvia the rootpreparescript (husky install). - Pre-commit: runs
pnpm run lint, which fans out toapps/clientandapps/serverlint scripts. - Commit message check:
commit-msgruns Conventional Commits via Commitlint.
feat: add homepage hero
fix(server): handle missing env var
chore(client): update eslint config
docs: update README
echo "feat: something" | pnpm exec commitlint
pnpm exec commitlint --edit .git/COMMIT_EDITMSGgit commit -m "wip: temp" --no-verifyNotes:
- Packages in
apps/are"private": trueand will not be published. - Initialize git and ensure your default branch is
mainto match Changesets baseBranch.
- CI workflow builds and lints on PRs to
main. - Semantic PR title check enforces Conventional Commit-style PR titles.
- Labels are defined in
.github/labels.yml. Sync via Actions → "Sync Labels". - Issue templates (Bug / Feature / Task) and a PR template are provided in
.github/.
apps/
client/
server/
.changeset/
package.json
pnpm-workspace.yaml- Change base port to avoid conflicts or stop the process occupying it.
- Ensure
gitis initialized and the default branch ismainfor the Changesets suggested-flow to work without warnings. - Next.js build warning about
outputFileTracingRootbeing absolute is addressed inapps/client/next.config.ts.