Next.js 15+ + Prisma ORM + PostgreSQL + Tailwind CSS
Production full-stack React 19 / Next.js 15+ App Router blueprint kit featuring type-safe Prisma ORM migrations, PostgreSQL 16 connection pooling, Server Actions with Zod validation, and rootless multi-stage container deployment.
docker compose up -d
# Next.js 15+ + Prisma ORM + PostgreSQL + Tailwind CSS — Claude Code Guidelines (CLAUDE.md)
# Auto-generated from rules/source/*.md by tools/transpiler.py. Do NOT edit directly.
## Quick Reference & Non-Negotiable Standards
### Next.js 15 and App Router Architecture
> Standards for React 19 Server Components, Client boundaries, and directory layout.
# Next.js 15 and App Router Architecture
## 1. Server Components as Default
- Default all components to React Server Components (RSC) to minimize client bundle size.
- Use the `'use client'` directive exclusively when component state (`useState`), effects (`useEffect`), or browser DOM events are required.
- Fetch data directly inside Server Components using Prisma Client.
## 2. Directory Layout & Organization
- **App Routes**: `src/app/` (page routes, layout wrappers, route handlers).
- **Server Actions**: `src/lib/actions/` (domain mutation functions marked with `'use server'`).
- **Prisma Client**: `src/lib/prisma.ts` (global singleton instance).
- **Validation Schemas**: `src/lib/validations/` (Zod schemas reused between client and server).
## 3. Never-List
- Never instantiate new `PrismaClient()` inside route handlers or compon
...
| Design Token | Specification | Standard Enforcement |
|---|---|---|
| color.brand | #e85d26 (Orange status accent) | Status lights, active tabs, focus rings, primary CTA |
| color.surface.dark | #0A0A0B (Base) • #131316 (Raised) • #26262C (Hairline) | Dark-first showcase theme, hairline borders, no shadows |
| font.family.ui | Instrument Sans (14px base, tight scale) | Small and dense dashboard typography, zero AI slop |
| focus.ring | 2px #e85d26 outline, 2px offset | Universal high-visibility focus ring, WCAG 2.2 AA compliant |
Clone and Inspect
Clone repository, navigate to kits/nextjs-prisma-postgresql, and start container services via docker compose.
Anchor AI Agent
Feed the Agent Bootstrap Prompt into Claude Code, Cursor, Codex, or Copilot. Agent consumes native rules and skills.
Verify Security Gates
Run automated CI evaluation. Security scanners assert zero vulnerabilities before merging features to production.
7-Part Installation & Setup Standard
1. Prerequisites Table
| Tool | Minimum Version | Check Command | Where to Get |
|---|---|---|---|
| Docker Engine | 24.0+ | docker --version | docker.com |
| Docker Compose | v2.20+ | docker compose version | Bundled with Docker |
| Git | 2.40+ | git --version | git-scm.com |
2. Quickstart Execution
git clone https://github.com/Umar-444/Techtalks-stack-kits.git cd Techtalks-stack-kits/kits/nextjs-prisma-postgresql/starter cp .env.example .env docker compose up --build -d
3. Multi-Agent Rule Placement
4. Post-Install Verification Probes
Kit FAQ & Operational Details
How does Prisma Client handle connection pooling in Next.js 15 Server Components? ↓
A global singleton pattern (src/lib/prisma.ts) stores the PrismaClient instance on globalThis in non-production environments, preventing connection pool exhaustion caused by Next.js hot module reloading.
How are Server Actions secured against unauthorized execution and CSRF? ↓
Next.js 15 enforces Host and Origin header checks on Server Actions. Additionally, our action handlers parse every payload using Zod schemas and verify the authenticated session's tenant ID before executing database writes.
What is the recommended pattern for Prisma relations in multi-tenant systems? ↓
Every tenant-owned entity includes a tenantId foreign key with composite indexes (e.g. @@index([tenantId, createdAt])). Queries always include where: { tenantId } at the top level.
How does the starter handle database migrations in CI/CD environments? ↓
Production deployments execute npx prisma migrate deploy, which applies pending migration files deterministically without prompting for user confirmation.
Can Prisma handle optimistic UI updates in React 19? ↓
Yes. Server Actions can be invoked inside React 19's useActionState or useOptimistic hooks, allowing immediate UI feedback while the Prisma transaction settles in PostgreSQL.
Why is PostgreSQL 16 chosen for this Next.js kit? ↓
PostgreSQL 16 offers exceptional concurrency, support for JSONB indexing, robust full-text search, and seamless scalability to managed providers like Supabase, Neon, or AWS RDS.
How does rootless containerization work with Node.js 22 LTS? ↓
The Dockerfile defines a dedicated appuser with UID 10001:10001. All npm install, build, and next start commands execute without root privileges, minimizing attack surface.
How are database transactions executed in Prisma? ↓
Atomic operations utilize prisma.$transaction([ ... ]) or interactive transactions prisma.$transaction(async (tx) => { ... }), ensuring consistency during multi-table writes.
What is the token consumption benchmark tier for this kit? ↓
The kit is benchmarked at Tier A (16,800 median build tokens) due to Prisma's concise schema definition language and typed auto-generated client.
How is soft-deletion handled in Prisma schema? ↓
Entities include an optional deletedAt DateTime? column, and custom Prisma Client extensions automatically filter out soft-deleted records on standard findMany queries.
Are Prisma queries immune to SQL injection? ↓
Yes. Standard Prisma Client API calls use parameterized queries under the hood. For custom raw queries, $queryRaw with tagged template literals ensures parameters are safely bound.
How does Vitest test Server Actions without running a full browser? ↓
Vitest tests invoke Server Action functions directly as asynchronous TypeScript functions, passing mock payloads and validating database state changes via Prisma.
How are Tailwind CSS design tokens integrated? ↓
Tailwind configuration maps semantic CSS variables for dark and light modes, enabling seamless theme toggling with zero flash of unstyled content (FOUC).
What automated security scans run in CI for this kit? ↓
GitHub Actions runs Gitleaks for secret detection, Semgrep with OWASP Top 10 rules, TypeScript typechecking, and manifest schema validation.
Paste this exact prompt into Claude Code, Cursor, Copilot, or Antigravity to anchor the agent in the kit's rules and invariants:
You are building with the Next.js 15+ + Prisma ORM + PostgreSQL + Tailwind CSS kit. Adhere strictly to rules in CLAUDE.md / .cursor/rules, design tokens in DESIGN.md, and steps/agent-build-steps.md.