A minimal starter kit for Next.js.
Here's the foundation of basically every Next.js project I've ever made, which comes with a considerable amount of boilerplate already written so you can focus on shipping.
I did my best to include building blocks into this template while keeping things minimal so you can add/or remove things as you desire.
- Next.js 16 (React + TypeScript)
- Tailwind CSS + shadcn/ui
- PostgreSQL + Drizzle ORM
- Self-hosted username-password authentication via Better-Auth
- Type safe environment variables
- Object validation with Zod
- Prettier + ESLint
There aren't many mandatory prerequisites other than npm.
- Download, fork, or template this repository.
- Download dependencies via
npm i. - Create and populate a
.env.localfile based off of.env.example. - Push the database schema to your database via
npm run db:push. - Start a local development server via
npm run dev.
If at any point you want to view/manage the contents of your database, you can do easily through Drizzle Studio via npm run db:studio.
You should avoid directly modifying your production database. I tend to use PostgreSQL, and it's really easy to set up locally with Docker.
You're going to want to use database migrations to organize and manage schema changes in production. You can generate a migration file via npm run db:generate.
If at any point you want to delete a migration file, use npm run db:drop. This does not rollback changes to your database, it just safely deletes the SQL migration script.
Preferably, migrations will run automatically when a pull request is merged. This can be done using GitHub Actions, or any other CI/CD pipeline equivalent.
The included user authentication is a minimal credentials implementation that is not intended for production use without further polish.
Rate limiting and email verification are both features that should be implemented that will prevent the majority of vulnerabilities. Various OAuth options should also be considered.
You can also completely replace the authentication implementation with a hosted alternative, such as Clerk.
Licensed under the MIT License, Copyright © 2025