/ CASE STUDY • #006
Enterprise HRM System
Multi-tenant Human Resource Management platform with biometric device integration







CLIENT
Internal Product
ROLE
Lead System Architect & Full-stack Developer
DURATION
1.5 Month
YEAR
2026
/ OVERVIEW
Built a production-grade, enterprise-level Human Resource Management system serving as a complete workforce management platform. Engineered to deliver exceptional performance, the platform maintains sub-100ms API response times across 200+ endpoints while handling complex enterprise workflows.
Key Architectural Features
High-Performance Backend: Powered by NestJS 11 with 43 robust RESTful API modules.
Modern Frontend & Desktop: Features a Next.js 16 glassmorphic admin dashboard built with React Server Components, alongside a Tauri 2.x desktop application for native hardware integration.
Secure Authentication: Utilizes a self-hosted Better Auth service with built-in multi-tenant organization support.
Core Innovations
Data Isolation: A comprehensive multi-tenant architecture ensuring complete data separation between organizations.
Biometric Attendance Pipeline: A real-time data pipeline connecting physical ZKTeco devices to the cloud using a native desktop agent.
Modular Payroll Engine: An automated processing engine built to support highly complex salary structures and dynamic tax calculations.
The challenge
Enterprise HR systems face a unique paradox: they must be extraordinarily flexible to accommodate diverse organizational structures, compliance requirements, and regional labor laws—while remaining simple enough for non-technical HR staff to operate daily.
Key Problems to Solve
1. Multi-tenancy at scale Each organization needs completely isolated data, custom configurations, and independent workflows without infrastructure duplication.
2. Biometric device integration ZKTeco attendance devices communicate via proprietary TCP/UDP protocols. No existing cloud solution could bridge physical devices to a web-based HRM without custom middleware.
3. Complex payroll calculations Salary structures vary wildly: multiple components (HRA, DA, Special Allowance), tax slabs, loan EMI deductions, advance recoveries, and benefit allocations—all needing atomic batch processing.
4. Real-time attendance at scale Processing thousands of daily punch records from multiple devices, correlating them with shift schedules, leave records, and holiday calendars in real-time.
5. Role-based access with granularity 13 distinct roles (from SuperAdmin to Employee) each requiring different data visibility, action permissions, and UI experiences across 22+ dashboard modules.
6. Offline-first device management Desktop agents must continue collecting attendance data even when cloud connectivity is interrupted, then sync seamlessly when reconnected.
How I approached it
- →Designed a Turborepo-powered monorepo with strict package boundaries, enabling parallel development across 4 applications and 7 shared packages while maintaining type safety from database schema to UI components.
- →Developed a high-performance NestJS 11 API with a layered middleware architecture that enforces tenant isolation at every request
- →Engineered a complete IoT pipeline for connecting physical biometric devices to the cloud platform
- →Built a self-hosted authentication system using Better Auth 1.4 with enterprise-grade features
- →Built a comprehensive admin dashboard leveraging the latest React 19 and Next.js 16 patterns
- →Designed a comprehensive PostgreSQL schema with 23 schema files covering every HR domain
- →Implemented a webhook-based queue system using Upstash QStash for background processing
- →Full internationalization support with next-intl 4.7
/ OUTCOME
What it did in the world
Zero-Config Multi-Tenancy
Organizations spin up with guided setup wizard, isolated data, custom configurations, and role-based dashboards — no infrastructure changes needed.
Biometric IoT Bridge
First-of-its-kind bridge connecting physical ZKTeco biometric devices to a cloud HRM via native desktop agent with offline resilience and automatic sync.
Enterprise Payroll Engine
Handles complex salary structures with 15+ components, automated tax calculations, loan EMI deductions, advance recoveries, and bulk processing for 1000+ employees.
Real-Time Workforce Analytics
Live attendance monitoring, hiring vs attrition trends, department performance scores, and predictive analytics — all computed in real-time from 200+ API endpoints.
/ STACK
Built with
BACKEND
- NestJS 11.1
- Node.js 20+
- Drizzle ORM 0.45
- PostgreSQL
- Upstash QStash
- Vite 7.3
- EventEmitter2
- Swagger/Scalar
- Vitest 4.0
- class-validator
FRONTEND (WEB)
- Next.js 16.1
- React 19.2
- Tailwind CSS 4.1
- shadcn/ui
- TanStack Table
- Recharts 3.7
- Motion 12
- next-intl 4.7
- nuqs 2.8
- React PDF 4.3
DESKTOP
- Tauri 2.x
- Rust (tokio)
- SQLite (rusqlite)
- ZKTeco Protocol
- reqwest
- tracing
- parking_lot
- Tauri Plugins
- Cross-platform
- System Tray
AUTHENTICATION
- Better Auth 1.4
- Multi-tenant RBAC
- 2FA / Email OTP
- JWT + Bearer + API Key
- 13 Roles
- Organization Isolation
- Device Authorization
- App Invitations
- OpenAPI
- Session Management