A production-ready template for building modern web applications with Next.js, featuring Auth.js, shadcn UI, Prisma ORM, Prettier for code formatting, and Zod for schema validation.
- Next.js: React framework with SSR and SSG support.
- Auth.js: Authentication system with OAuth and credential-based login.
- shadcn UI: Pre-styled, accessible components built on Tailwind CSS.
- Prisma ORM: Simplifies interaction with MySQL databases.
- Prettier: Enforces consistent code formatting across the project.
- Zod: Provides easy schema validation for form data and APIs.
- Framework: Next.js
- Authentication: Auth.js
- UI Components: shadcn UI
- ORM: Prisma
- Database: MySQL
- Formatter: Prettier
- Validation: Zod
Clone the repository and install dependencies:
git clone https://github.com/omlexi/nextjs-boilerplate.git
cd nextjs-boilerplate
pnpm install
Configure your database connection in the .env
file:
AUTH_SECRET="nextjs-boilerplate"
AUTH_GOOGLE_ID=""
AUTH_GOOGLE_SECRET=""
AUTH_TRUST_HOST="http://localhost:3000"
NEXTAUTH_URL="http://localhost:3000"
DATABASE_URL="mysql://user:password@localhost:3306/nextjs-boilerplate"
Run the development server:
pnpm dev
Modify the auth
configuration in /src/auth.config.ts
to add OAuth providers or configure custom credentials login.
-
Migrate the database schema:
npx prisma migrate dev --name init
-
Generate the Prisma client:
npx prisma generate
This project is licensed under the MIT License.