A comprehensive web-based performance management system for fintech companies, built with Next.js, TypeScript, and Prisma.
- Node.js 18+ installed
- Git installed
- (Optional) Active Directory server for AD integration
- Clone the repository
git clone <repository-url>
cd performance-system- Install dependencies
npm install- Set up environment variables
cp .env.example .envEdit .env and add your security keys:
JWT_SECRET="your-secure-random-secret-key"
SESSION_SECRET="another-secure-random-secret-key"Generate secure secrets using:
openssl rand -base64 32- Initialize the database
npx prisma db push
npx prisma db seed- Start the development server
npm run dev- Open the application Navigate to http://localhost:3000
| Role | Password | Access Level | |
|---|---|---|---|
| Admin | admin@company.com | admin123 | Full system access |
| HR | hr@company.com | hr123 | User & review management |
| Supervisor | jan.nowak@company.com | supervisor123 | Team reviews |
| Employee | piotr.kowalczyk@company.com | employee123 | Self reviews |
-
Phase 1: Self-Evaluation
- Employees create personal goals (max 7)
- Self-assess on 5 core competencies
- Add comments and justifications
-
Phase 2: Supervisor Evaluation
- Supervisors review employee submissions
- Provide scores and feedback
- Assess goal achievement
-
Phase 3: Final Meeting
- Collaborative review finalization
- Final grades assignment
- Development plan creation
- Delivery - Achieving goals and tasks
- Development - Continuous skill improvement
- Innovation - Creativity and new solutions
- Courage - Taking on challenges
- Resilience - Dealing with difficulties
- 5 - Outstanding
- 4 - Above expectations
- 3 - Solid performer
- 2 - Developing
- 1 - Below expectations
- English and Polish languages supported
- Toggle via globe icon in navigation
- All UI elements fully translated
- Persistent language preference
- Role-based access control (RBAC)
- Bulk user import via CSV
- User activation/deactivation
- Supervisor assignment
- Department organization
- JWT tokens in httpOnly cookies
- Session-based authentication
- Role-based access control
- Password policy enforcement
- CSRF Protection - Token validation for state-changing operations
- Rate Limiting - 5 login attempts per 15 minutes
- Account Lockout - 30-minute lockout after failed attempts
- Security Headers - CSP, X-Frame-Options, HSTS
- Input Validation - Zod schema validation
- SQL Injection Prevention - Parameterized queries via Prisma
- XSS Protection - Content sanitization
- Password Security - Bcrypt with cost factor 12
Enterprise-grade Active Directory integration for user synchronization and authentication.
π Complete AD Integration Guide - Detailed technical documentation
- Add AD settings to
.env
AD_ENABLED=true
AD_DOMAIN=company.local
AD_URL=ldap://dc.company.local:389
AD_BASE_DN=DC=company,DC=local
AD_USERNAME=serviceaccount
AD_PASSWORD=servicepassword- Access AD Admin Panel
- Log in as admin β Navigate to
/admin/active-directory - Configure connection settings β Test connection β Sync users
β
User Synchronization - Names, emails, departments, manager relationships
β
Group-Based Roles - Automatic role assignment from AD groups
β
LDAP/LDAPS Support - Secure connections with SSL/TLS
β
Incremental Sync - Only processes changes, not full directory
β
Account Lifecycle - Auto-activation/deactivation based on AD status
β
Organizational Hierarchy - Preserves manager-subordinate structure
- Authentication Methods: AD-only or hybrid (AD + local)
- Connection Types: LDAP (389), LDAPS (636), Global Catalog (3268/3269)
- Search Filters: Customizable LDAP queries with advanced filtering
- User Account Control: Handles all AD account states and restrictions
- Group Mapping: Flexible AD group to application role mapping
- Error Handling: Comprehensive error codes and retry logic
- Service Account: Minimal privilege principle
- Certificate Validation: Full SSL/TLS certificate chain validation
- Rate Limiting: Protection against sync abuse
- Audit Logging: Complete audit trail of all AD operations
- Data Encryption: All credentials encrypted in transit
- Create Period - Define review cycles (Mid-Year/End-Year)
- Open Period - Automatically creates reviews for all employees
- Monitor Progress - Track completion rates
- Close Period - Finalize and archive reviews
- Add Users - Individual or bulk creation
- Import CSV - Bulk import with validation
- Manage Roles - Assign system roles
- Set Supervisors - Define reporting structure
- Export Data - Download user lists
- Password policies
- Email notifications
- Review templates
- Competency weights
- Grading scales
- Frontend: Next.js 15, TypeScript, Tailwind CSS
- Backend: Next.js API Routes
- Database: Prisma ORM with SQLite (dev) / PostgreSQL (prod)
- Authentication: JWT with httpOnly cookies
- Validation: Zod schemas
- UI Components: Radix UI primitives
performance-system/
βββ app/ # Next.js app router
β βββ api/ # API routes
β βββ admin/ # Admin pages
β βββ dashboard/ # User dashboard
β βββ review/ # Review interface
βββ components/ # React components
βββ contexts/ # React contexts
βββ lib/ # Utilities & configs
β βββ auth.ts # Authentication
β βββ active-directory.ts # AD integration
β βββ translations.ts # i18n strings
βββ prisma/
β βββ schema.prisma # Database schema
β βββ seed.ts # Test data
βββ public/ # Static assets
- User - System users with roles
- Review - Performance reviews
- Goal - Employee-defined goals
- Competency - Competency evaluations
- ReviewPeriod - Review cycles
- AuditLog - System audit trail
- LoginAttempt - Security tracking
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run typecheck # Run TypeScript checks
# Database commands
npx prisma studio # Open database GUI
npx prisma db push # Apply schema changes
npx prisma generate # Generate Prisma client
npx prisma db seed # Seed test data-
Environment Variables
- Set strong JWT_SECRET and SESSION_SECRET
- Configure production database URL
- Set NODE_ENV=production
- Configure email service
-
Database Migration
npx prisma migrate deploy
-
Build Application
npm run build
-
Security Configuration
- Enable HTTPS
- Configure firewall rules
- Set up backup strategy
- Enable audit logging
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npx prisma generate
RUN npm run build
EXPOSE 3000
CMD ["npm", "start"]- Development: SQLite, debug logging, test accounts visible
- Production: PostgreSQL, error sanitization, test accounts hidden
Prisma Client Errors
npx prisma generate
npm run devDatabase Connection Issues
- Check DATABASE_URL in .env
- Ensure database server is running
- Verify network connectivity
Authentication Problems
- Clear browser cookies
- Check JWT_SECRET is set
- Verify token expiration
AD Sync Failures
- Verify LDAP URL and credentials
- Check network access to AD server (ports 389/636/3268/3269)
- Review AD permissions for service account
- Check Base DN format (DC=company,DC=local)
- Test with:
telnet dc.company.local 389 - Verify with:
Get-ADUser -Filter * | Select -First 5(PowerShell)
AD Authentication Issues
- Check user account status in AD
- Verify domain controller connectivity
- Test credentials manually with ldapsearch
- Check for account lockouts or password expiration
- Verify UPN format (user@domain.com)
Language Not Switching
- Clear browser local storage
- Check translation keys in lib/translations.ts
POST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Current user info
GET /api/reviews- List user's reviewsGET /api/reviews/[id]- Get specific reviewPATCH /api/reviews/[id]- Update reviewPOST /api/reviews/[id]/phase- Change review phase
GET /api/admin/users- List all usersPOST /api/admin/users- Create userPATCH /api/admin/users/[id]- Update userPOST /api/admin/users/import- CSV import
GET /api/admin/sync-ad- Check AD statusPOST /api/admin/sync-ad- Trigger AD sync
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is created for demonstration purposes.
For issues and questions:
- Check the troubleshooting section
- Review existing issues
- Create a new issue with detailed information
- Built with Next.js and Prisma
- UI components from Radix UI
- Icons from Lucide React
- Styling with Tailwind CSS