Short Description: A modern, secure employee self-service portal built with Next.js 15, featuring Active Directory authentication, biometric attendance integration, and comprehensive account management capabilities.
Nextjs + LDAPS Employee Portal is a comprehensive self-service platform that empowers employees to manage their accounts, passwords, and view attendance data while reducing IT helpdesk burden. Built with modern web technologies and enterprise-grade security.
- LDAPS Integration - Secure Active Directory authentication
- NextAuth.js - Modern authentication framework
- Role-Based Access Control (RBAC) - Admin and user permissions based on AD groups
- Session Management - Secure JWT tokens with automatic expiry
- Password Reset - Email OTP-based secure password resets
- Password Change - Direct password updates via LDAPS
- Account Unlock - Self-service account unlocking with email verification
- Account Status - Real-time password expiry and account status viewing
- eSSL Biometric Integration - Real-time attendance data from biometric devices
- Personal Dashboard - Individual attendance tracking and reports
- Admin Reports - Department-wide attendance management (for authorized users)
- Attendance Calendar - Visual monthly attendance overview
- Responsive Design - Mobile-first approach with ShadCN UI components
- Dark/Light Mode - User preference-based theming
- Real-time Updates - Live attendance status and notifications
- Accessibility - WCAG compliant interface design
| Category | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | Next.js | 15.x | React framework with App Router |
| UI Library | ShadCN UI | Latest | Modern, accessible components |
| Styling | Tailwind CSS | 3.x | Utility-first CSS framework |
| Authentication | NextAuth.js | 5.x | Authentication framework |
| Database | Prisma ORM | 5.x | Type-safe database operations |
| Language | TypeScript | 5.x | Type-safe development |
| Directory | LDAPS | - | Active Directory integration |
| Biometric | eSSL API | - | Attendance system integration |
graph TD
A[Employee Browser] --> B[Next.js 15 App]
B --> C[NextAuth.js]
C --> D[LDAPS/Active Directory]
B --> E[Prisma ORM]
E --> F[PostgreSQL Database]
B --> G[eSSL Biometric API]
G --> H[Biometric Devices]
I[Admin Browser] --> B
B --> J[RBAC Middleware]
J --> K[Admin Dashboard]
- Node.js 20+ (LTS recommended)
- PostgreSQL 14+ database
- Active Directory with LDAPS configured
- eSSL Biometric System (optional, for attendance features)
- SMTP Server (for email notifications)
git clone https://github.com/PHPxCODER/ldap-portal.git
cd ldap-portalnpm install
# or
yarn install
# or
pnpm installcp .env.example .env.localConfigure your environment variables:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/ldap-portal"
# NextAuth
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
# LDAP Configuration
LDAP_URL="ldaps://dc01.yourdomain.com:636"
LDAP_BIND_DN="CN=ServiceAccount,OU=Service,DC=company,DC=com"
LDAP_BIND_PASSWORD="service-account-password"
LDAP_BASE_DN="DC=company,DC=com"
# Email Configuration
SMTP_HOST="smtp.company.com"
SMTP_PORT="587"
SMTP_USER="noreply@company.com"
SMTP_PASSWORD="smtp-password"
# eSSL Integration (optional)
ESSL_API_URL="http://your-essl-server:8080"
ESSL_API_USERNAME="api-user"
ESSL_API_PASSWORD="api-password"# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma db push
# Seed initial data (optional)
npx prisma db seednpm run devVisit http://localhost:3000 to see the application.
ldap-portal/
βββ app/ # Next.js 15 App Router
β βββ (auth)/ # Authentication routes
β βββ (dashboard)/ # Protected dashboard routes
β βββ admin/ # Admin-only pages
β βββ api/ # API routes
β βββ globals.css # Global styles
βββ components/ # Reusable UI components
β βββ ui/ # ShadCN UI components
β βββ auth/ # Authentication components
β βββ dashboard/ # Dashboard components
β βββ admin/ # Admin components
βββ lib/ # Utility libraries
β βββ auth.ts # NextAuth configuration
β βββ ldap.ts # LDAP utilities
β βββ essl.ts # eSSL integration
β βββ utils.ts # General utilities
βββ prisma/ # Database schema and migrations
βββ types/ # TypeScript type definitions
βββ public/ # Static assets
- Create a service account with read/write permissions
- Configure LDAPS with proper SSL certificates
- Set up group mappings for RBAC in
lib/auth.ts
- Enable eBIOServer-New or API access on your eSSL system
- Configure employee ID mapping between AD and eSSL
- Set up background sync jobs for attendance data
- Configure SMTP settings for password reset emails
- Customize email templates in
components/emails/ - Set up proper SPF/DKIM records for email delivery
# Build Docker image
docker build -t ldap-portal .
# Run with Docker Compose
docker-compose up -d# Build production bundle
npm run build
# Start production server
npm run start- Development: Hot reload, debug logging enabled
- Staging: Production build with test data
- Production: Optimized build, security headers, monitoring
- HTTPS Enforcement - All connections encrypted
- CSRF Protection - Built-in NextAuth.js protection
- Input Validation - Zod schema validation
- Rate Limiting - API endpoint protection
- Audit Logging - All admin actions logged
- Session Security - Secure cookie configuration
| Role | Permissions |
|---|---|
| Employee | View own profile, change password, view attendance |
| Department Admin | Manage team members, view team attendance |
| HR Admin | Manage all employees, generate reports |
| IT Admin | System configuration, user management, audit logs |
| Super Admin | Full system access, security settings |
- Personal profile management
- Password change/reset
- Attendance calendar view
- Monthly attendance reports
- Account status monitoring
- User management interface
- Bulk password resets
- Department attendance reports
- System health monitoring
- Audit log access
# Run unit tests
npm run test
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2e
# Run all tests with coverage
npm run test:coverage- Application Performance Monitoring - Response times, error rates
- User Activity Tracking - Login patterns, feature usage
- System Health Checks - LDAP connectivity, database performance
- Security Monitoring - Failed login attempts, suspicious activity
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Contributing Guidelines for detailed information.
This project is licensed under the MIT License - see the LICENCE file for details.
- Documentation: Wiki Pages
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Internal Support: Contact IT Helpdesk
- Next.js Team - For the amazing React framework
- ShadCN - For the beautiful UI component library
- NextAuth.js - For robust authentication solutions
- eSSL Security - For biometric integration capabilities
Built with β€οΈ for modern workplace efficiency