Welcome to the Employee Management App! This application consists of both a frontend React application and a backend Spring Boot API that together allow users to manage employee data.
The frontend part of the application is built using React. It provides a user-friendly interface for managing employee data.
To get started with the frontend, follow these steps:
-
Clone the Repository:
git clone https://github.com/Rahul-Sahani04/UsersMngApp.git cd employee-app
-
Install Dependencies:
npm install
-
Start the Development Server:
npm start
-
Access the Application:
Open your web browser and go to http://localhost:3000 to use the application.
The frontend allows you to:
- Add a New Employee: Enter the first name and last name of the employee in the input fields and click the "Add User" button.
- Edit an Employee: Click the "Edit" button for the employee you want to edit. Make the necessary changes and click the "Update" button.
- Delete an Employee: Click the "Delete" button for the employee you want to delete. This will remove the employee from the database.
The backend component of the application is built using Spring Boot. It provides RESTful API endpoints for managing employee data.
Before setting up the backend, ensure that you have the following dependencies:
- Java Development Kit (JDK)
- PostgreSQL Database
To set up the backend, follow these steps:
-
Create a Spring Boot Project: Create a new Spring Boot project using Spring Initializr with the required dependencies: Spring Web, Spring Data JPA, PostgreSQL, and Lombok.
-
Add Dependencies: Add the provided code snippets to your
pom.xml
file to include the required dependencies. -
Implement Classes: Implement the provided classes
BackendUserApiApplication.java
andUserController.java
in the appropriate packages as mentioned in the provided code. -
Configure Database: Configure the PostgreSQL database connection properties in the
application.properties
file. -
Run the Application: Run the Spring Boot application. The backend will start on a specified port (usually 8080).
The backend provides the following API endpoints:
- GET /api/v1/user: Retrieve a list of all employees.
- POST /api/v1/user: Create a new employee.
- GET /api/v1/user/{id}: Retrieve details of a specific employee by ID.
- PUT /api/v1/user/{id}: Update details of a specific employee by ID.
- DELETE /api/v1/user/{id}: Delete a specific employee by ID.
Congratulations! You now have a complete Employee Management App that seamlessly integrates both frontend and backend components. This app can serve as a strong foundation for more complex applications that require efficient employee data management.
Feel free to explore and extend the functionality of both the frontend and backend components to cater to your specific requirements.