A comprehensive MERN stack (MongoDB, Express.js, React.js, Node.js) HR Management System designed to streamline human resources operations, employee management, and organizational workflows.
- Features
- Tech Stack
- System Requirements
- Installation
- Project Structure
- API Endpoints
- Usage Guide
- Screenshots
- Contributing
- License
- Role-Based Access Control: HR and Employee portals with different permissions
- Secure Authentication: JWT-based authentication with token expiration
- Password Management: Change password functionality with bcrypt encryption
- Default Password System: Initial default passwords for new employees
- Employee Profiles: Comprehensive employee information management
- Department & Team Structure: Organize employees by departments and teams
- Employee Performance Tracking: Record and analyze employee performance
- Employee Search & Filtering: Find employees by various parameters
- Check-In/Check-Out System: Real-time attendance tracking for employees
- Attendance Records: Historical attendance data with detailed views
- Attendance Analytics: Reports on attendance patterns and statistics
- Manual Attendance Management: HR can add, edit, and delete attendance records
- Time Format: Human-readable work hours (e.g., "8 hours 30 minutes")
- Leave Requests: Employees can request time off
- Leave Approval Workflow: HR can approve or reject leave requests
- Leave Balance Tracking: Track different types of leave balances
- Leave Calendar: Visual calendar view of approved leaves
- Task Assignment: Assign tasks to employees with due dates
- Progress Tracking: Monitor task completion status
- Task Priorities: Set task importance levels
- Task Notifications: Alert employees of new or updated tasks
- Performance Reviews: Structured evaluation of employee performance
- KPI Tracking: Monitor key performance indicators
- Goal Setting: Set and track employee goals
- Review Cycles: Regular performance review scheduling
- Salary Structure: Define and manage salary components
- Salary History: Track salary changes over time
- Payroll Processing: Calculate salaries including deductions
- Compensation Management: Manage bonuses and other compensation
- Support Tickets: Internal ticketing for employee requests
- Ticket Tracking: Monitor ticket status and responses
- Priority Management: Assign importance to different tickets
- Resolution Workflow: Track ticket resolution process
- React.js: UI library for building interactive interfaces
- Tailwind CSS: Utility-first CSS framework for responsive design
- Context API: State management for authentication and user data
- React Router: Navigation and routing between components
- Axios: HTTP client for API requests
- React Icons: Icon library for UI elements
- Node.js: JavaScript runtime for server-side logic
- Express.js: Web framework for building RESTful APIs
- MongoDB: NoSQL database for data storage
- Mongoose: MongoDB object modeling for data structure
- JWT: Authentication token management
- Bcrypt: Password hashing and security
# Node.js and npm
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
# MongoDB
sudo apt-get install gnupg
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/6.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org# Node.js and npm
brew install node
# MongoDB
brew tap mongodb/brew
brew install mongodb-community- Download and install Node.js from nodejs.org
- Download and install MongoDB from mongodb.com
git clone <repository-url>
cd hrmscd server
npm installcd ../client
npm installCreate .env in server directory:
PORT=5000
MONGO_URI=mongodb://localhost:27017/hrms_db
JWT_SECRET=your_secure_jwt_secret_key_123
HR_EMAIL=hr@company.com
HR_PASSWORD=hr_password
DEFAULT_EMPLOYEE_PASSWORD=password123Create .env in client directory:
VITE_API_URL=http://localhost:5000Start MongoDB service:
# Ubuntu/Debian
sudo systemctl start mongod
# macOS
brew services start mongodb-community
# Windows
# MongoDB should start automatically after installationCreate MongoDB database:
mongosh
use hrms_dbcd ../server
node scripts/setupHR.jsnode scripts/resetPasswords.jscd server
npm run devcd client
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
-
HR Login
- Email: As set in HR_EMAIL environment variable (default: hr@company.com)
- Password: As set in HR_PASSWORD environment variable (default: hr_password)
-
Employee Login
- Email: Employee's registered email (created by HR)
- Initial Password: As set in DEFAULT_EMPLOYEE_PASSWORD (default: password123)
hrms/
├── client/ # React frontend
│ ├── public/ # Static files
│ │ ├── components/ # Reusable components
│ │ │ ├── hr/ # HR dashboard pages
│ │ │ └── employee/ # Employee dashboard pages
│ │ ├── context/ # React context providers
│ │ ├── hooks/ # Custom hooks
│ │ └── utils/ # Utility functions
│ └── package.json
│
├── server/ # Express backend
│ ├── config/ # Configuration files
│ ├── middleware/ # Custom middleware
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── scripts/ # Utility scripts
│ └── package.json
│
└── README.md
POST /api/auth/hr/login- HR LoginPOST /api/auth/employee/login- Employee LoginPOST /api/auth/change-password- Change Password
GET /api/employees- Get all employeesPOST /api/employees- Create new employeeGET /api/employees/:id- Get employee by IDPUT /api/employees/:id- Update employeeDELETE /api/employees/:id- Delete employee
GET /api/attendance- Get all attendance records (HR only)GET /api/attendance/employee/:employeeId- Get employee attendancePOST /api/attendance- Create attendance record (HR only)POST /api/attendance/check-in- Employee check-inPOST /api/attendance/check-out- Employee check-outPUT /api/attendance/:id- Update attendance (HR only)DELETE /api/attendance/:id- Delete attendance (HR only)
GET /api/leaves- Get all leave requestsPOST /api/leaves- Create leave requestGET /api/leaves/:id- Get leave by IDPUT /api/leaves/:id- Update leave statusDELETE /api/leaves/:id- Delete leave request
GET /api/tasks- Get all tasksPOST /api/tasks- Create taskGET /api/tasks/:id- Get task by IDPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
GET /api/performance- Get performance reviewsPOST /api/performance- Add performance reviewPUT /api/performance/:id- Update performance review
GET /api/teams- Get all teamsPOST /api/teams- Create teamGET /api/teams/:id- Get team by IDPUT /api/teams/:id- Update teamDELETE /api/teams/:id- Delete team
GET /api/salaries- Get all salariesPOST /api/salaries- Create salary recordGET /api/salaries/employee/:id- Get employee salary historyPUT /api/salaries/:id- Update salary
- Login using HR credentials
- Employee Management: Create, update, or delete employee records
- Attendance Management: Track employee attendance, add manual records, export reports
- Leave Management: Approve or reject leave requests
- Task Assignment: Create and assign tasks to employees
- Performance Reviews: Conduct and record employee performance evaluations
- Team Management: Create and manage team structures
- Salary Management: Configure and update employee compensation
- Login using employee credentials
- Profile: View and update personal information
- Attendance: Check in and out, view attendance history
- Leave Requests: Submit and track leave applications
- Tasks: View assigned tasks, update progress
- Performance: Access performance reviews and feedback
- Teams: View team information and members
- Salary: View salary information and history
This section contains screenshots of key features and interfaces of the HRMS application. All screenshots are stored in the screenshots folder.
For more information on adding screenshots, refer to the screenshots/README.md file.
- 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 licensed under the MIT License - see the LICENSE file for details.
















