Skip to content

Tirth-22/springboot-react-rest-crud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

springboot-react-rest-crud

This project demonstrating CRUD operations. Spring Boot provides RESTful APIs, while React.js consumes these APIs for a responsive frontend.

πŸ› οΈ Tech Stack

  • Backend: Spring Boot, Spring Data JPA, Hibernate, MySQL
  • Frontend: React.js, Axios, Bootstrap
  • Tools: Maven, Postman, Visual Studio Code / IntelliJ IDEA

REST Annotations

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.

πŸš€ How to Run

Backend (Spring Boot)

  1. Clone the repository
    git clone https://github.com/your-username/springboot-react-rest-crud.git
  2. Navigate to the backend folder
  cd backend
  1. Run the Spring Boot app
    mvn spring-boot:run
  2. Frontend (React)
    cd frontend
    npm install
    npm start

About

Spring Boot RESTful API with React.js

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published