← Back to Projects

HR-Nexus: 5-Layer Client-Server HR System

A comprehensive 5-layer client-server HR management system with TCP socket-based communication, Proxy design pattern, JDBC DAO layer, and dual storage backends.

View on GitHub ↗

Overview

HR-Nexus is a full-stack enterprise-grade HR management system built with a rigorous 5-layer architecture. Rather than using a monolithic structure, the system separates every concern into its own module: Presentation, Proxy Business Logic, Business Logic, Data Layer, and Database Layer, with TCP socket-based communication between client and server.

The architecture was designed to demonstrate production-level layering, security patterns, and testability.

Architecture: 5 Layers

┌─────────────────────────────────┐
│  Presentation Layer (Servlet)   │  ← HTTP, JSP, HTML/CSS
├─────────────────────────────────┤
│  Proxy BL Layer (proxybl)       │  ← Intercepts, validates, delegates
├─────────────────────────────────┤
│  Business Logic Layer (bl)      │  ← Core rules, computations
├─────────────────────────────────┤
│  Data Layer (dl / dbdl)         │  ← File-based or DB-backed (Strategy)
├─────────────────────────────────┤
│  Database Layer (MySQL + JDBC)  │  ← Raw data persistence
└─────────────────────────────────┘

Communication: TCP Sockets between client and server modules

Key Technical Contributions

TCP Socket Communication

Instead of direct method calls across modules, the client and server modules communicate over TCP sockets, cleanly separating network transport from business logic. This mirrors how real distributed systems (microservices, client-server apps) communicate.

Proxy Design Pattern (Security & Abstraction Boundary)

Implemented a dedicated proxybl module that sits between the presentation layer and the core business logic. Every client request is intercepted, validated, and sanitized before reaching BL — adding a security and abstraction boundary with zero modifications to the BL code itself.

Reusable JDBC DAO Layer

Designed a shared DAO layer using prepared statements for all 5+ entity types (employees, payroll, attendance, etc.). This eliminated SQL injection risk and reduced duplicate database code by ~40% through shared query abstractions.

Dual Storage Backends (Strategy Pattern)

Built two interchangeable storage implementations, dl (file-based) and dbdl (database-driven), behind a common DataLayer interface. This enabled full BL unit testing without a live database, demonstrating the Strategy design pattern in a practical setting.

Production Deployment

Deployed on Apache Tomcat with server-side session management and input validation across 10+ endpoints. Resolved classloader conflicts and servlet mapping issues through iterative Linux-based debugging.

What I Learned

Stack

Layer Technology
Server Java, Apache Tomcat
Communication TCP Sockets
Database MySQL
ORM / Data Access JDBC, Prepared Statements
Design Patterns Proxy, Strategy, DAO, MVC
Testing File-based data layer for isolation