Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Fullstack TypeScript blog starter using Next.js, Prisma, NextAuth.js, and PostgreSQL with Vercel deploy support.
The Fullstack Blog with Next.js + Prisma is a TypeScript starter by Prisma that combines Next.js, Prisma Client, NextAuth.js, and PostgreSQL to demonstrate how to build and deploy an authenticated content application.
This starter project implements a fullstack blog in TypeScript with React on the frontend, Next.js API routes as the backend, Prisma Client for database access, and NextAuth.js for GitHub OAuth authentication. It runs on Next.js and uses PostgreSQL as its default database, with an optional Railway integration for one-click deployment to Vercel. The repository includes example pages such as a public feed rendered with static site generation and a drafts page rendered with server-side rendering, showing both rendering strategies.
The project is maintained by Prisma and lives in the prisma/prisma-nextjs-blog repository. Its data model defines five tables — User, Post, Account, Session, and VerificationToken — which are created and seeded through Prisma Migrate.
getStaticProps builds the public feed at build time, while getServerSideProps renders the authenticated drafts page dynamically.GITHUB_ID and GITHUB_SECRET environment variables; the callback URL is set to the Next.js /api/auth route.User, Post, Account, Session, and VerificationToken models; running npx prisma migrate dev creates and seeds the database.prisma/seed.ts populates a newly created database with sample users and posts so the UI works immediately.DATABASE_URL environment setup.Profile model, run npx prisma migrate dev, and use PrismaClient instance methods like prisma.user.update with nested profile writes.DATABASE_URL yourself; remember that GitHub OAuth requires a new app for each callback URL.provider in the Prisma datasource block to mysql, sqlserver, or mongodb, and adjust the connection URL accordingly; MongoDB requires enabling the mongodb preview feature.After cloning the repository and installing dependencies with npm install, you start PostgreSQL locally via npm run db:up or connect an existing instance. Running npx prisma migrate dev applies the schema and triggers the seed file. Then you configure a GitHub OAuth application and paste the client ID and secret into .env. Finally, npm run dev starts the app at http://localhost:3000.
PostgreSQL is the default provider, and the local development flow spins up a PostgreSQL container via docker-compose.yml with npm run db:up. Alternatively, you can point the datasource to MySQL, SQL Server, or MongoDB.
The recommended path is to add a model to the Prisma schema, run npx prisma migrate dev to generate a migration, update your Next.js API routes or server-side code, then build React UI components that fetch those endpoints.
The repository only walks through the GitHub provider from NextAuth.js. You would need to modify the [...nextauth].ts file and environment variables yourself to add other OAuth providers.
