Star
READY TO SHIP v1.0.0 • 6 Native Agent Dialects

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.

{'name': 'TypeScript', 'version': '^5.6', 'registry': 'npm'} {'name': 'Next.js', 'version': '^15.0', 'registry': 'npm'} {'engine': 'PostgreSQL', 'version': '>= 16.0', 'features': ['Connection Pooling', 'Declarative Schema Migrations', 'Composite Unique Constraints', 'Full-Text Search Indices']}
$ git clone https://github.com/Umar-444/Techtalks-stack-kits.git
01 / STARTER & ARCHITECTURE
docker compose up -d
File / Subsystem Architecture Role Status
01 docker-compose.yml
Rootless isolated application & database runtime PRE-WIRED
02 starter/app/
Model layer, authorization policies, admin resources RBAC ENFORCED
03 starter/tests/
Pest / PHPUnit architectural and feature test suite AUTOMATED
04 .env.example
Zero plaintext secrets, strict dummy placeholders GITLEAKS READY
02 / NATIVE RULES (6 DIALECTS)
Source: kits/nextjs-prisma-postgresql/CLAUDE.md • Token footprint: ~350 tokens
# 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
...
03 / SKILLS & WORKFLOWS
01first-feature
SANDBOXED
02install-and-verify
SANDBOXED
03nextjs-prisma-postgresql-core
SANDBOXED
04prisma-multi-tenant-isolation
SANDBOXED
05prisma-schema-migrations
SANDBOXED
06server-actions-zod
SANDBOXED
04 / DESIGN TOKENS & COMPONENTS
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
05 / SECURITY SCANS & CI GATES
01 Gitleaks Secret Scanning
Scans commits, branches, and PRs for API keys & tokens ✓ ACTIVE
02 Semgrep AST Security Rules
Detects SQLi, CSRF omission, insecure deserialization ✓ ACTIVE
03 OWASP Automated Test Suite
Functional tests validating session fixation & XSS filtering ✓ ACTIVE
04 Static Type Checking
PHPStan Level 8 / Strict TypeScript compilation ✓ ACTIVE
06 / STEP-BY-STEP PROCEDURE
01

Clone and Inspect

Clone repository, navigate to kits/nextjs-prisma-postgresql, and start container services via docker compose.

02

Anchor AI Agent

Feed the Agent Bootstrap Prompt into Claude Code, Cursor, Codex, or Copilot. Agent consumes native rules and skills.

03

Verify Security Gates

Run automated CI evaluation. Security scanners assert zero vulnerabilities before merging features to production.

SECTION 3 • INSTALLATION GUIDE

7-Part Installation & Setup Standard

✓ VERIFIED INSTALL

1. Prerequisites Table

Tool Minimum Version Check Command Where to Get
Docker Engine24.0+docker --versiondocker.com
Docker Composev2.20+docker compose versionBundled with Docker
Git2.40+git --versiongit-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

Claude Code
CLAUDE.md
Cursor
.cursor/rules/*.mdc
Codex
CODEX.md / AGENTS.md
Copilot
copilot-instructions.md
Cline
.clinerules
Antigravity
.agents/rules/*.md

4. Post-Install Verification Probes

curl -s http://localhost:8000/healthz ✓ HTTP 200 OK
docker compose ps ✓ ALL SERVICES UP
SECTION 4 • FREQUENTLY ASKED QUESTIONS

Kit FAQ & Operational Details

14 QUESTIONS
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.

eval-transcript • nextjs-prisma-postgresql
GATES PASSED
$ aautomated test suite --kit nextjs-prisma-postgresql
✓ 01-manifest-integrity ............. PASS
✓ 02-agent-dialects .................. PASS (6/6 compiled)
✓ 03-skills-sandbox .................. PASS (Sandboxed tools)
✓ 04-owasp-scanners .................. PASS (0 vulnerabilities)
✓ 05-runtime-smoke ................... PASS (HTTP 200 OK)
Ready for immediate agent execution with zero configuration.
AGENT BOOTSTRAP PROMPT

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.