Skip to main content

2 posts tagged with "monorepo"

View All Tags

Creating a Modular Monorepo, Frontend Meets Backend

· 2 min read
JavaScript Dev

Overview

Once the schema and core features were taking shape, I needed a scalable way to manage both frontend and backend in a single codebase. My goals were:

  • Reduce context switching
  • Share types between API and UI
  • Optimize for developer speed and clarity

I chose a monorepo setup using PNPM workspaces. This let me keep backend (NestJS), frontend (Next.js), and shared types/utilities in separate packages—but in one unified repository.


Monorepo Structure

Here's the high-level layout I landed on:

apps/
├── frontend/ # Next.js app (SSR, client, UI logic)
└── backend/ # NestJS API with Prisma
packages/
├── shared/ # Common interfaces, enums, helper functions
└── config/ # Shared tsconfig, eslint, env loaders
prisma/ # Central schema, migrations
scripts/ # Utility scripts for seeds, exports

Monorepo experience

· 3 min read
samundrak
JavaScript Dev

Monorepo is a repository pattern where we manage multiple packages in a single repository. Normally what we do is create a separate repository for each package and maintain all those packages by tracking their version and release. In Monorepo we put all of our packages in a single repository.