This project demonstrating CRUD operations. Spring Boot provides RESTful APIs, while React.js consumes these APIs for a responsive frontend.
- Backend: Spring Boot, Spring Data JPA, Hibernate, MySQL
- Frontend: React.js, Axios, Bootstrap
- Tools: Maven, Postman, Visual Studio Code / IntelliJ IDEA
This project follows a RESTful architecture using Spring Boot. Below are the key annotations used:
| Annotation | Description |
|---|---|
@RestController |
Marks the class as a REST controller (combines @Controller and @ResponseBody). |
@RequestMapping |
Maps HTTP requests to controller classes or methods. |
@GetMapping |
Handles HTTP GET requests β used for fetching data. |
@PostMapping |
Handles HTTP POST requests β used for creating new records. |
@PutMapping |
Handles HTTP PUT requests β used for updating existing data. |
@DeleteMapping |
Handles HTTP DELETE requests β used for deleting records. |
@PathVariable |
Binds URL path parameters (e.g., /products/{id}) to method parameters. |
@RequestBody |
Binds the HTTP request body to a Java object. |
@ResponseStatus |
Defines the HTTP status code for a specific method response. |
@Autowired |
Injects dependencies automatically. |
@Service |
Marks a class as part of the service layer. |
@Repository |
Marks a class as part of the data access layer. |
@Entity |
Defines a JPA entity mapped to a database table. |
- Clone the repository
git clone https://github.com/your-username/springboot-react-rest-crud.git
- Navigate to the backend folder
cd backend- Run the Spring Boot app
mvn spring-boot:run
- Frontend (React)
cd frontend npm install npm start