Skip to content

nextjs-boilerplate is a Next.js template with Auth.js, shadcn UI, and Prisma ORM for MySQL integration.

License

Notifications You must be signed in to change notification settings

khisabkurniawn/nextjs-boilerplate

Repository files navigation

📄 Nextjs Boilerplate

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.


🚀 Features

  • 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.

📦 Tech Stack

  • Framework: Next.js
  • Authentication: Auth.js
  • UI Components: shadcn UI
  • ORM: Prisma
  • Database: MySQL
  • Formatter: Prettier
  • Validation: Zod

🛠 Installation

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

🔑 Setting up Authentication

Modify the auth configuration in /src/auth.config.ts to add OAuth providers or configure custom credentials login.

🗃 Database Setup with Prisma

  1. Migrate the database schema:

    npx prisma migrate dev --name init
  2. Generate the Prisma client:

    npx prisma generate

📄 License

This project is licensed under the MIT License.

About

nextjs-boilerplate is a Next.js template with Auth.js, shadcn UI, and Prisma ORM for MySQL integration.

Topics

Resources

License

Stars

Watchers

Forks