π Simple Next.js 13 App Router starter kit that uses NextAuth.js for auth, Prisma as the ORM, and Vercel Postgres as a database. π
- Works. Plays Rickroll video in protected route.
- #2 (open) Logout button does not work on header, only in works in protected Rick Roll route.
- #1 (closed) Writes to Neon Postgres user email and hashed pw
https://github.com/coding-to-music/auth-postgres-prisma-nextjs-playground
https://auth-postgres-prisma-nextjs-playground.vercel.app
From / By https://vercel.com/templates/next.js/prisma-postgres-auth-starter
https://github.com/vercel/nextjs-postgres-auth-starter
https://nextjs-postgres-auth.vercel.app/
nvm use 18
see .env-example
Paste the .env
values into VercelDashboard-->Settings-->EnvironmentValues
# Used by Prisma:
# url = env("POSTGRES_PRISMA_URL") // uses connection pooling
# directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
# shadowDatabaseUrl = env("POSTGRES_URL_NON_POOLING") // used for migrations
# Create a Postgres database on Vercel: https://vercel.com/postgres
POSTGRES_PRISMA_URL=
POSTGRES_URL_NON_POOLING=
# Generate one here: https://generate-secret.vercel.app/32 (only required for localhost)
NEXTAUTH_SECRET=
git init
git add .
git remote remove origin
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:coding-to-music/auth-postgres-prisma-nextjs-playground.git
git push -u origin main
This is a Next.js starter kit that uses Next-Auth for simple email + password login
Prisma as the ORM, and a Vercel Postgres database to persist the data.
You can clone & create this repo with the following command
npx create-next-app nextjs-typescript-starter --example "https://github.com/vercel/nextjs-postgres-auth-starter"
First, run the development server:
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
https://nextjs.org/docs/pages/api-reference/create-next-app
npx create-next-app auth-postgres-prisma-nextjs-playground --use-yarn -e https://github.com/coding-to-music/auth-postgres-prisma-nextjs
ncu
Using yarn
[====================] 19/19 100%
@types/node ^18.11.9 β ^20.5.4
@types/react ^18.0.25 β ^18.2.21
autoprefixer ^10.4.4 β ^10.4.15
bcrypt ^5.1.0 β ^5.1.1
eslint 8.11.0 β 8.47.0
eslint-config-next ^13.0.5 β ^13.4.19
next ^13.4.2 β ^13.4.19
next-auth ^4.22.1 β ^4.23.1
postcss ^8.4.12 β ^8.4.28
tailwindcss ^3.0.23 β ^3.3.3
typescript ^4.6.2 β ^5.1.6
Run ncu -u to upgrade package.json