Engineering

The Astro + NestJS monorepo I actually reuse

A reusable full-stack starter I built so I stop wiring up the same architecture every time — Astro, NestJS, tRPC, and Prisma in one pnpm/Turbo monorepo, set up with a single command.

Mokshit Jain · · 5 min read

I kept starting new projects the same way and losing the first stretch to wiring up the same architecture — a frontend, a typed API, a database, Docker, CI. So I built one monorepo template I reuse instead, and it’s saved me real time. Jain Parichay, my portfolio, and the small internal challenges we do at work all started from it.

What’s in it

It’s a pnpm + Turborepo monorepo (11 workspaces) with:

  • Astro + React frontend.
  • NestJS on Fastify backend.
  • tRPC tying them together, so types flow end to end from the API to the frontend — with Zod validation at the edges.
  • Prisma + PostgreSQL for data.
  • Shared UI and types packages, Tailwind, i18n (English/German out of the box), Docker, and GitHub Actions CI.

The part that makes it worth reusing

A template you have to hand-edit for ten minutes after cloning isn’t really a template. So I wrote a one-command bootstrap:

curl -fsSL https://raw.githubusercontent.com/mokbhai/monorepo-astro-nestjs/main/scripts/bootstrap.sh | bash -s -- my-app

That clones it, runs a small terminal installer, renames the npm scope throughout, strips the demo apps I don’t need, and re-initializes git — so I go from “I have an idea” to “I have a running full-stack app” without the boilerplate tax.

What I took away

Building this taught me to treat my own developer experience as a product. The interesting problems weren’t the frameworks — they were the seams: keeping types shared cleanly across the monorepo, making the scaffolding removable, and making setup a single command instead of a checklist. It’s also the clearest proof that the architecture I reach for (Astro + Nest + tRPC + Prisma) is one I actually trust, because I keep choosing it.

The template is on GitHub.

Share
Written by
Mokshit Jain

AI engineer & full-stack developer building LLM products, automation, and RAG pipelines.

Continue reading