Multi-tenant HR management platform backend for employee lifecycle, HR workflows, documents, tasks, and real-time collaboration.
Problem Statement
The system centralizes HR operations that were previously fragmented or manual, including employee management, onboarding, leave management, task tracking, documents, and notifications. It provides companies with a multi-tenant HR platform with role-based access and real-time updates for employees, managers, HR administrators, and company administrators.
System Architecture
The backend is a REST API-first Node.js and Express.js application organized into domain-specific routers, services, models, and middleware. MongoDB with Mongoose stores company, user, employee, task, board, leave, and other HR domain data, with company-level filtering providing tenant isolation. JWT authentication and RBAC middleware control access, while Socket.io provides company-isolated real-time notifications and updates. AWS S3 handles document storage and signed URLs, while document processing, scheduled jobs, and worker processes handle background-oriented operations.
Key Features
•Multi-tenant company isolation with company-scoped access control
•JWT authentication with secure token refresh and RBAC middleware
•End-to-end employee lifecycle management and onboarding workflows
•Leave, attendance, task, and project management boards
•Real-time notifications and activity updates via Socket.io
•AWS S3 document storage with signed URLs and PDF/Excel/Word document processing
•Scheduled email reminders and automated HR notifications (SendGrid / Nodemailer)
•HR services: referrals, feedback, room booking, company policies, and announcements
Technical Challenges & Engineering Solutions
•Real-Time Multi-Tenancy: Used Socket.io with company-based namespaces and authentication middleware to isolate real-time communication between companies. Enabled real-time task updates, hiring alerts, and announcements without cross-company leaks.
•PM2 Cron Execution: Scheduled cron execution strictly on pm_id === 0 when deployed across multiple PM2 instances. Avoided duplicate scheduled jobs while laying groundwork for distributed locking.
•Non-Blocking Mail Generation: Offloaded heavy PDF/HTML mail template generation using workerpool to spawn separate worker processes, keeping main HTTP event loop responsive.
•Unified Document Pipeline: Integrated AWS S3 cloud storage alongside PDF, Excel, and Word parsing for secure document management and signed URL access.
Engineering Impact & Key Metrics
•Handled ~1,000 concurrent users per server instance
•Built and maintained 30+ HR-related domain services & REST API endpoints
Core Contributions
•Architected Node.js, TypeScript, and Express.js backend services and domain routes.
•Designed MongoDB/Mongoose schemas for multi-tenant HR models and access boundaries.
•Implemented JWT auth, role-based authorization (RBAC), and company tenant middleware.
•Built Socket.io real-time event pipeline and AWS S3 document processing service.
•Configured node-cron schedules and workerpool asynchronous background tasks.