This is a template repository for building a Next.js application with MongoDB, Prisma, and Next Auth V5.
- Next Auth V5 with user registration, login, and logout functionality
- Protected Routes
- Next.js framework for server-side rendering and client-side rendering
- MongoDB for database storage
- Prisma for database ORM
- Clone the repository
- Install dependencies:
npm install
- Set up your environment variables by creating a
.env
or
.env.local
file based on the.env.example
file. - Generate and DB Push Prisma Client
npx prisma generate
npx prisma db push
- Start the development server:
npm run dev
auth.config.ts
&&
app/lib/actions.ts
handles auth logic/lib/form-schemas.ts
zod for form validationmiddleware.ts
handles protected routes