Loading repository data…
Loading repository data…
areeburrub / repository
A clone-and-go monorepo boilerplate for full-stack TypeScript apps: NestJS (API) · Next.js (frontend) · Clerk (auth) · Prisma 7 (database) · Turborepo · Bun. Use this repo as a starting point for any project. Fork it, rename packages, and build on top of the auth, database, and API patterns already wired up.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A production-ready monorepo boilerplate for full-stack TypeScript applications.
Next.js · NestJS · Clerk · Prisma 7 · Turborepo · Bun
Scaffold a new project with the CLI, clone this repo to contribute, or fork and customize. Auth, database sync, API validation, and frontend patterns are already wired up.
class-validator DTOs used by API controllers and server actionscreate-next-nest-template) published to npm| Layer | Technology |
|---|---|
| Monorepo | Turborepo + Bun workspaces |
| API | NestJS |
| Frontend | Next.js 16, Tailwind CSS 4, shadcn/ui |
| Auth | Clerk |
| Database | Prisma 7 + PostgreSQL |
| Types | Shared DTOs with class-validator |
This repository is the template source. It includes the scaffold CLI under packages/create.
next-nest-template/
├── apps/
│ ├── backend/ # NestJS API (port 3001)
│ │ └── src/
│ │ ├── common/guards/ # ClerkAuthGuard
│ │ ├── common/decorators/
│ │ └── user/ # User module (Clerk ↔ DB sync)
│ └── website/ # Next.js frontend (port 3000)
│ └── src/
│ ├── app/
│ │ ├── (landing)/ # Public landing page (/)
│ │ ├── (dashboard)/ # Protected dashboard (/dashboard)
│ │ ├── sign-in/
│ │ └── sign-up/
│ ├── _actions/ # Server actions → backend API
│ └── components/ # UI + shadcn components
├── packages/
│ ├── create/ # create-next-nest-template CLI (template only)
│ ├── database/ # Prisma schema, migrations, client
│ └── types/ # Shared DTOs and response types
├── docker-compose.yml # Local PostgreSQL
└── turbo.json
When someone scaffolds a new project, the CLI removes template-only files (packages/create, publish workflow) and renames packages to their project scope. The generated app only contains apps/ and packages/database + packages/types.
npx create-next-nest-template my-app
cd my-app
The CLI asks for a project name and package manager. It then:
./my-app directory with scope @my-app@next-nest-template/* packages to your project scopepackages/create, CI publish workflow)packages/database/.env, apps/backend/.env, apps/website/.env.local)docker compose up -d) and run migrationsUse this when contributing to the template or working from a fork:
git clone https://github.com/areeburrub/next-nest-template.git
cd next-nest-template
bun install
See CONTRIBUTING.md for development setup and pull request guidelines.
cp packages/database/.env.example packages/database/.env
cp apps/backend/.env.example apps/backend/.env
cp apps/website/.env.example apps/website/.env.local
Add your Clerk keys to apps/backend/.env and apps/website/.env.local.
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL connection string |
CLERK_SECRET_KEY | Clerk secret key |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Clerk publishable key |
BACKEND_URL | API URL (http://localhost:3001) |
WEBSITE_URL | Frontend URL for CORS (http://localhost:3000) |
docker compose up -d
bun run db:migrate:deploy
Default local connection:
postgresql://postgres:postgres@localhost:5434/next_nest_template
bun run dev
| Service | URL |
|---|---|
| Website | http://localhost:3000 |
| Backend | http://localhost:3001 |
| Prisma Studio | bun run db:studio |
/, /sign-in, /sign-up/dashboard)GET /user/me to create the user in PostgreSQL from ClerkClerkAuthGuard verifies Bearer tokens_actions/_base.ts attaches the Clerk session token to API requestsAfter sign-in/sign-up, users are redirected to /dashboard.
| Method | Route | Auth | Description |
|---|---|---|---|
GET | /user/me | Clerk | Get or sync current user |
PATCH | /user/me | Clerk | Update current user |
DELETE | /user/me | Clerk | Delete current user |
| Command | Description |
|---|---|
bun run dev | Start all apps |
bun run build | Build all packages and apps |
bun run lint | Lint all packages |
bun run db:migrate | Create and apply a migration (dev) |
bun run db:migrate:deploy | Apply migrations (CI/production) |
bun run db:studio | Open Prisma Studio |
bun run create | Run the scaffold CLI locally (--from-local) |
Run a single app:
cd apps/backend && bun run dev
cd apps/website && bun run dev
Use the CLI — it renames packages, database names, and Docker resources automatically.
If you cloned manually, search and replace @next-nest-template with your scope (e.g. @my-app) across package.json files, imports, and next.config.ts.
packages/database/prisma/schema.prismabun run db:migratepackages/types/src/dtos/apps/backend/src/apps/website/src/_actions/apps/website/src/app/(dashboard)/my-feature/page.tsx
Register it in (dashboard)/_components/app-sidebar.tsx.
cd apps/website
bunx shadcn@latest add <component>
{
"statusCode": 400,
"error_code": "VALIDATION_FAILED",
"message": "email: email must be an email"
}
DTOs live in packages/types with class-validator decorators.
Contributions are welcome. Read CONTRIBUTING.md for:
--from-local.nvmrc)MIT