This is a full-stack web application for managing employees, built using Spring Boot and React Hooks. It covers basic CRUD operations (Create, Read, Update, Delete) and integrates MySQL as the database. The backend REST API is tested using Postman, and the frontend handles the API using Axios.
- Features
- Technologies Used
- Prerequisites
- Installation
- Backend Setup
- Frontend Setup
- Usage
- Feedback and Support
- Add new employees
- View a list of all employees
- View employee by id
- Update employee details
- Delete employees
- Spring Boot
- MySQL
- JPA (Java Persistence API)
- RESTful Web Services
- React
- React Hooks
- Axios
- Bootstrap
- Java 8 or higher
- Node.js and npm
- MySQL
- Git
-
Clone the backend repository:
git clone https://github.com/Rizz-33/java-crud-api cd java-crud-api
-
Configure MySQL database:
Update src/main/resources/application.properties with your MySQL database credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/your_database_name
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
- Build and run the Spring Boot application:
./mvnw spring-boot:run
-
Clone the backend repository:
git clone https://github.com/Rizz-33/employee-management-system cd employee-management-system
-
Install the dependencies:
npm install
- Start the React application:
npm start
-
Open Postman.
-
Use the following endpoints to test the CRUD operations:
- Create an employee: POST
http://localhost:8081/user
- Get all employees: GET
http://localhost:8081/users
- Get an employee by ID: GET
http://localhost:8081/user/{id}
- Update an employee: PUT
http://localhost:8081/user/{id}
- Delete an employee: DELETE
http://localhost:8081/user/{id}
- Open your web browser and go to
http://localhost:3000
. - Use the UI to perform CRUD operations on employees.
If you have any feedback, questions, or need support with EMS, please feel free to open an issue on this repository. Your feedback is invaluable and help me to improve the app for everyone.