A full-stack authentication system built with Next.js App Router, NextAuth.js, and MongoDB.
- Secure login/signup with NextAuth.js
- MongoDB adapter for user storage
- Protected routes and role-based access
- JWT-based session handling
- Modular folder structure using App Router
NextAuth_Tutorial/
├── app/ # Pages and routes
│ ├── (components)/ # Shared UI components
│ ├── (modals)/ # Auth modal UIs
│ ├── Public/ # Publicly accessible route
│ ├── Member/ # Protected route for members
│ ├── CreateUser/ # User registration UI
│ ├── Users/ # Route to manage users
│ └── api/ # API endpoints
│ └── auth/[...nextauth]/ # NextAuth configuration
├── public/ # Static assets (SVGs, icons)
├── styles/ # Global CSS
├── middleware.js # Auth middleware
├── next.config.mjs # Next.js config
└── package.json
git clone https://github.com/your-username/NextAuth_Tutorial.git
cd NextAuth_Tutorial
npm install
npm run devConfigure your MongoDB URI and NextAuth credentials in .env.local.
Developed by @arpit
This project is licensed under the MIT License.