From : 🔥ReactJS + Spring Boot Full-Stack Course [2025]
-
To create new project
- Open desired folder on VS > Open Terminal > Add
npm create vite@latest ems-react-frontend ⚠️ To Initialize On Another Machinenpm install- app is created run
npm run dev - To add port add in vite.config.js
server:{ port: 3000 }- Dependency are in package.json
- Start Point index.html > main.jsx > App.jsx
- Add BootStrap to React
npm install bootstrap --save - Add
import 'bootstrap/dist/css/bootstrap.min.css'in main.jsx - Add
className="btn btn-info"in WelcomeJs.jsx : (Ref - https://www.w3schools.com/bootstrap/bootstrap_ref_all_classes.asp)
- Open desired folder on VS > Open Terminal > Add
-
Add list to react
- add plugin to VS as -
ES7+ React/Redux/React-Native snippets - Create new Component ListEmployeeComponentDummy.jsx and type
rcfeto auto generate code ORrafceto auto generate arrow function - add this component App.jsx
- add plugin to VS as -
-
Install axios Library - For HTTP call -
npm install axios --save -
Create service EmployeeService.jsx
-
GET CALL : Http call ListEmployeeComponentRest.jsx
-
Add
@CrossOrigin("*")to EmployeeController.java to avoidhas been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -
Added Header.jsx and Footer.jsx
-
Add React-Router-DOM
npm install react-router-dom --save -
POST CALL : AddEmployeeComponent.jsx
-
Add Validation ref : AddEmployeeComponent.jsx