A modern SaaS-ready DMS built with Next.js 16, MongoDB, and JWT Authentication. This system provides role-based access for Super Admin and Admin, with secure authentication and email-based onboarding.
- Authentication (JWT-based)
- Super Admin (full control) Admin management
- Email onboarding (random password + reset link)
- Password reset system
- Role-based access control
- Clean SaaS dashboard UI
- Smart search (name, email, role)
- CRUD operations (Create, Edit, Delete users)
- Modern responsive UI (TailwindCSS)
- Frontend: Next.js 16 (App Router)
- Backend: Next.js API Routes
- Database: MongoDB (Mongoose)
- Authentication: JWT
- Email Service: MailerSend
- Styling: Tailwind CSS
- Notifications: React Hot Toast
Create a .env.local file:
# MongoDB
MONGODB_URI=your_mongodb_uri
# JWT
JWT_SECRET=your_secret_key
# MailerSend
MAILERSEND_API_KEY=your_api_key
EMAIL_FROM=noreply@yourdomain.com
EMAIL_FROM_NAME=DMS
# App
APP_URL=http://localhost:3000git clone https://github.com/your-username/dms.git
cd dmsnpm installnpm run devOpen in browser:
http://localhost:3000/api/seed-super-admin| Role | Permissions |
|---|---|
| Super Admin | Full access (create admins, delete, edit) |
| Admin | Manage users (limited access) |
When an admin is created:
-
System generates a random password
-
Sends email with:
- Password
- Reset link
-
User logs in → changes password
- User clicks Forgot Password
- Receives email with reset link
- Sets new password using secure token
- Password hashing (bcrypt)
- JWT authentication
- Role-based API protection
- Token-based password reset (expires in 1 hour)
Pull requests are welcome. For major changes, please open an issue first.
Alain Iranzi alainiranzi00@gmail.com
If you like this project, give it a ⭐ on GitHub!