A Comprehensive Human Resources Management System
Built with NestJS, MongoDB, and TypeScript
- Project Overview
- System Architecture
- Team Modules
- Technology Stack
- Quick Start
- Module Documentation
- API Documentation
- Development
- Testing
- Deployment
- Contributing Teams
This is a comprehensive HR Management System designed to handle all aspects of human resources management in a modern organization. The system is built as a modular, scalable application using NestJS framework with MongoDB as the database.
- Employee Profile Management - Complete employee data repository with change request workflows
- Organization Structure - Department and position hierarchy management
- Performance Management - Appraisal cycles, evaluations, and dispute resolution
- Time Management - Attendance tracking, shift management, and overtime handling
- Leave Management - Comprehensive leave policies, requests, and approvals
- Integration-Ready - RESTful APIs for seamless integration with payroll, recruitment, and other systems
- 33+ Database Schemas - Well-designed data models with proper relationships
- 173+ API Endpoints - Comprehensive REST API coverage
- 18+ Integration Endpoints - Cross-module communication support
- 5 Core Modules - Modular architecture for maintainability
- Zero Compilation Errors - Production-ready codebase
The HR Management System follows a modular monolith architecture with clear separation of concerns:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β COMMON MODULE β
β (Authentication, Authorization, Notifications) β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββ΄βββββββββ¬βββββββββββ¬ββββββββββββ¬βββββββββββ
β β β β β
ββββββββΌβββββββ βββββββΌββββββ βββΌβββββββ ββββΌβββββ ββββΌβββββ
β EMPLOYEE β β ORG β β PERF β β TIME β β LEAVE β
β PROFILE ββββ€ STRUCTURE β β MGMT β β MGMT β β MGMT β
ββββ¬βββββββ¬ββββ βββ¬βββββββ¬βββ βββ¬βββββββ βββββ¬ββββ βββββ¬ββββ
β β β β β β β
β ββββββββββ΄βββββββ΄βββββββ β β
β β β
βββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββ
β
ββββββββββΌββββββββββ
β EXTERNAL SYSTEMS β
β (Payroll, etc.) β
βββββββββββββββββββββ
- Modular Design - Each module is self-contained with clear boundaries
- API-First - RESTful APIs for all operations
- Data Integrity - Mongoose schemas with validation
- Audit Trail - Complete tracking of all changes
- Role-Based Access - Granular permissions control
- Integration-Ready - Designed for easy integration with other systems
This project is developed by multiple teams, each responsible for specific modules:
Modules: Employee Profile, Organization Structure, Performance Management
π View Detailed Documentation β
Status: 100% Complete - Production Ready
Statistics:
- 11 Database Schemas - Fully implemented and tested
- 60+ API Endpoints - All functional with Swagger documentation
- 3 Core Modules - Fully integrated
- Zero Critical Issues - All bugs resolved
Completed Features:
- β Complete employee lifecycle management (CRUD)
- β Self-service portal (profile viewing, contact updates, biography, photo upload)
- β Change request workflow (Submit β Approve/Reject)
- β Manager dashboard (team overview, statistics)
- β Qualifications management (education, certifications)
- β System roles and permissions
- β Candidate management and conversion to employee
- β Department hierarchy management (CRUD)
- β Position management with automatic reporting relationships
- β Change request system for structural changes
- β Circular dependency prevention
- β Integration with Employee Profile
- β Customizable appraisal templates with rating scales
- β Cycle management (Annual, Semi-annual, Probationary, Project-based)
- β Appraisal assignment and tracking
- β Weighted scoring system with automatic calculation
- β Dispute submission and resolution workflow
- β Auto-update employee profiles with appraisal scores
Technical Achievements:
- Clean architecture (Controller β Service β Model)
- Comprehensive DTO validation with class-validator
- Full Swagger/OpenAPI documentation
- Standardized error handling
- Production-ready code quality
- All integration points functional
Key Endpoints:
Employee Profile: /api/employee-profile/*
Organization: /api/organization-structure/*
Performance: /api/performance/*
Swagger Documentation: http://localhost:3000/api
Module: Time Management
π View Detailed Documentation β
- 8 Database Schemas
- 40+ API Endpoints
- 5 Implementation Phases
Key Features:
- Shift configuration and assignment
- Attendance recording (clock-in/out)
- Policy enforcement (overtime, lateness)
- Exception handling and approvals
- Payroll integration
Module: Leave Management
π View Detailed Documentation β
- 14 Database Schemas
- 75+ API Endpoints
- 3 Implementation Phases
Key Features:
- Leave policy configuration
- Vacation packages and entitlements
- Leave request workflows
- Automatic accrual and carry-forward
- Final settlement processing
- Cumulative tracking (BR 41)
Module: Payroll Configuration & Policy Setup
π View Detailed Documentation β
- Core payroll configuration schemas (pay grades, pay types, allowances, tax rules, insurance brackets, severance rules, company settings)
- Integration-first dummy responses unblock payroll execution, tracking, and finance teams
- Approval workflows ensure every configuration change is auditable
Key Features:
- Salary structure templates aligned with organizational grades and contract types
- Legal and insurance rule modeling that matches milestone scope
- Company-wide payroll settings plus signing bonus and severance configurations
Module: Payroll Processing & Execution
π View Detailed Documentation β
- Manages payroll runs from initiation through draft generation, approvals, freeze, and payment tracking
- Stores detailed payroll employee records (earnings, deductions, benefits, overtime, exception logs)
- Provides the run/record APIs that downstream systems call during payroll cycles
Key Features:
- Supports regular, off-cycle, and refund payroll runs
- Exception workflows for missing data, salary spikes, and bank issues
- State-machine style status progression (Draft β Paid) with audit history
Module: Payroll Tracking, Transparency & Self-Service
π View Detailed Documentation β
- 30+ endpoints across payslips, payroll disputes, reimbursements, refunds, and reporting
- Five submodules (Payslips, Expense Claims, Disputes, Refunds, Reports) powering employee self-service
- Dummy datasets keep integrations with payroll execution, leave, and time-management modules unblocked
Key Features:
- Employee-facing payroll visibility with filtering and export-friendly payloads
- Claim/dispute workflows capturing action history for specialists, managers, and finance
- Departmental and finance reporting APIs for month-end and year-end reviews
Modules: Recruitment, Onboarding & Offboarding
π View Detailed Documentation β
- 27 schemas and 60+ endpoints covering requisitions, candidates, onboarding tasks, clearances, and final settlements
- Integrations trigger onboarding after offer acceptance and finalize settlements during offboarding
- Sub-readmes document recruitment analytics, onboarding checklists, and clearance/final-pay flows
Key Features:
- Recruitment pipelines with templates, interviews, offers, and GDPR-compliant consent tracking
- Onboarding orchestration for tasks, documents, access provisioning, and payroll initiation
- Offboarding workflows handling notices, asset returns, department clearances, and final settlements
- Framework: NestJS 11.x
- Runtime: Node.js 18+
- Language: TypeScript 5.7
- Database: MongoDB 5.x with Mongoose ODM
- Validation: class-validator, class-transformer
- Authentication: JWT (Passport.js)
- Configuration: @nestjs/config (dotenv)
- API Documentation: Swagger/OpenAPI (planned)
- Linting: ESLint with TypeScript support
- Formatting: Prettier
- Testing: Jest (unit & e2e)
- Build: NestJS CLI
- Node.js v18 or higher
- MongoDB v5 or higher
- npm or yarn package manager
# Clone the repository
git clone <repository-url>
cd HR_Main
# Install dependencies
npm install
# Configure environment variables
cp .env.example .env
# Edit .env with your configuration
# Start MongoDB (if running locally)
mongod --dbpath /path/to/data
# Run the application
npm run start:dev# Check if server is running
curl http://localhost:3000
# Should return: "Hello World!"Each module has comprehensive documentation covering schemas, endpoints, business rules, and integration points:
| Module | Team | Documentation | Status |
|---|---|---|---|
| Common Module | All Teams | README-Software404.md | β Complete |
| Employee Profile | Software404 | README-Software404.md | β Complete |
| Organization Structure | Software404 | README-Software404.md | β Complete |
| Performance Management | Software404 | README-Software404.md | β Complete |
| Time Management | D.F.J | README-DFJ.md | β Complete |
| Leave Management | J.M.F | README-JMF.md | β Complete |
| Payroll Configuration | git blame all.ts | README-git blame all.ts.md | β Complete |
| Payroll Processing | Dynamic Trio | README-dynaic-trio.md | β Complete |
| Payroll Tracking & Self-Service | SMH | README-SMH.md | β Complete |
| Recruitment Lifecycle | L.Y.M | README-LYM.md | β Complete |
http://localhost:3000
| Module | Base Path | Endpoints | Integration Endpoints |
|---|---|---|---|
| Employee Profile | /employee-profile |
20 | 4 |
| Organization Structure | /org-structure |
17 | 5 |
| Performance | /performance |
21 | 4 |
| Time Management | /time-management |
40+ | 3+ |
| Leave Management | /leave-management |
75+ | 4 |
# Test Employee Profile integration
curl http://localhost:3000/employee-profile/EMP001/appraisals
# Test Organization Structure integration
curl http://localhost:3000/org-structure/integration/pay-grades
# Test Performance integration
curl http://localhost:3000/performance/integration/final-appraisal/EMP001
# Test Time Management integration
curl "http://localhost:3000/time-management/integration/payroll/EMP001?startDate=2024-12-01&endDate=2024-12-31"
# Test Leave Management integration
curl http://localhost:3000/leave-management/integration/payroll/EMP001# Development
npm run start # Start the application
npm run start:dev # Start with hot-reload (watch mode)
npm run start:debug # Start in debug mode
# Build
npm run build # Build for production
# Testing
npm run test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:cov # Run tests with coverage
npm run test:e2e # Run end-to-end tests
# Linting & Formatting
npm run lint # Run ESLint
npm run format # Format code with Prettiersrc/
βββ common/ # Shared resources
β βββ decorators/ # Custom decorators (roles, etc.)
β βββ guards/ # Auth guards (JWT, roles)
β βββ schemas/ # Common schemas (User, Notification)
β
βββ modules/ # Feature modules
β βββ employee-profile/ # Employee data management
β βββ org-structure/ # Organization hierarchy
β βββ performance/ # Performance appraisals
β βββ time-management/ # Attendance & shifts
β βββ leave-management/ # Leave policies & requests
β
βββ app.module.ts # Root module
βββ main.ts # Application entry point
Each module includes:
- Unit Tests - Service and controller testing
- Integration Tests - Cross-module communication
- E2E Tests - Full API workflow testing
# Run all unit tests
npm run test
# Run specific module tests
npm run test -- employee-profile
# Run with coverage
npm run test:cov
# Run e2e tests
npm run test:e2eCreate a .env file in the root directory:
# Application
NODE_ENV=production
PORT=3000
# Database
MONGODB_URI=mongodb://localhost:27017/hr_system
# JWT Configuration
JWT_SECRET=your-secret-key
JWT_EXPIRATION=7d
# CORS
CORS_ORIGIN=https://your-frontend-domain.com# Build the application
npm run build
# Start production server
npm run start:prodThis project is developed as part of an academic initiative.
- Requirements Documentation: See
/docsfolder for detailed CSV requirements - API Testing: Use Postman or similar tools with the endpoint examples above
- MongoDB Compass: Use for database visualization and queries
- NestJS Documentation: https://docs.nestjs.com
For questions, issues, or feature requests:
- Check the module-specific documentation first
- Review the requirements in
/docsfolder - Contact the responsible team (see Contributing Teams section)
Built with β€οΈ using NestJS