Semi-guided Enterprise-style Spring Boot Exercise - EmployeeVerse — Build a RESTful Directory of Employees #191
akash-coded
started this conversation in
Tasks
Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
0 replies
-
graph TD
%% Client
Client["Client (Browser or Postman)"]
%% Web Layer
Controller["EmployeeController - @RestController"]
%% DTOs
RequestDTO["EmployeeRequestDTO"]
ResponseDTO["EmployeeResponseDTO"]
%% Exception Handling
ExceptionHandler["GlobalExceptionHandler - @ControllerAdvice"]
%% Service Layer
Service["EmployeeServiceImpl - @Service"]
%% Pagination
Pagination["Pagination Utils / Pageable Interface"]
%% Repository Layer
Repository["EmployeeRepository - @Repository"]
%% Model Layer
Model["Employee.java - @Entity"]
%% DB
DB["H2 Database"]
%% Flow
Client -->|"HTTP Request (JSON)"| Controller
Controller -->|"Parses to DTO"| RequestDTO
Controller -->|"Calls Service"| Service
Service -->|"Handles Business Logic"| Pagination
Service --> Repository
Repository --> Model
Repository --> DB
Repository -->|"Returns Entity"| Service
Service --> ResponseDTO
ResponseDTO --> Controller
Controller -->|"JSON Response"| Client
Controller --> ExceptionHandler
ExceptionHandler -->|"Handles Errors"| Client
|
Beta Was this translation helpful? Give feedback.
0 replies
-
**
** |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Designed to help your students internalize:
String,List, JavaBeans)🧩 Exercise Title: EmployeeVerse — Build a RESTful Directory of Employees
🧠 Story Context:
You’ve been hired by a fictional startup called EmployeeVerse. They want an internal app to store, retrieve, and manage employee data using modern Java practices and Spring Boot + H2. Right now, they have just a basic need — create a mini CRUD backend with layered architecture and test via Postman.
But there’s a twist: You’ll discover the app's purpose one feature at a time, and implement it layer by layer.
🗂️ Project Setup
✅ Step 1: Generate the Spring Boot Project from [start.spring.io](https://start.spring.io/)
Project Settings:
Group:
com.employeeverseArtifact:
employeeverseName:
EmployeeVerseJava Version: 17+
Dependencies:
Download and import the project into Eclipse or IntelliJ.
🔧 Step 2: Setup
application.properties🧱 Step 3: Create the Folder Structure
🏗️ Step 4: Create the
EmployeeEntity Class (Model)🧪 Step 5: Create the Repository Interface
🧠 Step 6: Create the Service Layer
A. Interface
B. Implementation
🌐 Step 7: Create the Controller
🎯 Step 8: Challenges and Custom Practice
🧩 Challenge 1: Use
StringUtils.capitalize()or create your own method to format names properly before saving.🧩 Challenge 2: Add a utility class in
util/to validate email addresses using regex.🧩 Challenge 3: Add an endpoint
/api/employees/filter?department=IT(Future task)🧪 Step 9: Test Using Postman
Test these endpoints:
POST /api/employeesGET /api/employeesGET /api/employees/{id}DELETE /api/employees/{id}✅ Validate JSON body, headers, and expected status codes.
🏁 BONUS CHALLENGES
toString()override for meaningful log printsequals()andhashCode()based on IDHere’s the architecture of the EmployeeVerse Spring Boot application in Mermaid diagram syntax:
graph TD subgraph Web Layer A[Controller Layer<br>EmployeeController] end subgraph Business Layer B[Service Layer<br>EmployeeService + Impl] end subgraph Persistence Layer C[Repository Layer<br>EmployeeRepository] end subgraph Data Layer D[Model<br>Employee Entity] E[H2 Database] end A -->|calls| B B -->|calls| C C -->|uses| D C -->|executes queries on| E B -->|returns| D A -->|returns JSON of| D📌 Legend:
Beta Was this translation helpful? Give feedback.
All reactions