├── FirstSpring ├── .gitignore ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── embarkx │ │ │ └── FirstSpring │ │ │ ├── FirstSpringApplication.java │ │ │ ├── HelloController.java │ │ │ └── HelloResponse.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── embarkx │ └── FirstSpring │ └── FirstSpringApplicationTests.java ├── Java Spring Boot- Professional eCommerce Project Masterclass.postman_collection.json ├── README.md ├── SpringExample ├── .gitignore ├── .idea │ ├── .gitignore │ ├── encodings.xml │ ├── misc.xml │ ├── uiDesigner.xml │ └── vcs.xml ├── pom.xml └── src │ └── main │ ├── java │ ├── car │ │ └── example │ │ │ ├── bean │ │ │ ├── App.java │ │ │ └── MyBean.java │ │ │ ├── constructor │ │ │ └── setter │ │ │ └── injection │ │ │ ├── App.java │ │ │ ├── Car.java │ │ │ └── Specification.java │ └── com │ │ ├── example │ │ ├── autowire │ │ │ ├── constructor │ │ │ ├── name │ │ │ │ ├── App.java │ │ │ │ ├── Car.java │ │ │ │ └── Specification.java │ │ │ └── type │ │ │ │ ├── App.java │ │ │ │ ├── Car.java │ │ │ │ └── Specification.java │ │ ├── autowired │ │ │ └── annotation │ │ │ │ ├── App.java │ │ │ │ ├── AppConfig.java │ │ │ │ ├── Employee.java │ │ │ │ └── Manager.java │ │ └── componentscan │ │ │ ├── App.java │ │ │ ├── Employee.java │ │ │ └── annotation │ │ │ ├── App.java │ │ │ ├── AppConfig.java │ │ │ └── Employee.java │ │ ├── ioc │ │ └── coupling │ │ │ ├── IOCExample.java │ │ │ ├── NewDatabaseProvider.java │ │ │ ├── UserDataProvider.java │ │ │ ├── UserDatabaseProvider.java │ │ │ ├── UserManager.java │ │ │ └── WebServiceDataProvider.java │ │ ├── loose │ │ └── coupling │ │ │ ├── LooseCouplingExample.java │ │ │ ├── NewDatabaseProvider.java │ │ │ ├── UserDataProvider.java │ │ │ ├── UserDatabaseProvider.java │ │ │ ├── UserManager.java │ │ │ └── WebServiceDataProvider.java │ │ └── tight │ │ └── coupling │ │ ├── TightCouplingExample.java │ │ ├── UserDatabase.java │ │ └── UserManager.java │ └── resources │ ├── applicationBeanContext.xml │ ├── applicationConstructorInjection.xml │ ├── applicationIoCLooseCouplingExample.xml │ ├── applicationSetterInjection.xml │ ├── autowireByConstructor.xml │ ├── autowireByName.xml │ ├── autowireByType.xml │ └── componentScanDemo.xml ├── ecom-frontend ├── .gitignore ├── README.md ├── eslint.config.js ├── index.html ├── package-lock.json ├── package.json ├── postcss.config.js ├── public │ └── vite.svg ├── src │ ├── App.css │ ├── App.jsx │ ├── api │ │ └── api.js │ ├── assets │ │ ├── react.svg │ │ └── sliders │ │ │ ├── s_1.webp │ │ │ ├── s_2.webp │ │ │ └── s_3.webp │ ├── components │ │ ├── About.jsx │ │ ├── BackDrop.jsx │ │ ├── Contact.jsx │ │ ├── PrivateRoute.jsx │ │ ├── UserMenu.jsx │ │ ├── auth │ │ │ ├── LogIn.jsx │ │ │ └── Register.jsx │ │ ├── cart │ │ │ ├── Cart.jsx │ │ │ ├── CartEmpty.jsx │ │ │ ├── ItemContent.jsx │ │ │ └── SetQuantity.jsx │ │ ├── checkout │ │ │ ├── AddAddressForm.jsx │ │ │ ├── AddressInfo.jsx │ │ │ ├── AddressInfoModal.jsx │ │ │ ├── AddressList.jsx │ │ │ ├── Checkout.jsx │ │ │ ├── DeleteModal.jsx │ │ │ ├── OrderSummary.jsx │ │ │ ├── PaymentConfirmation.jsx │ │ │ ├── PaymentForm.jsx │ │ │ ├── PaymentMethod.jsx │ │ │ ├── PaypalPayment.jsx │ │ │ └── StripePayment.jsx │ │ ├── home │ │ │ ├── HeroBanner.jsx │ │ │ └── Home.jsx │ │ ├── products │ │ │ ├── Filter.jsx │ │ │ └── Products.jsx │ │ └── shared │ │ │ ├── ErrorPage.jsx │ │ │ ├── InputField.jsx │ │ │ ├── Loader.jsx │ │ │ ├── Navbar.jsx │ │ │ ├── Paginations.jsx │ │ │ ├── ProductCard.jsx │ │ │ ├── ProductViewModal.jsx │ │ │ ├── Skeleton.jsx │ │ │ ├── Spinners.jsx │ │ │ └── Status.jsx │ ├── hooks │ │ └── useProductFilter.js │ ├── index.css │ ├── main.jsx │ ├── store │ │ ├── actions │ │ │ └── index.js │ │ └── reducers │ │ │ ├── ProductReducer.js │ │ │ ├── authReducer.js │ │ │ ├── cartReducer.js │ │ │ ├── errorReducer.js │ │ │ ├── paymentMethodReducer.js │ │ │ └── store.js │ └── utils │ │ ├── constant.js │ │ ├── formatPrice.js │ │ ├── index.js │ │ └── truncateText.js ├── tailwind.config.js └── vite.config.js ├── media ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── social │ │ │ └── media │ │ │ ├── DataInitializer.java │ │ │ ├── MediaApplication.java │ │ │ ├── controllers │ │ │ └── SocialController.java │ │ │ ├── models │ │ │ ├── Post.java │ │ │ ├── SocialGroup.java │ │ │ ├── SocialProfile.java │ │ │ └── SocialUser.java │ │ │ ├── repositories │ │ │ ├── PostRepository.java │ │ │ ├── SocialGroupRepository.java │ │ │ ├── SocialProfileRepository.java │ │ │ └── SocialUserRepository.java │ │ │ └── services │ │ │ └── SocialService.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── com │ └── social │ └── media │ └── MediaApplicationTests.java └── sb-ecom ├── .gitignore ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── images ├── 2aef0eb8-04eb-4f75-a717-773c0bb94a8f.jpg └── 921e13ae-67f4-49d3-9340-4e6f29e1f312.jpg ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── ecommerce │ │ └── project │ │ ├── SbEcomApplication.java │ │ ├── config │ │ ├── AppConfig.java │ │ ├── AppConstants.java │ │ └── WebMvcConfig.java │ │ ├── controller │ │ ├── AddressController.java │ │ ├── AuthController.java │ │ ├── CartController.java │ │ ├── CategoryController.java │ │ ├── OrderController.java │ │ └── ProductController.java │ │ ├── exceptions │ │ ├── APIException.java │ │ ├── MyGlobalExceptionHandler.java │ │ └── ResourceNotFoundException.java │ │ ├── model │ │ ├── Address.java │ │ ├── AppRole.java │ │ ├── Cart.java │ │ ├── CartItem.java │ │ ├── Category.java │ │ ├── Order.java │ │ ├── OrderItem.java │ │ ├── Payment.java │ │ ├── Product.java │ │ ├── Role.java │ │ └── User.java │ │ ├── payload │ │ ├── APIResponse.java │ │ ├── AddressDTO.java │ │ ├── CartDTO.java │ │ ├── CartItemDTO.java │ │ ├── CategoryDTO.java │ │ ├── CategoryResponse.java │ │ ├── OrderDTO.java │ │ ├── OrderItemDTO.java │ │ ├── OrderRequestDTO.java │ │ ├── PaymentDTO.java │ │ ├── ProductDTO.java │ │ ├── ProductResponse.java │ │ └── StripePaymentDto.java │ │ ├── repositories │ │ ├── AddressRepository.java │ │ ├── CartItemRepository.java │ │ ├── CartRepository.java │ │ ├── CategoryRepository.java │ │ ├── OrderItemRepository.java │ │ ├── OrderRepository.java │ │ ├── PaymentRepository.java │ │ ├── ProductRepository.java │ │ ├── RoleRepository.java │ │ └── UserRepository.java │ │ ├── security │ │ ├── WebConfig.java │ │ ├── WebSecurityConfig.java │ │ ├── jwt │ │ │ ├── AuthEntryPointJwt.java │ │ │ ├── AuthTokenFilter.java │ │ │ └── JwtUtils.java │ │ ├── request │ │ │ ├── LoginRequest.java │ │ │ └── SignupRequest.java │ │ ├── response │ │ │ ├── MessageResponse.java │ │ │ └── UserInfoResponse.java │ │ └── services │ │ │ ├── UserDetailsImpl.java │ │ │ └── UserDetailsServiceImpl.java │ │ ├── service │ │ ├── AddressService.java │ │ ├── AddressServiceImpl.java │ │ ├── CartService.java │ │ ├── CartServiceImpl.java │ │ ├── CategoryService.java │ │ ├── CategoryServiceImpl.java │ │ ├── FileService.java │ │ ├── FileServiceImpl.java │ │ ├── OrderService.java │ │ ├── OrderServiceImpl.java │ │ ├── ProductService.java │ │ ├── ProductServiceImpl.java │ │ ├── StripeService.java │ │ └── StripeServiceImpl.java │ │ └── util │ │ └── AuthUtil.java └── resources │ └── application.properties └── test └── java └── com └── ecommerce └── project └── SbEcomApplicationTests.java /FirstSpring/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /FirstSpring/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 3.1.1 9 | 10 | 11 | com.embarkx 12 | FirstSpring 13 | 0.0.1-SNAPSHOT 14 | FirstSpring 15 | First project for Spring Boot 16 | 17 | 17 18 | 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-test 28 | test 29 | 30 | 31 | 32 | 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-maven-plugin 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /FirstSpring/src/main/java/com/embarkx/FirstSpring/FirstSpringApplication.java: -------------------------------------------------------------------------------- 1 | package com.embarkx.FirstSpring; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class FirstSpringApplication { 8 | 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(FirstSpringApplication.class, args); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /FirstSpring/src/main/java/com/embarkx/FirstSpring/HelloController.java: -------------------------------------------------------------------------------- 1 | package com.embarkx.FirstSpring; 2 | 3 | import org.springframework.web.bind.annotation.*; 4 | 5 | @RestController 6 | public class HelloController { 7 | 8 | @GetMapping("/hello/{name}") 9 | public HelloResponse helloParam(@PathVariable String name) { 10 | return new HelloResponse("Hello, " + name); 11 | } 12 | 13 | @GetMapping("/hello") 14 | public HelloResponse hello() { 15 | return new HelloResponse("Hello, World!"); 16 | } 17 | 18 | @PostMapping("/hello") 19 | public HelloResponse helloPost(@RequestBody String name) { 20 | return new HelloResponse("Hello, " + name + "!"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /FirstSpring/src/main/java/com/embarkx/FirstSpring/HelloResponse.java: -------------------------------------------------------------------------------- 1 | package com.embarkx.FirstSpring; 2 | 3 | public class HelloResponse { 4 | private String message; 5 | 6 | public HelloResponse(String message) { 7 | this.message = message; 8 | } 9 | 10 | public String getMessage() { 11 | return message; 12 | } 13 | 14 | public void setMessage(String message) { 15 | this.message = message; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /FirstSpring/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 -------------------------------------------------------------------------------- /FirstSpring/src/test/java/com/embarkx/FirstSpring/FirstSpringApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.embarkx.FirstSpring; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class FirstSpringApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | !**/src/main/**/target/ 4 | !**/src/test/**/target/ 5 | 6 | ### IntelliJ IDEA ### 7 | .idea/modules.xml 8 | .idea/jarRepositories.xml 9 | .idea/compiler.xml 10 | .idea/libraries/ 11 | *.iws 12 | *.iml 13 | *.ipr 14 | 15 | ### Eclipse ### 16 | .apt_generated 17 | .classpath 18 | .factorypath 19 | .project 20 | .settings 21 | .springBeans 22 | .sts4-cache 23 | 24 | ### NetBeans ### 25 | /nbproject/private/ 26 | /nbbuild/ 27 | /dist/ 28 | /nbdist/ 29 | /.nb-gradle/ 30 | build/ 31 | !**/src/main/**/build/ 32 | !**/src/test/**/build/ 33 | 34 | ### VS Code ### 35 | .vscode/ 36 | 37 | ### Mac OS ### 38 | .DS_Store -------------------------------------------------------------------------------- /SpringExample/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /SpringExample/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /SpringExample/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /SpringExample/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /SpringExample/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | org.example 8 | SpringExample 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 21 13 | 21 14 | UTF-8 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.springframework 22 | spring-core 23 | 6.1.6 24 | 25 | 26 | 27 | 28 | org.springframework 29 | spring-context 30 | 6.1.6 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/bean/App.java: -------------------------------------------------------------------------------- 1 | package car.example.bean; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("applicationBeanContext.xml"); 10 | 11 | MyBean myBean = (MyBean) context.getBean("myBean"); 12 | System.out.println(myBean); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/bean/MyBean.java: -------------------------------------------------------------------------------- 1 | package car.example.bean; 2 | 3 | public class MyBean { 4 | private String message; 5 | 6 | public void setMessage(String message) { 7 | this.message = message; 8 | } 9 | 10 | public void showMessage(){ 11 | System.out.println("Message: " + message); 12 | } 13 | 14 | @Override 15 | public String toString() { 16 | return "MyBean{" + 17 | "message='" + message + '\'' + 18 | '}'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/constructor/injection/App.java: -------------------------------------------------------------------------------- 1 | package car.example.constructor.injection; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("applicationConstructorInjection.xml"); 10 | Car myCar = (Car) context.getBean("myCar"); 11 | myCar.displayDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/constructor/injection/Car.java: -------------------------------------------------------------------------------- 1 | package car.example.constructor.injection; 2 | 3 | public class Car { 4 | private Specification specification; 5 | 6 | public Car(Specification specification) { 7 | this.specification = specification; 8 | } 9 | 10 | public void displayDetails(){ 11 | System.out.println("Car Details: " + specification.toString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/constructor/injection/Specification.java: -------------------------------------------------------------------------------- 1 | package car.example.constructor.injection; 2 | 3 | public class Specification { 4 | private String make; 5 | private String model; 6 | 7 | public String getMake() { 8 | return make; 9 | } 10 | 11 | public void setMake(String make) { 12 | this.make = make; 13 | } 14 | 15 | public String getModel() { 16 | return model; 17 | } 18 | 19 | public void setModel(String model) { 20 | this.model = model; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Specification{" + 26 | "make='" + make + '\'' + 27 | ", model='" + model + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/setter/injection/App.java: -------------------------------------------------------------------------------- 1 | package car.example.setter.injection; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("applicationSetterInjection.xml"); 10 | Car myCar = (Car) context.getBean("myCar"); 11 | myCar.displayDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/setter/injection/Car.java: -------------------------------------------------------------------------------- 1 | package car.example.setter.injection; 2 | 3 | public class Car { 4 | private Specification specification; 5 | 6 | public void setSpecification(Specification specification) { 7 | this.specification = specification; 8 | } 9 | 10 | public void displayDetails(){ 11 | System.out.println("Car Details: " + specification.toString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/car/example/setter/injection/Specification.java: -------------------------------------------------------------------------------- 1 | package car.example.setter.injection; 2 | 3 | public class Specification { 4 | private String make; 5 | private String model; 6 | 7 | public String getMake() { 8 | return make; 9 | } 10 | 11 | public void setMake(String make) { 12 | this.make = make; 13 | } 14 | 15 | public String getModel() { 16 | return model; 17 | } 18 | 19 | public void setModel(String model) { 20 | this.model = model; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Specification{" + 26 | "make='" + make + '\'' + 27 | ", model='" + model + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/constructor/App.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.constructor; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("autowireByConstructor.xml"); 10 | Car myCar = (Car) context.getBean("myCar"); 11 | myCar.displayDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/constructor/Car.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.constructor; 2 | 3 | public class Car { 4 | private Specification specification; 5 | 6 | public Car(Specification specification) { 7 | this.specification = specification; 8 | } 9 | 10 | // public void setSpecification(Specification specification) { 11 | // this.specification = specification; 12 | // } 13 | 14 | public void displayDetails(){ 15 | System.out.println("Car Details: " + specification.toString()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/constructor/Specification.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.constructor; 2 | 3 | public class Specification { 4 | private String make; 5 | private String model; 6 | 7 | public String getMake() { 8 | return make; 9 | } 10 | 11 | public void setMake(String make) { 12 | this.make = make; 13 | } 14 | 15 | public String getModel() { 16 | return model; 17 | } 18 | 19 | public void setModel(String model) { 20 | this.model = model; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Specification{" + 26 | "make='" + make + '\'' + 27 | ", model='" + model + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/name/App.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.name; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("autowireByName.xml"); 10 | Car myCar = (Car) context.getBean("myCar"); 11 | myCar.displayDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/name/Car.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.name; 2 | 3 | public class Car { 4 | private Specification specification; 5 | 6 | public void setSpecification(Specification specification) { 7 | this.specification = specification; 8 | } 9 | 10 | public void displayDetails(){ 11 | System.out.println("Car Details: " + specification.toString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/name/Specification.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.name; 2 | 3 | public class Specification { 4 | private String make; 5 | private String model; 6 | 7 | public String getMake() { 8 | return make; 9 | } 10 | 11 | public void setMake(String make) { 12 | this.make = make; 13 | } 14 | 15 | public String getModel() { 16 | return model; 17 | } 18 | 19 | public void setModel(String model) { 20 | this.model = model; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Specification{" + 26 | "make='" + make + '\'' + 27 | ", model='" + model + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/type/App.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.type; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("autowireByType.xml"); 10 | Car myCar = (Car) context.getBean("myCar"); 11 | myCar.displayDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/type/Car.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.type; 2 | 3 | public class Car { 4 | private Specification specification; 5 | 6 | public void setSpecification(Specification specification) { 7 | this.specification = specification; 8 | } 9 | 10 | public void displayDetails(){ 11 | System.out.println("Car Details: " + specification.toString()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowire/type/Specification.java: -------------------------------------------------------------------------------- 1 | package com.example.autowire.type; 2 | 3 | public class Specification { 4 | private String make; 5 | private String model; 6 | 7 | public String getMake() { 8 | return make; 9 | } 10 | 11 | public void setMake(String make) { 12 | this.make = make; 13 | } 14 | 15 | public String getModel() { 16 | return model; 17 | } 18 | 19 | public void setModel(String model) { 20 | this.model = model; 21 | } 22 | 23 | @Override 24 | public String toString() { 25 | return "Specification{" + 26 | "make='" + make + '\'' + 27 | ", model='" + model + '\'' + 28 | '}'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowired/annotation/App.java: -------------------------------------------------------------------------------- 1 | package com.example.autowired.annotation; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new AnnotationConfigApplicationContext(AppConfig.class); 10 | Employee employee = context.getBean("employee", Employee.class); 11 | System.out.println(employee.toString()); 12 | 13 | 14 | Manager manager = context.getBean("manager", Manager.class); 15 | System.out.println(manager.toString()); 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowired/annotation/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.autowired.annotation; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan(basePackages = "com.example.autowired.annotation") 8 | public class AppConfig { 9 | } 10 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowired/annotation/Employee.java: -------------------------------------------------------------------------------- 1 | package com.example.autowired.annotation; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component("employee") 7 | public class Employee { 8 | private int employeeId; 9 | 10 | @Value("Hello") 11 | private String firstName; 12 | 13 | @Value("${java.home}") 14 | private String lastName; 15 | 16 | @Value("#{4*4}") 17 | private double salary; 18 | 19 | public int getEmployeeId() { 20 | return employeeId; 21 | } 22 | 23 | public void setEmployeeId(int employeeId) { 24 | this.employeeId = employeeId; 25 | } 26 | 27 | public String getFirstName() { 28 | return firstName; 29 | } 30 | 31 | public void setFirstName(String firstName) { 32 | this.firstName = firstName; 33 | } 34 | 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | 39 | public void setLastName(String lastName) { 40 | this.lastName = lastName; 41 | } 42 | 43 | public double getSalary() { 44 | return salary; 45 | } 46 | 47 | public void setSalary(double salary) { 48 | this.salary = salary; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "Employee{" + 54 | "employeeId=" + employeeId + 55 | ", firstName='" + firstName + '\'' + 56 | ", lastName='" + lastName + '\'' + 57 | ", salary=" + salary + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/autowired/annotation/Manager.java: -------------------------------------------------------------------------------- 1 | package com.example.autowired.annotation; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.beans.factory.annotation.Qualifier; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class Manager { 9 | @Autowired 10 | @Qualifier("employee") 11 | private Employee employee; 12 | 13 | /*@Autowired 14 | public Manager(Employee employee) { 15 | this.employee = employee; 16 | }*/ 17 | 18 | @Override 19 | public String toString() { 20 | return "Manager{" + 21 | "employee=" + employee + 22 | '}'; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/componentscan/App.java: -------------------------------------------------------------------------------- 1 | package com.example.componentscan; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("componentScanDemo.xml"); 10 | Employee employee = context.getBean("employee", Employee.class); 11 | System.out.println(employee.toString()); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/componentscan/Employee.java: -------------------------------------------------------------------------------- 1 | package com.example.componentscan; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component("employee") 7 | public class Employee { 8 | private int employeeId; 9 | 10 | @Value("Hello") 11 | private String firstName; 12 | 13 | @Value("${java.home}") 14 | private String lastName; 15 | 16 | @Value("#{4*4}") 17 | private double salary; 18 | 19 | public int getEmployeeId() { 20 | return employeeId; 21 | } 22 | 23 | public void setEmployeeId(int employeeId) { 24 | this.employeeId = employeeId; 25 | } 26 | 27 | public String getFirstName() { 28 | return firstName; 29 | } 30 | 31 | public void setFirstName(String firstName) { 32 | this.firstName = firstName; 33 | } 34 | 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | 39 | public void setLastName(String lastName) { 40 | this.lastName = lastName; 41 | } 42 | 43 | public double getSalary() { 44 | return salary; 45 | } 46 | 47 | public void setSalary(double salary) { 48 | this.salary = salary; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "Employee{" + 54 | "employeeId=" + employeeId + 55 | ", firstName='" + firstName + '\'' + 56 | ", lastName='" + lastName + '\'' + 57 | ", salary=" + salary + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/componentscan/annotation/App.java: -------------------------------------------------------------------------------- 1 | package com.example.componentscan.annotation; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 5 | import org.springframework.context.support.ClassPathXmlApplicationContext; 6 | 7 | public class App { 8 | public static void main(String[] args) { 9 | ApplicationContext context 10 | = new AnnotationConfigApplicationContext(AppConfig.class); 11 | Employee employee = context.getBean("employee", Employee.class); 12 | System.out.println(employee.toString()); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/componentscan/annotation/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.example.componentscan.annotation; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan(basePackages = "com.example.componentscan.annotation") 8 | public class AppConfig { 9 | } 10 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/example/componentscan/annotation/Employee.java: -------------------------------------------------------------------------------- 1 | package com.example.componentscan.annotation; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component("employee") 7 | public class Employee { 8 | private int employeeId; 9 | 10 | @Value("Hello") 11 | private String firstName; 12 | 13 | @Value("${java.home}") 14 | private String lastName; 15 | 16 | @Value("#{4*4}") 17 | private double salary; 18 | 19 | public int getEmployeeId() { 20 | return employeeId; 21 | } 22 | 23 | public void setEmployeeId(int employeeId) { 24 | this.employeeId = employeeId; 25 | } 26 | 27 | public String getFirstName() { 28 | return firstName; 29 | } 30 | 31 | public void setFirstName(String firstName) { 32 | this.firstName = firstName; 33 | } 34 | 35 | public String getLastName() { 36 | return lastName; 37 | } 38 | 39 | public void setLastName(String lastName) { 40 | this.lastName = lastName; 41 | } 42 | 43 | public double getSalary() { 44 | return salary; 45 | } 46 | 47 | public void setSalary(double salary) { 48 | this.salary = salary; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | return "Employee{" + 54 | "employeeId=" + employeeId + 55 | ", firstName='" + firstName + '\'' + 56 | ", lastName='" + lastName + '\'' + 57 | ", salary=" + salary + 58 | '}'; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/IOCExample.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | import org.springframework.context.ApplicationContext; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class IOCExample { 7 | public static void main(String[] args) { 8 | ApplicationContext context 9 | = new ClassPathXmlApplicationContext("applicationIoCLooseCouplingExample.xml"); 10 | 11 | UserManager userManagerWithDB = 12 | (UserManager) context.getBean("userManagerWithUserDataProvider"); 13 | System.out.println(userManagerWithDB.getUserInfo()); 14 | 15 | UserManager userManagerWithWS = 16 | (UserManager) context.getBean("userManagerWithWebServiceProvider"); 17 | System.out.println(userManagerWithWS.getUserInfo()); 18 | 19 | UserManager userManagerWithNewDB = 20 | (UserManager) context.getBean("userManagerWithNewDatabaseProvider"); 21 | System.out.println(userManagerWithNewDB.getUserInfo()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/NewDatabaseProvider.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | public class NewDatabaseProvider implements UserDataProvider { 4 | @Override 5 | public String getUserDetails() { 6 | return "New Database in action"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/UserDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | public interface UserDataProvider { 4 | String getUserDetails(); 5 | } 6 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/UserDatabaseProvider.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | // A - MySQL, PostgreSQL 4 | // B - Web Service, MongoDB 5 | 6 | public class UserDatabaseProvider implements UserDataProvider { 7 | @Override 8 | public String getUserDetails(){ 9 | // Directly access database here 10 | return "User Details From Database"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/UserManager.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | public class UserManager { 4 | private UserDataProvider userDataProvider; 5 | 6 | public UserManager(UserDataProvider userDataProvider) { 7 | this.userDataProvider = userDataProvider; 8 | } 9 | 10 | public String getUserInfo(){ 11 | return userDataProvider.getUserDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/ioc/coupling/WebServiceDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.ioc.coupling; 2 | 3 | public class WebServiceDataProvider implements UserDataProvider { 4 | 5 | @Override 6 | public String getUserDetails() { 7 | return "Fetching Data From WebService"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/LooseCouplingExample.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | public class LooseCouplingExample { 4 | public static void main(String[] args) { 5 | UserDataProvider databaseProvider = new UserDatabaseProvider(); 6 | UserManager userManagerWithDB = new UserManager(databaseProvider); 7 | System.out.println(userManagerWithDB.getUserInfo()); 8 | 9 | UserDataProvider webServiceProvider = new WebServiceDataProvider(); 10 | UserManager userManagerWithWS = new UserManager(webServiceProvider); 11 | System.out.println(userManagerWithWS.getUserInfo()); 12 | 13 | UserDataProvider newDatabaseProvider = new NewDatabaseProvider(); 14 | UserManager userManagerWithNewDB = new UserManager(newDatabaseProvider); 15 | System.out.println(userManagerWithNewDB.getUserInfo()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/NewDatabaseProvider.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | public class NewDatabaseProvider implements UserDataProvider{ 4 | @Override 5 | public String getUserDetails() { 6 | return "New Database in action"; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/UserDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | public interface UserDataProvider { 4 | String getUserDetails(); 5 | } 6 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/UserDatabaseProvider.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | // A - MySQL, PostgreSQL 4 | // B - Web Service, MongoDB 5 | 6 | public class UserDatabaseProvider implements UserDataProvider { 7 | @Override 8 | public String getUserDetails(){ 9 | // Directly access database here 10 | return "User Details From Database"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/UserManager.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | public class UserManager { 4 | private UserDataProvider userDataProvider; 5 | 6 | public UserManager(UserDataProvider userDataProvider) { 7 | this.userDataProvider = userDataProvider; 8 | } 9 | 10 | public String getUserInfo(){ 11 | return userDataProvider.getUserDetails(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/loose/coupling/WebServiceDataProvider.java: -------------------------------------------------------------------------------- 1 | package com.loose.coupling; 2 | 3 | public class WebServiceDataProvider implements UserDataProvider{ 4 | 5 | @Override 6 | public String getUserDetails() { 7 | return "Fetching Data From WebService"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/tight/coupling/TightCouplingExample.java: -------------------------------------------------------------------------------- 1 | package com.tight.coupling; 2 | 3 | public class TightCouplingExample { 4 | public static void main(String[] args) { 5 | UserManager userManager = new UserManager(); 6 | System.out.println(userManager.getUserInfo()); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/tight/coupling/UserDatabase.java: -------------------------------------------------------------------------------- 1 | package com.tight.coupling; 2 | 3 | // A - MySQL, PostgreSQL 4 | // B - Web Service, MongoDB 5 | 6 | public class UserDatabase { 7 | public String getUserDetails(){ 8 | // Directly access database here 9 | return "User Details From Database"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /SpringExample/src/main/java/com/tight/coupling/UserManager.java: -------------------------------------------------------------------------------- 1 | package com.tight.coupling; 2 | 3 | public class UserManager { 4 | private UserDatabase userDatabase = new UserDatabase(); 5 | 6 | public String getUserInfo(){ 7 | return userDatabase.getUserDetails(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/applicationBeanContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/applicationConstructorInjection.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/applicationIoCLooseCouplingExample.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 10 | 11 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/applicationSetterInjection.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/autowireByConstructor.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/autowireByName.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/autowireByType.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SpringExample/src/main/resources/componentScanDemo.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ecom-frontend/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | 26 | .env -------------------------------------------------------------------------------- /ecom-frontend/README.md: -------------------------------------------------------------------------------- 1 | # React + Vite 2 | 3 | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. 4 | 5 | Currently, two official plugins are available: 6 | 7 | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh 8 | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh 9 | -------------------------------------------------------------------------------- /ecom-frontend/eslint.config.js: -------------------------------------------------------------------------------- 1 | import js from '@eslint/js' 2 | import globals from 'globals' 3 | import react from 'eslint-plugin-react' 4 | import reactHooks from 'eslint-plugin-react-hooks' 5 | import reactRefresh from 'eslint-plugin-react-refresh' 6 | 7 | export default [ 8 | { ignores: ['dist'] }, 9 | { 10 | files: ['**/*.{js,jsx}'], 11 | languageOptions: { 12 | ecmaVersion: 2020, 13 | globals: globals.browser, 14 | parserOptions: { 15 | ecmaVersion: 'latest', 16 | ecmaFeatures: { jsx: true }, 17 | sourceType: 'module', 18 | }, 19 | }, 20 | settings: { react: { version: '18.3' } }, 21 | plugins: { 22 | react, 23 | 'react-hooks': reactHooks, 24 | 'react-refresh': reactRefresh, 25 | }, 26 | rules: { 27 | ...js.configs.recommended.rules, 28 | ...react.configs.recommended.rules, 29 | ...react.configs['jsx-runtime'].rules, 30 | ...reactHooks.configs.recommended.rules, 31 | 'react/jsx-no-target-blank': 'off', 32 | 'react-refresh/only-export-components': [ 33 | 'warn', 34 | { allowConstantExport: true }, 35 | ], 36 | }, 37 | }, 38 | ] 39 | -------------------------------------------------------------------------------- /ecom-frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Vite + React 8 | 9 | 10 |
11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /ecom-frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ecom-frontend", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "lint": "eslint .", 10 | "preview": "vite preview" 11 | }, 12 | "dependencies": { 13 | "@emotion/react": "^11.13.5", 14 | "@emotion/styled": "^11.13.5", 15 | "@headlessui/react": "^2.2.0", 16 | "@mui/material": "^6.1.8", 17 | "@reduxjs/toolkit": "^2.3.0", 18 | "@stripe/react-stripe-js": "^3.1.1", 19 | "@stripe/stripe-js": "^5.6.0", 20 | "axios": "^1.7.7", 21 | "react": "^18.3.1", 22 | "react-dom": "^18.3.1", 23 | "react-hook-form": "^7.54.0", 24 | "react-hot-toast": "^2.4.1", 25 | "react-icons": "^5.3.0", 26 | "react-loader-spinner": "^6.1.6", 27 | "react-redux": "^9.1.2", 28 | "react-router-dom": "^7.0.1", 29 | "swiper": "^11.1.15" 30 | }, 31 | "devDependencies": { 32 | "@eslint/js": "^9.13.0", 33 | "@types/react": "^18.3.12", 34 | "@types/react-dom": "^18.3.1", 35 | "@vitejs/plugin-react": "^4.3.3", 36 | "autoprefixer": "^10.4.20", 37 | "eslint": "^9.13.0", 38 | "eslint-plugin-react": "^7.37.2", 39 | "eslint-plugin-react-hooks": "^5.0.0", 40 | "eslint-plugin-react-refresh": "^0.4.14", 41 | "globals": "^15.11.0", 42 | "postcss": "^8.4.49", 43 | "tailwindcss": "^3.4.15", 44 | "vite": "^5.4.10" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /ecom-frontend/postcss.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /ecom-frontend/public/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /ecom-frontend/src/App.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbarkXOfficial/spring-boot-course/7f0afdd1286487a90f199691005c6909e4371676/ecom-frontend/src/App.css -------------------------------------------------------------------------------- /ecom-frontend/src/App.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState } from 'react' 2 | import './App.css' 3 | import Products from './components/products/Products' 4 | import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' 5 | import Home from './components/home/Home' 6 | import Navbar from './components/shared/Navbar' 7 | import About from './components/About' 8 | import Contact from './components/Contact' 9 | import { Toaster } from 'react-hot-toast' 10 | import Cart from './components/cart/Cart' 11 | import LogIn from './components/auth/LogIn' 12 | import PrivateRoute from './components/PrivateRoute' 13 | import Register from './components/auth/Register' 14 | import Checkout from './components/checkout/Checkout' 15 | import PaymentConfirmation from './components/checkout/PaymentConfirmation' 16 | 17 | function App() { 18 | return ( 19 | 20 | 21 | 22 | 23 | }/> 24 | }/> 25 | }/> 26 | }/> 27 | }/> 28 | 29 | }> 30 | }/> 31 | }/> 32 | 33 | 34 | }> 35 | }/> 36 | }/> 37 | 38 | 39 | 40 | 41 | 42 | ) 43 | } 44 | 45 | export default App 46 | -------------------------------------------------------------------------------- /ecom-frontend/src/api/api.js: -------------------------------------------------------------------------------- 1 | import axios from "axios"; 2 | 3 | const api = axios.create({ 4 | baseURL: `${import.meta.env.VITE_BACK_END_URL}/api`, 5 | withCredentials: true, 6 | }); 7 | 8 | export default api; -------------------------------------------------------------------------------- /ecom-frontend/src/assets/sliders/s_1.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbarkXOfficial/spring-boot-course/7f0afdd1286487a90f199691005c6909e4371676/ecom-frontend/src/assets/sliders/s_1.webp -------------------------------------------------------------------------------- /ecom-frontend/src/assets/sliders/s_2.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbarkXOfficial/spring-boot-course/7f0afdd1286487a90f199691005c6909e4371676/ecom-frontend/src/assets/sliders/s_2.webp -------------------------------------------------------------------------------- /ecom-frontend/src/assets/sliders/s_3.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbarkXOfficial/spring-boot-course/7f0afdd1286487a90f199691005c6909e4371676/ecom-frontend/src/assets/sliders/s_3.webp -------------------------------------------------------------------------------- /ecom-frontend/src/components/About.jsx: -------------------------------------------------------------------------------- 1 | import ProductCard from "./shared/ProductCard"; 2 | 3 | const products = [ 4 | { 5 | image: "https://embarkx.com/sample/placeholder.png", 6 | productName: "iPhone 13 Pro Max", 7 | description: 8 | "The iPhone 13 Pro Max offers exceptional performance with its A15 Bionic chip, stunning Super Retina XDR display, and advanced camera features for breathtaking photos.", 9 | specialPrice: 720, 10 | price: 780, 11 | }, 12 | { 13 | image: "https://embarkx.com/sample/placeholder.png", 14 | productName: "Samsung Galaxy S21", 15 | description: 16 | "Experience the brilliance of the Samsung Galaxy S21 with its vibrant AMOLED display, powerful camera, and sleek design that fits perfectly in your hand.", 17 | specialPrice: 699, 18 | price: 799, 19 | }, 20 | { 21 | image: "https://embarkx.com/sample/placeholder.png", 22 | productName: "Google Pixel 6", 23 | description: 24 | "The Google Pixel 6 boasts cutting-edge AI features, exceptional photo quality, and a stunning display, making it a perfect choice for Android enthusiasts.", 25 | price: 599, 26 | specialPrice: 400, 27 | } 28 | ]; 29 | 30 | const About = () => { 31 | return ( 32 |
33 |

34 | About Us 35 |

36 |
37 |
38 |

39 | Welcome to our e-commerce store! We are dedicated to providing the 40 | best products and services to our customers. Our mission is to offer 41 | a seamless shopping experience while ensuring the highest quality of 42 | our offerings. 43 |

44 |
45 | 46 |
47 | About Us 51 |
52 |
53 | 54 | 55 |
56 |

57 | Our Products 58 |

59 |
60 | {products.map((product, index) => ( 61 | 70 | )) 71 | } 72 | 73 | 74 |
75 |
76 |
77 | ); 78 | } 79 | 80 | export default About; -------------------------------------------------------------------------------- /ecom-frontend/src/components/BackDrop.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | 3 | const BackDrop = ({ data }) => { 4 | return ( 5 |
8 | ) 9 | } 10 | 11 | export default BackDrop -------------------------------------------------------------------------------- /ecom-frontend/src/components/Contact.jsx: -------------------------------------------------------------------------------- 1 | import { FaEnvelope, FaMapMarkedAlt, FaPhone } from "react-icons/fa"; 2 | 3 | const Contact = () => { 4 | return( 5 |
8 | 9 |
10 |

Contact us

11 |

12 | We would love to hear from you! Please fill out the form below or contact us directly 13 |

14 | 15 |
16 |
17 | 20 | 24 |
25 | 26 | 27 |
28 | 31 | 35 |
36 | 37 |
38 | 41 |