Skip to content

Repository files navigation

Employee Management System - Team Project

🎉 PROJECT STATUS: COMPLETE & READY FOR SUBMISSION

Submission Date: November 11, 2025 ✅ All 5 Programming Tasks: ✅ COMPLETED Professional GUI Interface: ✅ ENHANCED & PRODUCTION-READY Database Integration: ✅ FULLY OPERATIONAL Testing Suite: ✅ COMPREHENSIVE VALIDATION Demo Video Ready: ✅ PROFESSIONAL INTERFACE Team Contributions: ✅ VERIFIED & ATTRIBUTED

Project Overview

A comprehensive employee management system for Company 'Z' built with Java and MySQL. The system provides secure, role-based access for HR administrators and general employees to manage employee data, payroll, and generate reports.

🚀 Latest Updates (November 9, 2025)

GUI Enhancement Complete 🖥️

  • ✅ Professional Console UI - Complete rewrite with 688 lines of enhanced code
  • ✅ Role-Based Navigation - HR Admin vs Employee dashboards
  • ✅ Advanced Menu System - 15+ navigation options with submenus
  • ✅ Professional Data Display - Formatted tables, employee details, SSN masking
  • ✅ Input Validation & UX - Error handling, confirmation dialogs, visual feedback
  • ✅ Demo Video Ready - Production-quality interface for presentation

Previous Completions (November 6, 2025)

  • ✅ Complete PayrollDAO Implementation - All report generation methods
  • ✅ Enhanced ValidationUtils - Comprehensive input validation
  • ✅ Standalone System Testing - Core functionality verification
  • ✅ Database Integration Verified - MySQL Workbench with real data
  • ✅ Security Enhancements - Password hashing, input sanitization
  • ✅ Business Logic Completion - All calculations and validations
  • ✅ Final Testing Suite - 100% task completion verification

👥 Team Contributors

Programming Tasks Implementation

  • Danny Nguyen: Project lead, database design, Task 1 (User Authentication), Task 2 (Employee Search)
  • Huy Vo: Task 3 (Employee CRUD Operations), Task 4 (Salary Update by Percentage)
  • Prakash Rizal: Task 5 (Report Generation System)

Individual Contributions

  • Danny Nguyen: UML diagrams, database schema design, project architecture
  • Team Collaboration: Code integration, testing, and final submission preparation

🗂️ Project Structure


Employee-Management-System-TeamProject/

├── README.md                          # This file
├── test-gui.sh                        # GUI testing script
├── GUI-ENHANCEMENT-SUMMARY.md         # Detailed GUI documentation
├── database/                          # Database scripts and schema
│   ├── employeeData_MySQL_create.sql  # Original database schema
│   ├── enhanced_schema.sql            # Enhanced schema with additional tables

│   ├── sample_data.sql               # Sample data for testing

│   ├── database_setup.sql            # Database setup and security

│   └── mysql-workbench-setup.md      # MySQL Workbench specific instructions

├── src/                              # Java source code

│   ├── main/java/com/employeemgmt/

│   │   ├── Main.java                 # Application entry point

│   │   ├── models/                   # Data models (Employee, Address, Payroll, User)

│   │   ├── dao/                      # Data Access Objects

│   │   ├── services/                 # Business logic layer

│   │   ├── controllers/              # Controller layer
│   │   ├── ui/                       # 🖥️ ENHANCED USER INTERFACE
│   │   │   ├── ConsoleUI.java        # ✅ Professional Console UI (688 lines)
│   │   │   └── JavaFXUI.java         # Template for future GUI expansion
│   │   └── utils/                    # Utility classes (Validation, Security)

│   └── test/java/                 # ✅ COMPREHENSIVE TESTING
│       ├── FinalAllTasksTest.java        # ✅ Main comprehensive test (All 5 Tasks)
│       ├── AuthenticationSystemTest.java # ✅ Task 1: User Authentication
│       ├── EmployeeSearchTest.java       # ✅ Task 2: Employee Search
│       ├── EmployeeCRUDTest.java         # ✅ Task 3: Employee CRUD
│       ├── SalaryUpdateTest.java         # ✅ Task 4: Salary Updates
│       ├── ReportGenerationTest.java     # ✅ Task 5: Report Generation
│       ├── StandaloneSystemTest.java     # ✅ Core functionality verification
│       ├── AllTasksTest.java             # ✅ Sequential test runner
│       ├── DatabaseConnectionTest.java   # ✅ Database connectivity
│       └── README.md                     # ✅ Test documentation

├── uml-diagrams/                     # UML diagrams and documentation

│   ├── Danny's_Schema_Diagram.png    # ✅ COMPLETED - Database schema

│   ├── UML_Use_Case.png             # ✅ COMPLETED - Use case diagram  

│   └── UML_Sequence_Diagram.png  # ✅ Employee search sequence
│
├── documentation/                # Project documentation
└── deliverables/                # Assignment deliverables
    ├── individual/              # Individual assignments
    └── group/                   # Group assignments

📊 Task Implementation Details

Task Implementer Status Database Connected Testing Status
Task 1: User Authentication Danny Nguyen ✅ Complete ✅ Yes ✅ VERIFIED
Task 2: Employee Search Danny Nguyen ✅ Complete ✅ Yes ✅ VERIFIED
Task 3: Employee CRUD Huy Vo ✅ Complete ✅ Yes ✅ VERIFIED
Task 4: Salary Updates Huy Vo ✅ Complete ✅ Yes ✅ VERIFIED
Task 5: Report Generation Prakash Rizal ✅ Complete ✅ Yes ✅ VERIFIED

🎯 Final Verification Results

  • Compilation: ✅ Zero errors, clean build
  • Standalone Tests: ✅ 6/6 core functionality tests passed
  • Integration Tests: ✅ All 5 tasks verified and ready
  • Database Operations: ✅ 12 tables with real employee data
  • Security Features: ✅ Authentication, authorization, validation
  • Business Logic: ✅ All calculations and constraints working

📅 Project Timeline & Deadlines

⚠️ CRITICAL DEADLINES

| Date | Type | Points | Assignment | Status |

|------|------|--------|------------|--------|

| 11/02/2025 11:59PM | Individual | 150pts | UML Use Case + Sequence + DB Schema | ✅ COMPLETED |

| 11/11/2025 11:59PM | Group | 160pts | Programming Tasks + Test Cases | ✅ READY FOR SUBMISSION |

| 11/16/2025 11:59PM | Individual | 110pts | Sequence Diagrams (Salary + Add Employee) | ✅ COMPLETED |

| 12/08/2025 11:59PM | Group | 150pts | Software Design Document (SDD) | ❌ |

| 12/11/2025 11:59PM | Group | 250pts | Final Demo Video + Code | ❌ |

🎯 Key Features

User Roles

-HR Admin: Full CRUD access to all employee data

-General Employee: Read-only access to personal data

Core Functionality

  • ✅ Secure user authentication and authorization (BCrypt hashing, session management)
  • ✅ Employee search (name, DOB, SSN, empid with role-based access)
  • ✅ Employee data management (Full CRUD operations with validation)
  • ✅ Salary updates by percentage for salary ranges with business rules
  • ✅ Comprehensive reporting system (4 different reports with filtering)
  • ✅ Pay statement history tracking (sorted by most recent)
  • ✅ Input validation and sanitization (XSS prevention, SQL injection protection)
  • ✅ Business rule enforcement (age, salary, date constraints)
  • ✅ 3-layer architecture (Models, DAOs, Services with clean separation)

Reports Available (Deliverable #6 Requirements)

  • a. General Employee: Personal pay statement history (sorted by most recent pay date)
  • b. HR Admin: Total pay by job title (monthly summaries)
  • c. HR Admin: Total pay by division (monthly summaries)
  • d. HR Admin: Employees hired within date range (with job title and division info)

All reports implement proper role-based access control and data filtering.

🛠️ Technology Stack

  • Language: Java (JDK 11+)
  • Database: MySQL 8.0+ with MySQL Workbench
  • UI Options: Console/Terminal or JavaFX/Swing (Deliverable #3)
  • Database Connectivity: JDBC with connection pooling
  • Testing: Comprehensive test suite (6 test classes)
  • Security: BCrypt password hashing, role-based access, input sanitization
  • Architecture: 3-layer design (Models, DAOs, Services)
  • Validation: Comprehensive input validation and business rules
  • Build System: Manual compilation with lib dependencies

🚀 Getting Started with MySQL Workbench

Prerequisites

  • Java JDK 11 or higher
  • MySQL Server 8.0+

-MySQL Workbench (latest version)

  • MySQL Connector/J (JDBC driver)
  • IDE (IntelliJ IDEA, Eclipse, or VS Code)

Database Setup with MySQL Workbench

1.Open MySQL Workbench and connect to your MySQL server

2.Create Database:

CREATEDATABASEIFNOTEXISTS employeeData;

USE employeeData;

3.Run Scripts in Order:

-database/employeeData_MySQL_create.sql

-database/enhanced_schema.sql

-database/sample_data.sql

4.Set Up Users (see database/mysql-workbench-setup.md for details)

Generate Schema Diagram in MySQL Workbench

1.Database → Reverse Engineer

  1. Select employeeData database
  2. Choose all tables
  3. Export as PNG for your deliverables

Configuration

  • Update resources/database.properties with MySQL Workbench connection settings
  • Configure HR Admin and General Employee database users

🧪 How to Run Tests

🎯 TL;DR - Quick Start:

cd .../EMS

# Compile all Java files
javac -cp "lib/*" -d build/classes $(find src -name "*.java")

# Copy resources
cp -r src/main/resources/* build/classes/

# Run comprehensive test (All 5 Tasks)
java -cp "build/classes:lib/*" FinalAllTasksTest

# Run standalone core functionality test
java -cp "build/classes:lib/*" StandaloneSystemTest

Expected Result: All 5 tasks marked as READY with "🚀 FINAL STATUS: READY FOR NOVEMBER 11, 2025 SUBMISSION!"

Prerequisites for Testing

  • Java JDK 11 or higher installed
  • MySQL server running with sample data loaded
  • Environment variables configured in .env file
  • All dependencies in lib/ directory

Quick Test (Recommended)

Run the complete system validation test:

# Navigate to project directory
cd .../EMS

# Compile all test files
javac -cp "lib/*:src/main/java:src/test/java:resources" src/test/java/*.java

# Run complete system test (All 5 Tasks)
java -cp "lib/*:src/main/java:src/test/java:resources" FinalAllTasksTest

Individual Task Tests

Task 1: User Authentication System

java -cp "lib/*:src/main/java:src/test/java:resources" AuthenticationSystemTest

Tests: Password hashing, validation, login/logout, role-based access

Task 2: Employee Search Functionality

java -cp "lib/*:src/main/java:src/test/java:resources" EmployeeSearchTest

Tests: Search by ID, name, SSN, DOB, advanced search, role-based access

Task 3: Employee CRUD Operations

java -cp "lib/*:src/main/java:src/test/java:resources" EmployeeCRUDTest

Tests: Create, Read, Update, Delete operations, data validation

Task 4: Salary Update by Percentage

java -cp "lib/*:src/main/java:src/test/java:resources" SalaryUpdateTest

Tests: Bulk salary updates, percentage calculations, range validation

Task 5: Report Generation System

java -cp "build/classes:lib/*" ReportGenerationTest

Tests: Payroll model, PayrollDAO operations, report generation, role-based access

Standalone Core Functionality Test

java -cp "build/classes:lib/*" StandaloneSystemTest

Tests: All models, security utils, validation utils, business logic (no database required)

Sequential Test Runner (Tasks 1-4)

java -cp "lib/*:src/main/java:src/test/java:resources" AllTasksTest

Database Connectivity Test

java -cp "lib/*:src/main/java:src/test/java:resources" DatabaseConnectionTest

Expected Test Results

When all tests pass, you should see:

FinalAllTasksTest Results:

  • ✅ All 5 tasks marked as COMPLETE and READY
  • ✅ Database connectivity (10+ employees with real data)
  • ✅ Role-based security working
  • ✅ "🚀 FINAL STATUS: READY FOR NOVEMBER 11, 2025 SUBMISSION!" message

StandaloneSystemTest Results:

  • ✅ 6/6 core functionality tests passed
  • ✅ Employee Model: Age/salary calculations working
  • ✅ User Model: Authentication and roles functional
  • ✅ Payroll Model: Tax calculations correct
  • ✅ Security Utils: Password hashing and validation
  • ✅ Validation Utils: Input validation working
  • ✅ Business Logic: All constraints and rules enforced

Test Files Location

All test files are located in: src/test/java/

  • FinalAllTasksTest.java - Main comprehensive test (All 5 Tasks)
  • StandaloneSystemTest.java - Core functionality verification
  • AuthenticationSystemTest.java - Task 1: User Authentication
  • EmployeeSearchTest.java - Task 2: Employee Search
  • EmployeeCRUDTest.java - Task 3: Employee CRUD
  • SalaryUpdateTest.java - Task 4: Salary Updates
  • ReportGenerationTest.java - Task 5: Report Generation
  • AllTasksTest.java - Sequential test runner
  • DatabaseConnectionTest.java - Database connectivity
  • README.md - Test documentation

Troubleshooting

If tests fail:

  1. Database Connection: Ensure MySQL server is running and .env file is configured
  2. Sample Data: Run database/sample_data.sql to populate test data
  3. Dependencies: Verify MySQL JDBC driver is in lib/ directory
  4. Compilation: Check that all Java files compile without errors

Required Test Cases (All Implemented & Verified)

  • ✅ Test a) Update employee data functionality - EmployeeCRUDTest.java
  • ✅ Test b) Search for employee (admin user) - EmployeeSearchTest.java
  • ✅ Test c) Update salary for employees below threshold - SalaryUpdateTest.java

Additional Test Coverage:

  • ✅ Authentication System - Login/logout, password validation
  • ✅ Report Generation - All 4 required reports with role-based access
  • ✅ Security Features - Input validation, SQL injection prevention
  • ✅ Business Logic - Age, salary, date constraints
  • ✅ Database Operations - CRUD operations across all tables

🧪 Testing Strategy

Test Categories

1.Unit Tests - Individual component testing

2.Integration Tests - Database connectivity and service layer

3.Security Tests - Authentication and authorization

4.Performance Tests - Large dataset handling

🔒 Security Features

  • Authentication: BCrypt password hashing with salt
  • Authorization: Role-based access control (HR Admin vs Employee)
  • Session Management: 30-minute timeout with validation
  • Account Security: Lockout after 3 failed login attempts (15-minute lockout)
  • Input Validation: SQL injection prevention with parameterized queries
  • Data Sanitization: XSS prevention with input cleaning
  • Password Policy: Strength validation (8+ chars, uppercase, lowercase, digit, special)
  • Audit Logging: Security event tracking for login/logout/failures
  • Database Security: Role-based database connections (admin vs employee)

🧪 Comprehensive Testing Strategy

Test Coverage

  1. Unit Tests - Individual model and utility testing
  2. Integration Tests - Database connectivity and DAO operations
  3. Security Tests - Authentication, authorization, input validation
  4. Business Logic Tests - Calculations, constraints, and rules
  5. Standalone Tests - Core functionality without database dependencies
  6. End-to-End Tests - Complete workflow validation

Validation Results

  • ✅ 100% Task Completion - All 5 programming tasks implemented
  • ✅ Zero Compilation Errors - Clean build with no warnings
  • ✅ Database Integration - 12 tables with normalized schema
  • ✅ Real Data Testing - 10+ employees with complete profiles
  • ✅ Security Verification - All authentication and authorization working
  • ✅ Business Rules - All constraints and calculations validated

📊 Database Schema

Original Tables

-employees - Core employee information

-payroll - Payroll and deduction data

-job_titles - Job title definitions

-employee_job_titles - Employee-job title relationships

-division - Company divisions

-employee_division - Employee-division relationships

Enhanced Tables (From Your Schema Diagram)

  • address - Employee addresses with city/state normalization
  • city - City lookup table
  • state - State lookup table (50 states)
  • user_account - User authentication with password hashing
  • pay_statement - Pay statement records with tax breakdowns
  • role - User roles (ADMIN, EMPLOYEE)

🏗️ Architecture Implementation

Models Layer:

  • Employee.java - Complete business logic with age/salary calculations
  • User.java - Authentication with session management
  • Payroll.java - Comprehensive tax and deduction calculations

DAO Layer:

  • EmployeeDAO.java - Full CRUD with advanced search capabilities
  • UserDAO.java - Authentication and authorization operations
  • PayrollDAO.java - Report generation and pay statement management
  • DatabaseConnection.java - Connection pooling and role-based access

Services Layer:

  • AuthenticationService.java - Login/logout with security features
  • EmployeeService.java - Business logic with role-based access control
  • ReportService.java - Report generation with filtering

Utils Layer:

  • SecurityUtils.java - Password hashing, input sanitization
  • ValidationUtils.java - Comprehensive input validation
  • EnvLoader.java - Environment variable management

📞 Support & Resources

Tools Being Used

  • UML Diagrams: Lucidchart, Draw.io, or hand-drawn (neat)
  • Database: MySQL Workbench for schema management and development
  • IDE: IntelliJ IDEA or Eclipse
  • Version Control: Git (recommended for team collaboration)

🖥️ Enhanced Console User Interface

Professional GUI Features

Our Employee Management System now features a production-quality Console UI that provides an intuitive, secure, and professional user experience.

🔐 Login System

============================================================
           EMPLOYEE MANAGEMENT SYSTEM
                  Version 1.0
============================================================

----------------------------------------
              LOGIN REQUIRED
----------------------------------------

Username: [input with validation]
Password: [secure input]

Features:

  • ✅ Input validation with clear error messages
  • ✅ 3-attempt login limit with lockout protection
  • ✅ Real database authentication integration
  • ✅ Professional formatting and branding

🎛️ Role-Based Dashboards

HR Administrator Dashboard:

  • Employee Management: Search, View, Add, Update employees
  • Salary Management: Range updates, individual adjustments, analysis
  • Reports: Pay statements, job title reports, division reports, hire date reports
  • System Administration: User management and system settings

Employee Dashboard:

  • My Profile: View personal information and employment details
  • Pay History: Access personal pay statement history
  • Contact Updates: Update personal contact information
  • Secure Access: Role-restricted functionality

📊 Professional Data Display

Employee List Format:

----------------------------------------
Search Results
----------------------------------------
ID    Name                 Email                          Hire Date    Salary
-------------------------------------------------------------------------------------
1001  John Smith           john.smith@company.com         01/15/2020   $65,000.00
1002  Jane Doe             jane.doe@company.com           03/22/2021   $72,500.00
-------------------------------------------------------------------------------------
Total: 2 employee(s)

Employee Details:

  • Complete profile information display
  • SSN masking for security (*--1234)
  • Calculated fields (age, years of service)
  • Professional formatting with proper alignment

🛡️ Security & Validation Features

  • ✅ Input Validation: Number ranges, required fields, format checking
  • ✅ Data Protection: SSN masking, role-based access control
  • ✅ Error Handling: Graceful failure management with retry options
  • ✅ Session Management: Secure login/logout functionality
  • ✅ Confirmation Dialogs: Destructive action protection

🎨 Enhanced User Experience

  • ✅ Visual Feedback: ✓ SUCCESS, ✗ ERROR, ℹ INFO messages with Unicode symbols
  • ✅ Navigation: Intuitive menu system with breadcrumb-style navigation
  • ✅ Professional Layout: Headers, separators, centered text, proper spacing
  • ✅ Interactive Elements: "Press Enter to continue" prompts, clear screen transitions

🚀 How to Run the Enhanced GUI

Quick Start:

cd /Users/dnguyen0324/EMS
./test-gui.sh

Manual Start:

# Compile the application
javac -cp "lib/*" -d build/classes $(find src -name "*.java")

# Run the enhanced Console UI
java -cp "build/classes:lib/*" com.employeemgmt.Main

Test Credentials:

  • HR Administrator: admin / admin123
  • General Employee: employee / emp123

Demo Features to Test:

  1. Login Validation - Try incorrect credentials, empty fields
  2. Role-Based Menus - Compare HR Admin vs Employee access
  3. Employee Search - Search by ID, name with formatted results
  4. Data Display - View professional tables and employee details
  5. Salary Management - Navigate salary update interfaces
  6. Reports Menu - Explore comprehensive reporting options
  7. Security Features - Test logout, role restrictions, data masking

📹 Demo Video Ready

The enhanced GUI provides a professional interface perfect for demo video recording:

  • ✅ Clean Visual Design - Professional headers, formatting, and layout
  • ✅ Complete Functionality - All 5 programming tasks accessible and demonstrable
  • ✅ Role-Based Security - Clear distinction between admin and employee access
  • ✅ Real Database Integration - Live data operations and authentication
  • ✅ Error Handling - Graceful failure management and user feedback
  • ✅ Production Quality - Ready for professional presentation

🎯 Final Submission Checklist

✅ Programming Tasks (160 points)

  • ✅ Task 1: User Authentication System - Danny Nguyen
  • ✅ Task 2: Employee Search Functionality - Danny Nguyen
  • ✅ Task 3: Employee CRUD Operations - Huy Vo
  • ✅ Task 4: Salary Update by Percentage - Huy Vo
  • ✅ Task 5: Report Generation System - Prakash Rizal

✅ Technical Requirements

  • ✅ Database Integration - MySQL with 12 normalized tables
  • ✅ Role-Based Security - Admin vs Employee access control
  • ✅ Input Validation - Comprehensive data validation
  • ✅ Error Handling - Robust exception management
  • ✅ Testing Suite - Complete validation framework
  • ✅ Documentation - Comprehensive README and code comments

✅ Deliverable #3 Ready

  • ✅ Professional Console UI - Enhanced 688-line implementation with role-based navigation
  • ✅ Complete UX Interface - Production-quality user experience with validation and formatting
  • ✅ All Java Code - Pure Java implementation, no micro-frameworks used
  • ✅ MySQL Integration - Full database connectivity with real authentication
  • ✅ Demo Video Ready - Professional interface suitable for presentation

✅ Deliverable #6 Ready

  • ✅ Report a: Pay statement history for employees
  • ✅ Report b: Total pay by job title (HR Admin)
  • ✅ Report c: Total pay by division (HR Admin)
  • ✅ Report d: Employees hired in date range

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages