This is a sample Employee Management System built using Spring MVC, Spring Boot, and Thymeleaf. This application allows you to perform CRUD (Create, Read, Update, Delete) operations on employee records.
- Spring MVC
- Spring Boot
- Spring Data
- Thymeleaf
- Clone the repository:
https://github.com/mohamedehab00/Simple-Employee-Managment-System.git
- Create a MySQL database named
employee_management
:
CREATE DATABASE employee_directory;
- Configure the database connection in the
application.properties
file located in thesrc/main/resources
directory:
spring.datasource.url=jdbc:mysql://localhost:3306/employee_directory
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
- Run the application using Maven:
mvn spring-boot:run
- Access the application by visiting
http://localhost:8080
in your web browser.
To view a list of all employees, click on the "Employees" link in the navigation bar. This will take you to the employee list page, where you can see all the employees in the database.
To add a new employee, click on the "Add Employee" button on the employee list page. This will take you to the add employee form, where you can enter the employee details and submit the form to add the employee to the database.
To update an existing employee, click on the "Edit" button next to the employee on the employee list page. This will take you to the edit employee form, where you can update the employee details and submit the form to save the changes to the database.
To delete an existing employee, click on the "Delete" button next to the employee on the employee list page. This will prompt you to confirm the deletion, and if you confirm, the employee will be deleted from the database.