A modern authentication and dashboard system built with Next.js 15, featuring role-based access control, OAuth integration, and a sleek user interface.
-
🔐 Advanced Authentication
- Email/Password authentication
- OAuth support (Google, GitHub)
- Two-factor authentication (2FA)
- Email verification
- Password reset functionality
-
👥 Role-Based Access Control
- User roles (Admin, User, Superadmin, Journalist)
- Protected routes
- Role-specific content rendering
-
💻 Modern Dashboard
- Responsive layout
- Dark/Light theme support
- Command palette (⌘K)
- Breadcrumb navigation
- Collapsible sidebar
-
🛠️ Technical Features
- Server and client components
- API route handlers
- Database integration
- Form validation
- Error handling
- Toast notifications
- Framework: Next.js 14
- Authentication: NextAuth.js v5
- Database: PostgreSQL + Prisma ORM
- Styling: Tailwind CSS + shadcn/ui
- Email Service: Resend
- Form Handling: React Hook Form + Zod
- State Management: React Context
- Command Palette: kbar
- Node.js 18+
- PostgreSQL
- npm/yarn
- Git
Create a .env file in the root directory with the following variables:
DATABASE_URL=
AUTH_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
RESEND_API_KEY=
NEXT_PUBLIC_APP_URL=- Clone the repository:
git clone https://github.com/ataullah1/Role-Based-OAuth-Dashboard.git- Install dependencies:
cd News-Protal-With-Nextjs-Prisma
npm install- Set up the database:
npx prisma generate
npx prisma db push- Start the development server:
npm run dev| Command | Description |
|---|---|
dev |
Starts development server |
build |
Creates production build |
start |
Starts production server |
lint |
Runs linter |
postinstall |
Generates Prisma client |
├── app/ # App router pages
├── components/ # Reusable components
├── hooks/ # Custom React hooks
├── lib/ # Utility functions
├── prisma/ # Database schema and migrations
└── public/ # Static assets
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Ataullah - GitHub
Project Link: https://github.com/ataullah1/Role-Based-OAuth-Dashboard.git
