Why a monorepo for Swipe Movie
The tree: apps and packages
apps/ for deployable applications, and packages/ for shared code.
swipe-movie/
├── apps/
│ ├── web/ # Next.js 16 (App Router, Turbopack)
│ └── api/ # NestJS 11
├── packages/
│ ├── database/ # Prisma schema + PostgreSQL client
│ ├── ui/ # Design system (Atomic Design)
│ ├── types/ # Shared TypeScript types
│ ├── email/ # Resend templates
│ └── subscription/ # FREE / PRO plan logic
├── turbo.json # Task pipeline
├── pnpm-workspace.yaml # Workspace declaration
└── package.jsonpackage.json and is consumed by the others using the workspace:* syntax. Concretely, apps/web and apps/api import @swipe-movie/types or @swipe-movie/database like any other dependency, but pnpm resolves them locally through symlinks. No publishing, no manual synchronization.
Shared packages: the real win
The types package
Room or Swipe object, the change propagates instantly to the frontend and the backend. TypeScript immediately flags the slightest mismatch at compile time, on both sides. No more silent integration bugs between the API and the client.
The database package
The shared design system: ui
ui package follows an Atomic Design approach. Components are built once and consumed by apps/web. Having a shared design system in a dedicated package guarantees total visual consistency and saves me from rewriting buttons, modals, and swipe screens.
email and subscription
turbo.json: orchestrating tasks
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "dist/**"]
},
"lint": {},
"type-check": {
"dependsOn": ["^build"]
},
"dev": {
"cache": false,
"persistent": true
}
}
}^build notation means "build this package's dependencies first." When I build apps/web, Turborepo makes sure packages/ui and packages/types are built first. And thanks to the cache, if nothing has changed in a package, its task is served from the cache instead of being re-run. On a growing project, the time savings are considerable.
Monorepo CI/CD and deployment
apps/web / apps/api split makes things natural: Vercel deploys the Next.js frontend, Railway hosts the NestJS backend. Two distinct targets, a single repo, a single source of truth. The rest of the stack (Tailwind CSS 4, PostgreSQL + Prisma, Redis, Stripe, Socket.IO) fits into this structure without friction.
What I take away
Want to see the result? Discover the Swipe Movie project in detail, or learn more about my journey as a Full Stack developer.



