
Template details
Next.js & Prisma Postgres Auth Starter
Boilerplate for a Next.js 15 app with NextAuth.js authentication and Prisma Postgres CRUD.
About this template
Next.js & Prisma Postgres Auth Starter is a boilerplate that pairs Next.js 15, NextAuth.js v4, and Prisma Postgres so you can launch a full-stack app with authentication and database CRUD out of the box.
What is the Next.js & Prisma Postgres Auth Starter?
This boilerplate bundles Next.js 15 (with App Router, Server Actions, and API Routes), NextAuth.js v4 for authentication, and Prisma Postgres plus Prisma ORM for data access. It produces a working demo app where users can log in, sign up, and perform create, view, and delete operations on blog posts stored in a Prisma Postgres database. The project is designed to be deployed to Vercel and is maintained by Prisma's team.
Key Features
- Next.js 15 App Router — Includes App Router, Server Actions, and API Routes for server-side data mutations and API endpoints.
- NextAuth.js v4 authentication — Configures login and signup flows using the
AUTH_SECRETenvironment variable, generated withnpx auth secret. - Prisma Postgres connection — Uses Prisma ORM to connect to a Prisma Postgres instance via a
DATABASE_URLthat uses theprisma+postgresprotocol. - Database migrations — Provides
npx prisma migrate dev --name initto create and apply the initial schema. - Database seeding —
npx prisma db seedpopulates initial data so demo routes work immediately. - Blog post CRUD — Example routes demonstrate creating, viewing, and deleting blog posts, using server actions or API routes.
- Advanced query examples — Shows pagination, filtering, and relation queries against the Postgres database.
Who is it for?
- Next.js developers — Anyone who wants a pre-configured authentication and database layer to build on instead of wiring it from scratch.
- Prisma newcomers — Developers who want a concrete example of Prisma migrations, seeding, and querying inside a Next.js app.
- Startup teams prototyping — Small teams that need a working login/signup and a database-backed CRUD demo to present or iterate on.
What can you do with this template?
- Build a blog or content app: Use the example blog post model to create, view, and delete posts after authenticating.
- Prototype a SaaS dashboard: Replace the blog model with your own schema and keep the auth and database setup intact.
- Learn the stack: Study how NextAuth.js v4 session handling works with Prisma and how Next.js Server Actions perform mutations without custom API routes.
How does the template work?
After cloning the repository, run npm install, then npx prisma init --db to create a Prisma Postgres instance and retrieve its DATABASE_URL. Set the DATABASE_URL and AUTH_SECRET in a .env file, run npx prisma migrate dev --name init to create tables, npx prisma db seed to add sample data, and npm run dev to start the development server at http://localhost:3000.
















