Back to templates

Template details

Next.js PostgreSQL Auth Starter

Next.js + Tailwind + TypeScript + Drizzle + NextAuth + PostgreSQL starter with email/password login.

About this template

Next.js PostgreSQL Auth Starter is an open-source boilerplate from Vercel that combines Next.js with NextAuth.js, Drizzle ORM, and a PostgreSQL database to deliver a working email-and-password authentication flow out of the box.

What is the Next.js PostgreSQL Auth Starter?

The Next.js PostgreSQL Auth Starter is a starter kit published by Vercel on GitHub at github.com/vercel/nextjs-postgres-auth-starter. It provides a ready-to-run Next.js application with email + password authentication already wired up, using NextAuth.js for sessions, Drizzle as the ORM, and a Neon Postgres database hosted through Vercel to persist user data. The repository has 1052 stars on GitHub and covers both local development and one-click Vercel deployment.

Key Features

The template's key features center on the integration of the Next.js App Router, NextAuth.js, Drizzle, and Vercel Postgres, plus a one-click deployment path.

  • Next.js framework — The project uses Next.js with TypeScript and runs a local development server via pnpm dev at http://localhost:3000; it also links to the official Next.js documentation and interactive tutorial.
  • NextAuth.js authentication — Simple email + password login is implemented with NextAuth.js, covering session management so users can sign up and sign in immediately.
  • Drizzle ORM — Drizzle (orm.drizzle.team) serves as the typed ORM layer for PostgreSQL, with the database schema defined inside the repo.
  • Vercel Postgres (Neon) — User data persists in a Neon Postgres database; one-click deployment through Vercel creates the Postgres store as an integration and connects it automatically.
  • Tailwind CSS styling — Tailwind CSS is part of the stack according to the repository topics, so UI components are styled with utility classes.
  • One-click Vercel deploy — The included deploy button clones the repo into a new Vercel project, sets the store, and prompts only for the AUTH_SECRET environment variable, with a link to a random-secret generator.
  • create-next-app scaffolding — You can reproduce the project locally by running npx create-next-app nextjs-typescript-starter --example "https://github.com/vercel/nextjs-postgres-auth-starter".

Who should use the Next.js PostgreSQL Auth Starter?

  • Next.js developers who want a working authentication setup without building sign-up, sign-in, and session code from scratch.
  • Startup founders building an MVP who need a Vercel-hosted app with user accounts; the one-click deploy provisions the Postgres database and links environment variables automatically.
  • Learners who want a small, readable NextAuth + Drizzle integration as a reference, supported by links to the Next.js docs and an interactive tutorial.

What can you do with the Next.js PostgreSQL Auth Starter?

  • Launch a deployed MVP: press the Vercel deploy button, generate the AUTH_SECRET, and get a live app with working email/password auth and a Postgres database.
  • Build a SaaS foundation: start from the template and add your own features on top of the existing auth and data layer.
  • Study auth implementation: read the NextAuth.js + Drizzle code as an example of wiring email/password login against PostgreSQL in Next.js.

How does the Next.js PostgreSQL Auth Starter work?

You can clone it by running the provided npx create-next-app --example command, then start developing with pnpm dev and opening http://localhost:3000. For production, the one-click Vercel deploy creates a new project from the GitHub repository, provisions a Postgres store through the Vercel integration, and asks you to set the AUTH_SECRET environment variable to finish the setup.

FAQ

Is the Next.js PostgreSQL Auth Starter free?

Yes. The starter is open source on GitHub under the Vercel organization, and there is no fee to clone, deploy, or use it.

What database does it use?

It uses PostgreSQL through Vercel's Postgres product, powered by Neon. Drizzle ORM handles the data access layer.

What authentication method is included?

NextAuth.js with a simple email + password login. The repository topics list next-auth and nextauthjs as the authentication focus.

Do I need to configure environment variables?

During one-click deployment, Vercel asks for an AUTH_SECRET. The deploy flow links to generate-secret.vercel.app for creating a random secret; Postgres connection details come automatically from the store integration.

screenshot of Next.js PostgreSQL Auth Starter on template0.com