Project: Employee Management CRUD System Date: July 27, 2025 Author: [Your Name]
1. Purpose & Background
The Employee Management CRUD System aims to provide a simple web-based interface and REST API to manage employee records efficiently. It fulfills the need to maintain essential employee data such as ID, name, department, and salary with complete create, read, update, and delete functionalities.
This product will be used internally by HR staff and managers to maintain an up-to-date employee database with easy access to employee details.
2. Objectives & Goals
Enable users to list all employees in a readable tabular format.
Allow users to add new employees with required fields (name, department, salary).
Support editing employee details with a pre-filled form.
Provide a read-only detailed view of individual employees.
Allow deletion of employees with user confirmation.
REST API endpoints should support all CRUD operations for integration or future enhancements.
The UI should be intuitive with responsive, clear action buttons (View, Edit, Delete).
3. Stakeholders
Stakeholder
Role
Responsibility
Product Manager
Oversees requirements & scope
Define features and priorities
Frontend Developer
Implements HTML + Axios views
Build UI pages and integrate API calls
Backend Developer
Develops REST API
Implement API endpoints for employee data
QA Tester
Quality assurance
Test functionality and user experience
HR Users
End users
Use product to manage employee records
4. User Stories
As an HR user, I want to see all employees listed, so that I can find and review employee info quickly.
As an HR user, I want to add a new employee, so that I can keep records of newly hired staff.
As an HR user, I want to edit employee details, so that I can update information if there are changes.
As an HR user, I want to delete an employee, so that I can remove records of former employees.
As an HR user, I want to view detailed employee information, so I can get a focused read-only snapshot of an individual’s record.
5. Functional Requirements
ID
Requirement Description
Priority
Notes
FR-01
The system shall display a list of employees with fields: ID, Name, Department, Salary.
High
See listing.html
FR-02
The system shall allow adding a new employee with Name, Department, Salary.
High
add.html form submission using Axios
FR-03
The system shall allow editing existing employee details via a pre-filled form.
High
edit.html with PUT API call
FR-04
The system shall allow deletion of an employee with a confirmation popup.
The system shall provide a read-only details page to view employee records individually.
Medium
details.html showing employee details
FR-06
The system shall expose the following REST API endpoints: GET /employees, GET /employees/{id}, POST /employees, PUT /employees/{id}, DELETE /employees/{id}.
High
Backend API support required
6. Non-functional Requirements
Requirement Description
Notes
The system should be responsive and load employee data quickly.
Performance: API responses under 2 seconds
Data should be validated on client and server-side.
Name and Department non-empty, Salary positive number
System should handle concurrency safely (no data conflicts).
Backend-managed
Security: API endpoints to be secured with authentication (future scope).
Currently internal use
7. User Interface / UX
Tables with borders and clear labeling for readability.
Action buttons for View, Edit, Delete placed on each row.
Modals or confirm popups for delete actions to prevent accidental deletions.
Forms for Add and Edit with required field validation.
Navigation links to switch between listing, add, edit, and details pages.
8. API Specification
Method
Endpoint
Description
Request Body
Response
GET
/api/employees
Retrieve list of all employees
None
Array of employee objects
GET
/api/employees/{id}
Retrieve one employee by ID
None
Employee object
POST
/api/employees
Create a new employee
JSON with name, department, salary
Created employee object
PUT
/api/employees/{id}
Update employee by ID
JSON with fields to update
Updated employee object
DELETE
/api/employees/{id}
Delete employee by ID
None
Success status
9. Success Metrics
100% of employee records can be created, viewed, updated, and deleted successfully without errors.
User confirmation for delete reduces unintended deletions by 90%.
UI loads employee listings and details pages within 2 seconds for up to 1000 records.
Positive user feedback from HR team on usability (survey post-release).
10. Timeline & Milestones
Milestone
Target Date
Notes
PRD Approval
[Date]
Finalize product requirements document.
Design & UI Mockups
+1 week
Design review for all pages.
Backend API Development
+3 weeks
REST API endpoints complete.
Frontend Development
+4 weeks
Integrate UI with API and build views.
QA Testing
+5 weeks
Functional and usability testing.
Deployment
+6 weeks
Release to production environment.
11. Constraints & Assumptions
Current version targets internal HR users only.
Authentication & authorization to be added later.
Backend API under development or assumed ready to accept calls as described.
UI will be web-based, supported in modern browsers.
12. Appendix
Sample UI HTML files: listing.html, add.html, edit.html, details.html
Axios usage examples for API communication.
API specification document (Swagger/OpenAPI recommended for future).
package com.javatest.demo;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
@Entity
@Table(name="users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String name;
private String age;
private String city;
private int quota;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public int getQuota() {
return quota;
}
public void setQuota(int quota) {
this.quota = quota;
}
// getters and setters
}
UserController.java
package com.javatest.demo;
import java.util.List;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.data.jpa.repository.JpaRepository;
interface UserRepository extends JpaRepository<User, Long> {
// Custom queries can be defined here
}
@RestController
@RequestMapping("users")
public class UserController {
private final UserRepository userRepository;
public UserController(UserRepository userRepository) {
this.userRepository = userRepository;
}
@RequestMapping("")
public String index() {
return "I am from index";
}
@RequestMapping("listing")
public List<User> listing() {
// List<User> users = new ArrayList<>();
return userRepository.findAll();
}
@DeleteMapping("delete/{id}")
public String deleteUser(@PathVariable Long id) {
// Check if the user with the specified ID exists
if (userRepository.existsById(id)) {
userRepository.deleteById(id);
return String.format("User %s is deleted successfully", id);
} else {
// Handle the case when the user does not exist (e.g., return an error response)
// You can throw an exception or return an appropriate response based on your application's requirements.
}
return "";
}
@PostMapping("create")
public User createUser(@RequestBody User user) {
return userRepository.save(user);
}
@GetMapping("get-single/{id}")
public User getUserById(@PathVariable Long id) {
// Use the UserRepository to fetch the user by ID
return userRepository.findById(id).orElse(null);
}
@PutMapping("/update/{id}")
public User updateUser(@PathVariable Long id, @RequestBody User updatedUser) {
// Check if the user with the specified ID exists
userRepository.findById(id).orElse(null);
// Set the ID of the updated user to the specified ID
updatedUser.setId(id);
// Save the updated user to the database
return userRepository.save(updatedUser);
}
}
DemoApplication.java (Run this file to serve spring boot application)
package com.javatest.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}
Classes and Objects
1. Create class Rectangle
a) data members
– length
– breadth
b) methods
– setDimensions
– area
– perimeter
2. Create class Cube
a) data members
– length
– breadth
– height
b) methods
– setDimensions
– volume
3. Create class Worker
a) data members
– wages
– wdays
b) methods
– setData
– payment
Method Overloading
1. Create class Box
a) data members
– length
– breadth
– height
b) methods
– setDimensions(3 args)
– setDimensions(1 arg)
– volume
Method Returning Value
1. WAP to find total payment of two employeesCreate
Create class Worker
a) data members
– wages
– wdays
b) methods
– setData
– int payment
Constructors
1. Create class Circle and initialize radius using a default constructor
2. Create class Circle and initialize radius using parameterized constructor
3. Create class Circle and define two constructor default and parameterized (Constructor overloading)
Static data members and member functions
1. Create a class Circle and find its area
a) data members
– int radius
– static double pi
b) methods
– area
2. Create a class Bank Account and find interest
a) data members
– int account_number
– int balance
– static double interest_rate
b) methods
– interest (balance * interest_rate * no_of_period / 100.0)
– changeRate (change interest_rate)
Design a class Rectangle data members[box title=”” bg_color=”#dbdbdb” align=”left”]length breadth[/box]member functions/methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension() area() perimeter()[/box]
Design a class Worker data members[box title=”” bg_color=”#dbdbdb” align=”left”]wages wdays[/box]member function / method[box title=”” bg_color=”#dbdbdb” align=”left”]setData() payment()[/box]
Design a class Box data members[box title=”” bg_color=”#dbdbdb” align=”left”]length breadth height[/box]member functions / methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension() volume()[/box]
Design a class Rectangle (only for Java / C++) data members[box title=”” bg_color=”#dbdbdb” align=”left”]length breadth[/box] member functions / methods[box title=”” bg_color=”#dbdbdb” align=”left”]setDimension() area() perimeter()[/box]It must overload setDimension() method twice:
by passing 1 argument
by passing 2 arguments
Design a class Box (only for Java / C++) data members[box title=”” bg_color=”#dbdbdb” align=”left”]length breadth height[/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”]volume()[/box] It must contain 3 constructors
1 parameter
2 parameter
3 paramter
Design a class Account data members [box title=”” bg_color=”#dbdbdb” align=”left”]balance[/box]member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] deposit(amt) withdraw(amt) showBalance()[/box]
Design a class Set data members [box title=”” bg_color=”#dbdbdb” align=”left”]3 numbers[/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] SUM() MEAN() MAX() MIN() [/box]
Design a class Student data members [box title=”” bg_color=”#dbdbdb” align=”left”]roll_number name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] setData() getData() [/box]
Design a class Account data members [box title=”” bg_color=”#dbdbdb” align=”left”] balance interest_rate [/box] interest_rate must be shared by all objects (static modifier) and its default value 10.25 [box title=”” bg_color=”#dbdbdb” align=”left”] interest(no_of_years) [/box]
Design a class Student data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] setData() getData() [/box]
Design a class Account [box title=”” bg_color=”#dbdbdb” align=”left”] account_number balance interest_rate [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] interest(no_of_years) [/box]
Design a class Student data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number name [/box] member function / methods [box title=”” bg_color=”#dbdbdb” align=”left”] getData() [/box] roll_number must be automatically generated.It also keep track of total number of Students.
Design a package MyCircle and MyRectangle (Only for Java) [box title=”” bg_color=”#dbdbdb” align=”left”] radius length breadth [/box] member functions / methods: [box title=”” bg_color=”#dbdbdb” align=”left”] area() circumference() perimeter() [/box]
Design a class Student data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_number name [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] getData() showData() [/box] Create 5 objects of Student using Array
Design a class Student and List ClassRoom add list of Students in ClassRoom display List
Design a class Account and List Bank add list of Account in Bank display List
Create array of Student Objects data members [box title=”” bg_color=”#dbdbdb” align=”left”] roll_no name college [/box] member functions / methods [box title=”” bg_color=”#dbdbdb” align=”left”] readData() showData() [/box]
Create a class RBI (Only for Java) data members [box title=”” bg_color=”#dbdbdb” align=”left”] balance [/box] member functions [box title=”” bg_color=”#dbdbdb” align=”left”] RBI() deposit(int amt) withdraw(int amt) showBalance() [/box]