A Spring Boot-based web application for managing employee data. The system allows you to add, update, delete, and view employees via both HTML views and RESTful APIs. It also includes integrated Swagger documentation for easy API testing.
How the application works:
Check it out in this link - https://drive.google.com/file/d/1EYr4rVNnXKf_7c12iI21RaptLMMkfD_9/view?usp=sharing
- Java 11+
- Spring Boot
- Spring MVC & REST
- Spring Data JPA
- Thymeleaf
- Swagger (OpenAPI)
- Maven
- MongoDB
📁 Project File Structure
EmployeeManagementApplication/
├── EmpAppAPIDoc.json # Swagger/OpenAPI documentation
├── src/
│ └── main/
│ ├── java/
│ │ └── com/example/EmployeeManagementApplication/
│ │ ├── Config/
│ │ │ └── SwaggerConfig.java # Swagger setup
│ │ ├── Controller/
│ │ │ ├── EmployeeController.java # Handles HTML views
│ │ │ └── EmployeeRestController.java # RESTful API controller
│ │ ├── Entity/
│ │ │ └── EmployeeEntity.java # JPA Entity for employee
│ │ ├── Exception/
│ │ │ ├── EmailAlreadyExistsException.java # Custom exception
│ │ │ └── GlobalExceptionHandler.java # Centralized exception handling
│ │ ├── Repository/
│ │ │ └── EmpRepository.java # JPA Repository
│ │ ├── Service/
│ │ │ ├── EmployeeService.java # Service interface
│ │ │ └── EmpService.java # Service implementation
│ │ └── EmployeeManagementApplication.java # Main Spring Boot class
│ └── resources/
│ ├── static/ # Static assets (empty now)
│ └── templates/ # Thymeleaf HTML views
│ ├── addEmployee.html
│ ├── index.html
│ ├── Update.html
│ └── view.html
├── .gitignore
├── pom.xml # Maven configuration git clone https://github.com/sudhir1825/EmployeeManagementApplication.git
cd EmployeeManagementApplication- Build the Project If you have Maven installed:
mvn clean installOr use the Maven Wrapper:
./mvnw clean install # macOS/Linux
mvnw.cmd clean install # Windows- Run the Application
mvn spring-boot:runOr with Maven Wrapper:
./mvnw spring-boot:run # macOS/Linux
mvnw.cmd spring-boot:run # Windows🌐 Access Points
HTML UI: http://localhost:8081/
REST APIs:
GET /api/employees
POST /api/employees
PUT /api/employees/{id}
DELETE /api/employees/{id}Swagger Documentation:
http://localhost:8081/swagger-ui.html🧪 Sample API Payload (POST Employee)
{
"Firstname": "Sudhir",
"Lastname": "Rangasamy",
"email": "sudhir@example.com",
}