How mittrayash/hpcs-hr-panel works
Project Type and Purpose
• Type: Full-stack, monolithic web application
• Purpose: An HR management portal for employee attendance, profile management, checklists, payroll, etc., built on PHP/AJAX/MySQL with a rich HTML/CSS/JS frontend
File Structure
• Top-level directories:
– html/ : Static HTML page templates (header, footer, form pages)
– php/ : Server-side scripts (authentication, CRUD endpoints, AJAX handlers)
– includes/ : Shared code (config.inc.php, function libraries, validation)
– css/, js/, fonts/, images/, uploads/ : Static assets served to the browser
• Database schema files: hpcs_admin.sql
• Build/deploy: No containerization—runs on a LAMP stack (Apache + PHP)
• Special features: AJAX-driven autosuggest and data tables; MSQL Events for automated checklist updates; email subsystem (php/autoMail.php)
Extract Insights from README
• Frontend tech: HTML5, CSS3 (Bootstrap), JavaScript, jQuery
• Backend tech: PHP 5.x/7.x, AJAX, MySQL
• Runtime: Apache or any PHP-capable web server; cookies and sessions for auth; MD5 hashing for passwords
• Modules described: Login, Dashboard, Employee Add/View/Update, Attendance, Checklist, Payroll
Main Components and Their Relationships
a. User (Browser)
– UI pages under html/, css/, js/
– Sends HTTP(S) requests (GET/POST) and AJAX calls via jQuery
b. Web Server & Application Layer
– Apache/Nginx serving static assets and routing requests to PHP
– includes/config.inc.php loads DB credentials and global settings
– includes/function.inc.php holds business-logic functions (e.g., addEmployee(), getAttendance())
– php/*.php scripts implement each feature: login.php, AddEmp2.php, attendance2.php, etc.
– Session & Cookie manager for authentication
– Email service (autoMail.php) using SMTP or PHP mail() for notifications
c. Database Layer
– MySQL database hpcs_admin
– Tables: login, employees, attendance, checklist, payroll, etc.
– MSQL Event Scheduler for checklist status updates
d. File Storage
– uploads/ for employee photos or attachments
Interaction Flow (high level):
1. Browser → Web Server: HTTP GET/POST (login, form submissions)
2. Web Server → PHP scripts: request handling, session validation
3. PHP → MySQL: CRUD queries via config.inc.php connection
4. MySQL → PHP: result sets (JSON for AJAX, HTML for full page)
5. PHP → Browser: HTML/CSS/JS or JSON data
6. PHP → File System: save uploaded images, logs
7. PHP → SMTP/email: send autoMail notifications
Architectural Patterns and Design Principles
• Three-Tier Architecture: Presentation (Client), Application (PHP), Data (MySQL)
• Modularization:
– “includes” folder for shared logic (DRY principle)
– Separate scripts per feature in php/ (single-responsibility)
• AJAX pattern for partial updates (autosuggest, data tables)
• Event-driven tasks in DB (MSQL Events for checklist automation)