A comprehensive full-stack Employee Management System built as a course project for Database Management Systems (DBMS). This application demonstrates practical implementation of database concepts, RESTful APIs, and modern web technologies to manage employee data, departments, projects, and analytics.
- Dashboard Overview: Real-time statistics including total employees, departments, average salary, and active projects
- Employee Management: Complete CRUD operations (Create, Read, Update, Delete) for employee records
- Department & Project Tracking: Manage departments and assign employees to projects
- Interactive Charts: Visual analytics for department distribution and salary analysis using Chart.js
- Search Functionality: Real-time search and filtering of employee data
- Responsive Design: Modern UI built with Tailwind CSS for desktop and mobile compatibility
- RESTful API: Backend API endpoints for seamless data interaction
- Database Analytics: Advanced SQL queries for reporting and insights
- Node.js: JavaScript runtime for server-side development
- Express.js: Web framework for building RESTful APIs
- MySQL2: MySQL database driver for Node.js
- CORS: Cross-Origin Resource Sharing middleware
- HTML5: Markup language for web pages
- Tailwind CSS: Utility-first CSS framework for styling
- Chart.js: JavaScript library for data visualization
- Vanilla JavaScript: Client-side scripting for interactivity
- MySQL: Relational database management system
- SQL: Structured Query Language for database operations
Before running this application, ensure you have the following installed:
- Node.js (version 14 or higher)
- MySQL Server (version 8.0 or higher)
- Git (for cloning the repository)
git clone <repository-url>
cd employee-management-systemnpm install- Start your MySQL server
- Create a new database and run the SQL script:
-- Run the contents of DBMS_PROJECT.sql in your MySQL client -- This will create the database, tables, and insert sample data
- Update database credentials in
server.jsif necessary:const db = mysql.createConnection({ host: 'localhost', user: '****', // Update with your MySQL username password: '*******', // Update with your MySQL password database: 'employee_management' });
node server.jsThe application will be available at:
- Frontend Dashboard: http://localhost:3000/index.html
- API Base URL: http://localhost:3000/api
- Access the Dashboard: Open http://localhost:3000/index.html in your web browser
- View Statistics: The dashboard displays key metrics and charts
- Manage Employees:
- Click "Add Employee" to create new records
- Use the search box to filter employees
- Click "Edit" or "Delete" buttons in the table for modifications
- View Analytics: Charts show department distribution and salary analysis
The system uses the following main tables:
- Department: Stores department information (Dept_ID, Dept_Name, Manager_ID)
- Employee: Contains employee details (Emp_ID, Name, Gender, DOB, Dept_ID, Designation, Salary, Hire_Date)
- Project: Manages project information (Project_ID, Project_Name, Dept_ID, Start_Date, End_Date)
- Assignment: Links employees to projects (Emp_ID, Project_ID, Role)
- Attendance: Tracks employee attendance (Emp_ID, Date, Status)
- Salary_Log: Audit trail for salary changes (created via triggers)
GET /api/dashboard- Retrieve dashboard statistics
GET /api/employees- Get all employeesGET /api/employees/:id- Get specific employee by IDPOST /api/employees- Add new employeePUT /api/employees/:id- Update employee informationDELETE /api/employees/:id- Delete employee
GET /api/departments- Get all departmentsGET /api/departments/stats- Get department statistics
GET /api/projects- Get all projects
GET /api/analytics/salary- Get salary analytics by department
This project showcases various DBMS concepts covered in the course:
- DDL (Data Definition Language): CREATE, ALTER, DROP statements
- DML (Data Manipulation Language): INSERT, UPDATE, DELETE, SELECT statements
- Joins: INNER JOIN, LEFT JOIN for combining data from multiple tables
- Aggregate Functions: COUNT(), AVG(), SUM(), MIN(), MAX()
- GROUP BY & HAVING: Grouping data and filtering groups
- Nested Queries: Subqueries for complex data retrieval
- Views: Virtual tables for simplified data access (Emp_Details view)
- Stored Procedures: Precompiled SQL statements (GetDeptSalary procedure)
- Functions: User-defined functions (GetEmployeeAge function)
- Triggers: Automatic actions on data changes (Salary_Update trigger)
- Cursors: Row-by-row processing (Show_Employees procedure)
- Primary Keys: Unique identifiers for tables
- Foreign Keys: Referential integrity between tables
- AUTO_INCREMENT: Automatic ID generation
- ENUM: Restricted value sets for status fields
This is a course project, but contributions for educational purposes are welcome. Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the ISC License - see the package.json file for details.
Note: This project was developed as part of a Database Management Systems course to demonstrate practical application of SQL concepts and full-stack development principles.