Skip to main content
2026-08-20//5 MIN READ//BACKEND // INFRASTRUCTURE

MONOREPO INFRASTRUCTURE WITH PNPM WORKSPACES

Isolated Dockerfiles, workspace filtering, and static export that stays compatible with GitHub Pages.

MONOREPO INFRASTRUCTURE WITH PNPM WORKSPACES

Monorepo Infrastructure

This article describes the migration from a single Next.js app to a pnpm workspace monorepo.

Why separate apps?

  • Frontend stays a static export deployable to GitHub Pages.
  • Backend runs independently on Node.js + json-server for fast mocking.
  • Each app owns its Dockerfile, dependencies and AGENTS.md.

What changed

  • apps/frontend holds the Next.js app with output: "export".
  • apps/backend exposes data/db.json via json-server on port 4000.
  • Root pnpm-workspace.yaml defines packages: ["apps/*"].

API base for the next stage: /api/v1 — routes are designed by a dedicated agent.

END OF SIGNALSHARE OR SAVE THIS KNOWLEDGE

MORE ARTICLES

UI DESIGN SYSTEM & MARKDOWN SYNTAX DEMO

Complete showcase of all typography, lists, code blocks, tables, and blockquotes supported by the markdown parser.

CONTRACT-FIRST API WITH T RPC AND SHARED ZOD SCHEMAS

Why the API contract lives in code: shared zod schemas, envelope-less tRPC responses, and fail-fast data validation.

STATIC EXPORT DEPLOYMENT WITH DOCKER AND DOKPLOY

STATIC EXPORT DEPLOYMENT WITH DOCKER AND DOKPLOY

Shipping a Next.js static export as a static-web-server Docker image with build-args baked into the bundle.

ASK ABOUT MY WORK.

Ask about product fit, engineering decisions, or the stack behind a specific case — personal AI got you covered.

LET'S WORK TOGETHER

A new product, an unfinished system or something that needs fixing? Tell me about your project!

YOU CAN ALSO WRITE AN EMAIL ON LETNULL19A@GMAIL.COM