Fun with Monorepos
I love the idea of having a single repository for all my projects but have always found monorepos tricky—those build issues pop up at the worst times 😅.
Now that LLMs make it easy to spin up new projects, it feels like the perfect moment to revisit monorepos and create the ultimate side‑project repo.
Why a Monorepo?
- Avoid repetitive setup: No need to write Cursor rules for every new repo.
- Consistency: Shared linting, formatting, and build configs.
- Quick start: Copy‑paste apps and spin them up in seconds.
- Central UI library: Bundle all my favorite components in one place.
Setup
Build tools:
pnpm
turborepo
Frameworks:
Next.js
shadcn/ui
Tailwind CSS v4
Linting & Formatting:
ESLint
+Prettier
(I considered Biome, but didn't want too many variables)
Infrastructure:
- Vercel for frontend and serverless functions
- fly.io for more involved backend services
Getting Started
I ran the default Turbo setup:
pnpm dlx create-turbo@latest
and was delighted when everything just worked:
npx turbo ls
# turbo 2.5.0
#
# 5 packages (pnpm9)
# @repo/eslint-config packages/eslint-config
# @repo/typescript-config packages/typescript-config
# @repo/ui packages/ui
# docs apps/docs
# web apps/web
Next, let's spin up a fresh Next.js app in our monorepo:
pnpm dlx create-next-app@latest apps/art-gallery
After updating dependencies and configs to use our shared settings, it worked like a charm! The only small snag is specifying a unique port when running multiple apps in parallel:
next dev --turbopack --port 3001
I can live with that 🤷.
Using shadcn/ui
shadcn/ui has built‑in support for monorepos. It's super handy to keep all my imported components in a shared ui
package.
Final Result
After hitting /Generate Cursor Rules
and adding an example artwork, I had everything deployed on Vercel in no time: https://art.tengis.dev/
