All case studies
Case Study · #006 · 2026

HRM System

Multi-tenant Human Resource Management platform with biometric device integration

SaaSEnterpriseNext.jsNestJSReact NativePostgreSQLTauriIoT
HRM System — screenshot 1
HRM System — screenshot 2
HRM System — screenshot 3
HRM System — screenshot 4
HRM System — screenshot 5
HRM System — screenshot 6
HRM System — screenshot 7
Client

Internal Product

Role

Lead System Architect & Full-stack Developer

Duration

1.5 Month

Year

2026

Overview

<p data-path-to-node="2">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 <b data-path-to-node="2" data-index-in-node="199">sub-100ms API response times across 200+ endpoints</b> while handling complex enterprise workflows.</p><h3 data-path-to-node="4"><b data-path-to-node="4" data-index-in-node="0">Key Architectural Features</b></h3><ul data-path-to-node="5"><li><p data-path-to-node="5,0,0"><b data-path-to-node="5,0,0" data-index-in-node="0">High-Performance Backend:</b> Powered by <b data-path-to-node="5,0,0" data-index-in-node="37">NestJS 11</b> with 43 robust RESTful API modules.</p></li><li><p data-path-to-node="5,1,0"><b data-path-to-node="5,1,0" data-index-in-node="0">Modern Frontend &amp; Desktop:</b> Features a <b data-path-to-node="5,1,0" data-index-in-node="38">Next.js 16</b> glassmorphic admin dashboard built with <b data-path-to-node="5,1,0" data-index-in-node="89">React Server Components</b>, alongside a <b data-path-to-node="5,1,0" data-index-in-node="126">Tauri 2.x</b> desktop application for native hardware integration.</p></li><li><p data-path-to-node="5,2,0"><b data-path-to-node="5,2,0" data-index-in-node="0">Secure Authentication:</b> Utilizes a self-hosted <b data-path-to-node="5,2,0" data-index-in-node="46">Better Auth</b> service with built-in multi-tenant organization support.</p></li></ul><h3 data-path-to-node="7"><b data-path-to-node="7" data-index-in-node="0">Core Innovations</b></h3><ul data-path-to-node="8"><li><p data-path-to-node="8,0,0"><b data-path-to-node="8,0,0" data-index-in-node="0">Data Isolation:</b> A comprehensive multi-tenant architecture ensuring complete data separation between organizations.</p></li><li><p data-path-to-node="8,1,0"><b data-path-to-node="8,1,0" data-index-in-node="0">Biometric Attendance Pipeline:</b> A real-time data pipeline connecting physical <b data-path-to-node="8,1,0" data-index-in-node="77">ZKTeco devices</b> to the cloud using a native desktop agent.</p></li><li><p data-path-to-node="8,2,0"><b data-path-to-node="8,2,0" data-index-in-node="0">Modular Payroll Engine:</b> An automated processing engine built to support highly complex salary structures and dynamic tax calculations.</p></li></ul>

The Challenge

<p data-path-to-node="2">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.</p><h3 data-path-to-node="4"><b data-path-to-node="4" data-index-in-node="0">Key Problems to Solve</b></h3><ul data-path-to-node="5"><li><p data-path-to-node="5,0,0"><b data-path-to-node="5,0,0" data-index-in-node="0">1. Multi-tenancy at scale</b> Each organization needs completely isolated data, custom configurations, and independent workflows without infrastructure duplication.</p></li><li><p data-path-to-node="5,1,0"><b data-path-to-node="5,1,0" data-index-in-node="0">2. Biometric device integration</b> 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.</p></li><li><p data-path-to-node="5,2,0"><b data-path-to-node="5,2,0" data-index-in-node="0">3. Complex payroll calculations</b> 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.</p></li><li><p data-path-to-node="5,3,0"><b data-path-to-node="5,3,0" data-index-in-node="0">4. Real-time attendance at scale</b> Processing thousands of daily punch records from multiple devices, correlating them with shift schedules, leave records, and holiday calendars in real-time.</p></li><li><p data-path-to-node="5,4,0"><b data-path-to-node="5,4,0" data-index-in-node="0">5. Role-based access with granularity</b> 13 distinct roles (from SuperAdmin to Employee) each requiring different data visibility, action permissions, and UI experiences across 22+ dashboard modules.</p></li><li><p data-path-to-node="5,5,0"><b data-path-to-node="5,5,0" data-index-in-node="0">6. Offline-first device management</b> Desktop agents must continue collecting attendance data even when cloud connectivity is interrupted, then sync seamlessly when reconnected.</p></li></ul>

Architectural Approach

How I engineered the system

01 →

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.

02 →

Developed a high-performance NestJS 11 API with a layered middleware architecture that enforces tenant isolation at every request

03 →

Engineered a complete IoT pipeline for connecting physical biometric devices to the cloud platform

04 →

Built a self-hosted authentication system using Better Auth 1.4 with enterprise-grade features

05 →

Built a comprehensive admin dashboard leveraging the latest React 19 and Next.js 16 patterns

06 →

Designed a comprehensive PostgreSQL schema with 23 schema files covering every HR domain

07 →

Implemented a webhook-based queue system using Upstash QStash for background processing

08 →

Full internationalization support with next-intl 4.7

Outcomes & Results

What it accomplished in production

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.

Technology 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
Previous project

Multi-vendor eCommerce & Auction Platform

Next project

Islamic Digital Companion