A Spring Boot application providing a RESTful API for managing employees with CRUD operations.
- Java 11+
- Spring Boot
- Maven
- MySQL
-
Clone the Repository:
git clone https://github.com/eloom13/employee-management-backend.git
-
Navigate to the Project Directory:
cd employee-management-backend
-
Install Dependencies:
mvn install
-
Configure Database Connection: Create a
.env
file with:SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/your_database SPRING_DATASOURCE_USERNAME=your_username SPRING_DATASOURCE_PASSWORD=your_password
-
Configure Application Settings: Update
src/main/resources/application.properties
:spring.application.name=spring-boot-crud-api # MySQL Configuration spring.datasource.url=${SPRING_DATASOURCE_URL} spring.datasource.username=${SPRING_DATASOURCE_USERNAME} spring.datasource.password=${SPRING_DATASOURCE_PASSWORD} # JPA/Hibernate Configuration spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto=update spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
-
Run the Application:
mvn spring-boot:run
- Get All Employees:
GET /employee/all
- Get Employee by ID:
GET /employee/find/{id}
- Add New Employee:
POST /employee/add
- Update Employee:
PUT /employee/update
- Delete Employee:
DELETE /employee/delete/{id}
id
(Long)name
(String)email
(String)jobTitle
(String)phone
(String)imageUrl
(String)employeeCode
(String)
mvn test
MIT License