Repository: EmbarkXOfficial/spring-boot-course Branch: main Commit: ecae1cad6af4 Files: 266 Total size: 469.5 KB Directory structure: gitextract_0gy1k5a8/ ├── 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/ │ │ │ │ └── injection/ │ │ │ │ ├── App.java │ │ │ │ ├── Car.java │ │ │ │ └── Specification.java │ │ │ └── setter/ │ │ │ └── injection/ │ │ │ ├── App.java │ │ │ ├── Car.java │ │ │ └── Specification.java │ │ └── com/ │ │ ├── example/ │ │ │ ├── autowire/ │ │ │ │ ├── constructor/ │ │ │ │ │ ├── App.java │ │ │ │ │ ├── Car.java │ │ │ │ │ └── Specification.java │ │ │ │ ├── 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.json │ ├── postcss.config.js │ ├── src/ │ │ ├── App.css │ │ ├── App.jsx │ │ ├── api/ │ │ │ └── api.js │ │ ├── components/ │ │ │ ├── About.jsx │ │ │ ├── BackDrop.jsx │ │ │ ├── Contact.jsx │ │ │ ├── PrivateRoute.jsx │ │ │ ├── UserMenu.jsx │ │ │ ├── admin/ │ │ │ │ ├── AdminLayout.jsx │ │ │ │ ├── categories/ │ │ │ │ │ ├── AddCategoryForm.jsx │ │ │ │ │ └── Category.jsx │ │ │ │ ├── dashboard/ │ │ │ │ │ ├── Dashboard.jsx │ │ │ │ │ └── DashboardOverview.jsx │ │ │ │ ├── orders/ │ │ │ │ │ ├── OrderTable.jsx │ │ │ │ │ ├── Orders.jsx │ │ │ │ │ └── UpdateOrderForm.jsx │ │ │ │ ├── products/ │ │ │ │ │ ├── AddProductForm.jsx │ │ │ │ │ ├── AdminProducts.jsx │ │ │ │ │ └── ImageUploadForm.jsx │ │ │ │ └── sellers/ │ │ │ │ ├── AddSellerForm.jsx │ │ │ │ ├── SellerTable.jsx │ │ │ │ ├── Sellers.jsx │ │ │ │ └── useSellerFilter.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 │ │ │ ├── helper/ │ │ │ │ └── tableColumn.jsx │ │ │ ├── home/ │ │ │ │ ├── HeroBanner.jsx │ │ │ │ └── Home.jsx │ │ │ ├── products/ │ │ │ │ ├── Filter.jsx │ │ │ │ └── Products.jsx │ │ │ └── shared/ │ │ │ ├── DeleteModal.jsx │ │ │ ├── ErrorPage.jsx │ │ │ ├── InputField.jsx │ │ │ ├── Loader.jsx │ │ │ ├── Modal.jsx │ │ │ ├── Navbar.jsx │ │ │ ├── Paginations.jsx │ │ │ ├── ProductCard.jsx │ │ │ ├── ProductViewModal.jsx │ │ │ ├── SelectTextField.jsx │ │ │ ├── Sidebar.jsx │ │ │ ├── Skeleton.jsx │ │ │ ├── Spinners.jsx │ │ │ └── Status.jsx │ │ ├── hooks/ │ │ │ ├── useCategoryFilter.js │ │ │ ├── useOrderFilter.js │ │ │ └── useProductFilter.js │ │ ├── index.css │ │ ├── main.jsx │ │ ├── store/ │ │ │ ├── actions/ │ │ │ │ └── index.js │ │ │ └── reducers/ │ │ │ ├── ProductReducer.js │ │ │ ├── adminReducer.js │ │ │ ├── authReducer.js │ │ │ ├── cartReducer.js │ │ │ ├── errorReducer.js │ │ │ ├── orderReducer.js │ │ │ ├── paymentMethodReducer.js │ │ │ ├── sellerReducer.js │ │ │ └── store.js │ │ └── utils/ │ │ ├── constant.js │ │ ├── formatPrice.js │ │ ├── index.js │ │ └── truncateText.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 ├── mvnw ├── mvnw.cmd ├── pom.xml └── src/ ├── main/ │ ├── java/ │ │ └── com/ │ │ └── ecommerce/ │ │ └── project/ │ │ ├── SbEcomApplication.java │ │ ├── config/ │ │ │ ├── AppConfig.java │ │ │ ├── AppConstants.java │ │ │ ├── SwaggerConfig.java │ │ │ └── WebMvcConfig.java │ │ ├── controller/ │ │ │ ├── AddressController.java │ │ │ ├── AnalyticsController.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 │ │ │ ├── AnalyticsResponse.java │ │ │ ├── AuthenticationResult.java │ │ │ ├── CartDTO.java │ │ │ ├── CartItemDTO.java │ │ │ ├── CategoryDTO.java │ │ │ ├── CategoryResponse.java │ │ │ ├── OrderDTO.java │ │ │ ├── OrderItemDTO.java │ │ │ ├── OrderRequestDTO.java │ │ │ ├── OrderResponse.java │ │ │ ├── OrderStatusUpdateDto.java │ │ │ ├── PaymentDTO.java │ │ │ ├── ProductDTO.java │ │ │ ├── ProductResponse.java │ │ │ ├── StripePaymentDto.java │ │ │ ├── UserDTO.java │ │ │ └── UserResponse.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 │ │ │ ├── AnalyticsService.java │ │ │ ├── AnalyticsServiceImpl.java │ │ │ ├── AuthService.java │ │ │ ├── AuthServiceImpl.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 ================================================ FILE CONTENTS ================================================ ================================================ FILE: FirstSpring/.gitignore ================================================ HELP.md target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ ### STS ### .apt_generated .classpath .factorypath .project .settings .springBeans .sts4-cache ### IntelliJ IDEA ### .idea *.iws *.iml *.ipr ### NetBeans ### /nbproject/private/ /nbbuild/ /dist/ /nbdist/ /.nb-gradle/ build/ !**/src/main/**/build/ !**/src/test/**/build/ ### VS Code ### .vscode/ ================================================ FILE: FirstSpring/mvnw ================================================ #!/bin/sh # ---------------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- # Apache Maven Wrapper startup batch script, version 3.2.0 # # Required ENV vars: # ------------------ # JAVA_HOME - location of a JDK home dir # # Optional ENV vars # ----------------- # MAVEN_OPTS - parameters passed to the Java VM when running Maven # e.g. to debug Maven itself, use # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 # MAVEN_SKIP_RC - flag to disable loading of mavenrc files # ---------------------------------------------------------------------------- if [ -z "$MAVEN_SKIP_RC" ] ; then if [ -f /usr/local/etc/mavenrc ] ; then . /usr/local/etc/mavenrc fi if [ -f /etc/mavenrc ] ; then . /etc/mavenrc fi if [ -f "$HOME/.mavenrc" ] ; then . "$HOME/.mavenrc" fi fi # OS specific support. $var _must_ be set to either true or false. cygwin=false; darwin=false; mingw=false case "$(uname)" in CYGWIN*) cygwin=true ;; MINGW*) mingw=true;; Darwin*) darwin=true # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home # See https://developer.apple.com/library/mac/qa/qa1170/_index.html if [ -z "$JAVA_HOME" ]; then if [ -x "/usr/libexec/java_home" ]; then JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME else JAVA_HOME="/Library/Java/Home"; export JAVA_HOME fi fi ;; esac if [ -z "$JAVA_HOME" ] ; then if [ -r /etc/gentoo-release ] ; then JAVA_HOME=$(java-config --jre-home) fi fi # For Cygwin, ensure paths are in UNIX format before anything is touched if $cygwin ; then [ -n "$JAVA_HOME" ] && JAVA_HOME=$(cygpath --unix "$JAVA_HOME") [ -n "$CLASSPATH" ] && CLASSPATH=$(cygpath --path --unix "$CLASSPATH") fi # For Mingw, ensure paths are in UNIX format before anything is touched if $mingw ; then [ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] && JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)" fi if [ -z "$JAVA_HOME" ]; then javaExecutable="$(which javac)" if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then # readlink(1) is not available as standard on Solaris 10. readLink=$(which readlink) if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then if $darwin ; then javaHome="$(dirname "\"$javaExecutable\"")" javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac" else javaExecutable="$(readlink -f "\"$javaExecutable\"")" fi javaHome="$(dirname "\"$javaExecutable\"")" javaHome=$(expr "$javaHome" : '\(.*\)/bin') JAVA_HOME="$javaHome" export JAVA_HOME fi fi fi if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD="$JAVA_HOME/jre/sh/java" else JAVACMD="$JAVA_HOME/bin/java" fi else JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)" fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." >&2 echo " We cannot execute $JAVACMD" >&2 exit 1 fi if [ -z "$JAVA_HOME" ] ; then echo "Warning: JAVA_HOME environment variable is not set." fi # traverses directory structure from process work directory to filesystem root # first directory with .mvn subdirectory is considered project base directory find_maven_basedir() { if [ -z "$1" ] then echo "Path not specified to find_maven_basedir" return 1 fi basedir="$1" wdir="$1" while [ "$wdir" != '/' ] ; do if [ -d "$wdir"/.mvn ] ; then basedir=$wdir break fi # workaround for JBEAP-8937 (on Solaris 10/Sparc) if [ -d "${wdir}" ]; then wdir=$(cd "$wdir/.." || exit 1; pwd) fi # end of workaround done printf '%s' "$(cd "$basedir" || exit 1; pwd)" } # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then # Remove \r in case we run on Windows within Git Bash # and check out the repository with auto CRLF management # enabled. Otherwise, we may read lines that are delimited with # \r\n and produce $'-Xarg\r' rather than -Xarg due to word # splitting rules. tr -s '\r\n' ' ' < "$1" fi } log() { if [ "$MVNW_VERBOSE" = true ]; then printf '%s\n' "$1" fi } BASE_DIR=$(find_maven_basedir "$(dirname "$0")") if [ -z "$BASE_DIR" ]; then exit 1; fi MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR log "$MAVEN_PROJECTBASEDIR" ########################################################################################## # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central # This allows using the maven wrapper in projects that prohibit checking in binary data. ########################################################################################## wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" if [ -r "$wrapperJarPath" ]; then log "Found $wrapperJarPath" else log "Couldn't find $wrapperJarPath, downloading it ..." if [ -n "$MVNW_REPOURL" ]; then wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" else wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" fi while IFS="=" read -r key value; do # Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' ) safeValue=$(echo "$value" | tr -d '\r') case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;; esac done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" log "Downloading from: $wrapperUrl" if $cygwin; then wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath") fi if command -v wget > /dev/null; then log "Found wget ... using wget" [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet" if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" else wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" fi elif command -v curl > /dev/null; then log "Found curl ... using curl" [ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent" if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" else curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath" fi else log "Falling back to using Java to download" javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java" javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class" # For Cygwin, switch paths to Windows format before running javac if $cygwin; then javaSource=$(cygpath --path --windows "$javaSource") javaClass=$(cygpath --path --windows "$javaClass") fi if [ -e "$javaSource" ]; then if [ ! -e "$javaClass" ]; then log " - Compiling MavenWrapperDownloader.java ..." ("$JAVA_HOME/bin/javac" "$javaSource") fi if [ -e "$javaClass" ]; then log " - Running MavenWrapperDownloader.java ..." ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath" fi fi fi fi ########################################################################################## # End of extension ########################################################################################## # If specified, validate the SHA-256 sum of the Maven wrapper jar file wrapperSha256Sum="" while IFS="=" read -r key value; do case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;; esac done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties" if [ -n "$wrapperSha256Sum" ]; then wrapperSha256Result=false if command -v sha256sum > /dev/null; then if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then wrapperSha256Result=true fi elif command -v shasum > /dev/null; then if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then wrapperSha256Result=true fi else echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties." exit 1 fi if [ $wrapperSha256Result = false ]; then echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2 echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2 echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2 exit 1 fi fi MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" # For Cygwin, switch paths to Windows format before running java if $cygwin; then [ -n "$JAVA_HOME" ] && JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME") [ -n "$CLASSPATH" ] && CLASSPATH=$(cygpath --path --windows "$CLASSPATH") [ -n "$MAVEN_PROJECTBASEDIR" ] && MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR") fi # Provide a "standardized" way to retrieve the CLI args that will # work with both Windows and non-Windows executions. MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*" export MAVEN_CMD_LINE_ARGS WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain # shellcheck disable=SC2086 # safe args exec "$JAVACMD" \ $MAVEN_OPTS \ $MAVEN_DEBUG_OPTS \ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" ================================================ FILE: FirstSpring/mvnw.cmd ================================================ @REM ---------------------------------------------------------------------------- @REM Licensed to the Apache Software Foundation (ASF) under one @REM or more contributor license agreements. See the NOTICE file @REM distributed with this work for additional information @REM regarding copyright ownership. The ASF licenses this file @REM to you under the Apache License, Version 2.0 (the @REM "License"); you may not use this file except in compliance @REM with the License. You may obtain a copy of the License at @REM @REM https://www.apache.org/licenses/LICENSE-2.0 @REM @REM Unless required by applicable law or agreed to in writing, @REM software distributed under the License is distributed on an @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @REM KIND, either express or implied. See the License for the @REM specific language governing permissions and limitations @REM under the License. @REM ---------------------------------------------------------------------------- @REM ---------------------------------------------------------------------------- @REM Apache Maven Wrapper startup batch script, version 3.2.0 @REM @REM Required ENV vars: @REM JAVA_HOME - location of a JDK home dir @REM @REM Optional ENV vars @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven @REM e.g. to debug Maven itself, use @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files @REM ---------------------------------------------------------------------------- @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' @echo off @REM set title of command window title %0 @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% @REM set %HOME% to equivalent of $HOME if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") @REM Execute a user defined script before this one if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre @REM check for pre script, once with legacy .bat ending and once with .cmd ending if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* :skipRcPre @setlocal set ERROR_CODE=0 @REM To isolate internal variables from possible post scripts, we use another setlocal @setlocal @REM ==== START VALIDATION ==== if not "%JAVA_HOME%" == "" goto OkJHome echo. echo Error: JAVA_HOME not found in your environment. >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error :OkJHome if exist "%JAVA_HOME%\bin\java.exe" goto init echo. echo Error: JAVA_HOME is set to an invalid directory. >&2 echo JAVA_HOME = "%JAVA_HOME%" >&2 echo Please set the JAVA_HOME variable in your environment to match the >&2 echo location of your Java installation. >&2 echo. goto error @REM ==== END VALIDATION ==== :init @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". @REM Fallback to current working directory if not found. set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir set EXEC_DIR=%CD% set WDIR=%EXEC_DIR% :findBaseDir IF EXIST "%WDIR%"\.mvn goto baseDirFound cd .. IF "%WDIR%"=="%CD%" goto baseDirNotFound set WDIR=%CD% goto findBaseDir :baseDirFound set MAVEN_PROJECTBASEDIR=%WDIR% cd "%EXEC_DIR%" goto endDetectBaseDir :baseDirNotFound set MAVEN_PROJECTBASEDIR=%EXEC_DIR% cd "%EXEC_DIR%" :endDetectBaseDir IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig @setlocal EnableExtensions EnableDelayedExpansion for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% :endReadAdditionalConfig SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B ) @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central @REM This allows using the maven wrapper in projects that prohibit checking in binary data. if exist %WRAPPER_JAR% ( if "%MVNW_VERBOSE%" == "true" ( echo Found %WRAPPER_JAR% ) ) else ( if not "%MVNW_REPOURL%" == "" ( SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar" ) if "%MVNW_VERBOSE%" == "true" ( echo Couldn't find %WRAPPER_JAR%, downloading it ... echo Downloading from: %WRAPPER_URL% ) powershell -Command "&{"^ "$webclient = new-object System.Net.WebClient;"^ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ "}"^ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^ "}" if "%MVNW_VERBOSE%" == "true" ( echo Finished downloading %WRAPPER_JAR% ) ) @REM End of extension @REM If specified, validate the SHA-256 sum of the Maven wrapper jar file SET WRAPPER_SHA_256_SUM="" FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B ) IF NOT %WRAPPER_SHA_256_SUM%=="" ( powershell -Command "&{"^ "$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^ "If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^ " Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^ " Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^ " Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^ " exit 1;"^ "}"^ "}" if ERRORLEVEL 1 goto error ) @REM Provide a "standardized" way to retrieve the CLI args that will @REM work with both Windows and non-Windows executions. set MAVEN_CMD_LINE_ARGS=%* %MAVEN_JAVA_EXE% ^ %JVM_CONFIG_MAVEN_PROPS% ^ %MAVEN_OPTS% ^ %MAVEN_DEBUG_OPTS% ^ -classpath %WRAPPER_JAR% ^ "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* if ERRORLEVEL 1 goto error goto end :error set ERROR_CODE=1 :end @endlocal & set ERROR_CODE=%ERROR_CODE% if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost @REM check for post script, once with legacy .bat ending and once with .cmd ending if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" :skipRcPost @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' if "%MAVEN_BATCH_PAUSE%"=="on" pause if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% cmd /C exit /B %ERROR_CODE% ================================================ FILE: FirstSpring/pom.xml ================================================ 4.0.0 org.springframework.boot spring-boot-starter-parent 4.0.1 com.embarkx FirstSpring 0.0.1-SNAPSHOT FirstSpring First project for Spring Boot 24 org.springframework.boot spring-boot-starter-webmvc org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-plugin ================================================ FILE: FirstSpring/src/main/java/com/embarkx/FirstSpring/FirstSpringApplication.java ================================================ package com.embarkx.FirstSpring; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class FirstSpringApplication { public static void main(String[] args) { SpringApplication.run(FirstSpringApplication.class, args); } } ================================================ FILE: FirstSpring/src/main/java/com/embarkx/FirstSpring/HelloController.java ================================================ package com.embarkx.FirstSpring; import org.springframework.web.bind.annotation.*; @RestController public class HelloController { @GetMapping("/hello/{name}") public HelloResponse helloParam(@PathVariable String name) { return new HelloResponse("Hello, " + name); } @GetMapping("/hello") public HelloResponse hello() { return new HelloResponse("Hello, World!"); } @PostMapping("/hello") public HelloResponse helloPost(@RequestBody String name) { return new HelloResponse("Hello, " + name + "!"); } } ================================================ FILE: FirstSpring/src/main/java/com/embarkx/FirstSpring/HelloResponse.java ================================================ package com.embarkx.FirstSpring; public class HelloResponse { private String message; public HelloResponse(String message) { this.message = message; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } } ================================================ FILE: FirstSpring/src/main/resources/application.properties ================================================ server.port=8080 ================================================ FILE: FirstSpring/src/test/java/com/embarkx/FirstSpring/FirstSpringApplicationTests.java ================================================ package com.embarkx.FirstSpring; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class FirstSpringApplicationTests { @Test void contextLoads() { } } ================================================ FILE: Java Spring Boot- Professional eCommerce Project Masterclass.postman_collection.json ================================================ { "info": { "_postman_id": "e901da3d-88dd-479e-a9f9-2a1a38b6282b", "name": "Java Spring Boot: Professional eCommerce Project Masterclass", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", "_exporter_id": "28392683" }, "item": [ { "name": "SocialMedia APIs", "item": [ { "name": "GetUsers", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/social/users", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "social", "users" ] } }, "response": [] }, { "name": "GetUsers", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/social/users/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "social", "users", "1" ] } }, "response": [] }, { "name": "DeleteUsers", "request": { "method": "DELETE", "header": [], "url": { "raw": "http://localhost:8080/social/users/4", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "social", "users", "4" ] } }, "response": [] }, { "name": "SaveUsers", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"id\": 10,\r\n \"socialProfile\": {\r\n \"id\": 10,\r\n \"description\":\"Test 4\"\r\n }\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/social/users", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "social", "users" ] } }, "response": [] } ] }, { "name": "Hello World App", "item": [ { "name": "http://localhost:8080/hello", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "Spring Boot" }, "url": { "raw": "http://localhost:8080/hello", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "hello" ] } }, "response": [] }, { "name": "http://localhost:8080/hello", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/hello", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "hello" ] } }, "response": [] } ] }, { "name": "Spring Boot Ecommerce", "item": [ { "name": "Product", "item": [ { "name": "Add Product", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"productName\": \"Adjustable dumbbell set for home workouts | Premium Quality\",\r\n \"description\": \"Adjustable dumbbell set for home workouts, can be used indoors, outdoors, at your personal gym. This is available at lowest possible rates.\",\r\n \"quantity\": 90,\r\n \"price\": 90,\r\n \"discount\": 10\r\n}\r\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/admin/categories/6/product", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "admin", "categories", "6", "product" ] } }, "response": [] }, { "name": "Update Product", "request": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"productName\": \"Adjustable dumbbell set for home workouts | Premium Quality\",\r\n \"description\": \"Adjustable dumbbell set for home workouts, can be used indoors, outdoors, at your personal gym. This is available at lowest possible rates.\",\r\n \"quantity\": 0,\r\n \"price\": 90,\r\n \"discount\": 10\r\n}\r\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/admin/products/157", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "admin", "products", "157" ] } }, "response": [] }, { "name": "Update Product Image", "request": { "method": "PUT", "header": [], "body": { "mode": "formdata", "formdata": [ { "key": "image", "type": "file", "src": "/C:/Users/FAISAL/Downloads/placeholder.png" } ] }, "url": { "raw": "http://localhost:8080/api/products/202/image", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "products", "202", "image" ] } }, "response": [] }, { "name": "Delete Product", "request": { "method": "DELETE", "header": [], "url": { "raw": "http://localhost:8080/api/admin/products/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "admin", "products", "1" ] } }, "response": [] }, { "name": "Get All Products", "request": { "method": "GET", "header": [ { "key": "Authorization", "value": "Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyMSIsImlhdCI6MTcxNTE4MzY0OSwiZXhwIjoxNzE1MTg2NjQ5fQ.XS0-JKPhMJMrULRonqYLQzhJFTFOXGxkeuFj4q4mxeE", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/public/products?sortBy=price&sortOrder=desc&pageSize=20", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "products" ], "query": [ { "key": "pageNumber", "value": "1", "disabled": true }, { "key": "sortBy", "value": "price" }, { "key": "sortOrder", "value": "desc" }, { "key": "keyword", "value": "blender", "disabled": true }, { "key": "category", "value": "Electronics", "disabled": true }, { "key": "pageSize", "value": "20" } ] } }, "response": [] }, { "name": "Get Products By Keyword", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/public/products/keyword/rob?pageNumber=0&pageSize=10&sortBy=productName&sortOrder=desc", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "products", "keyword", "rob" ], "query": [ { "key": "pageNumber", "value": "0" }, { "key": "pageSize", "value": "10" }, { "key": "sortBy", "value": "productName" }, { "key": "sortOrder", "value": "desc" } ] } }, "response": [] }, { "name": "Get Products By Category", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/public/categories/1/products?pageNumber=0&pageSize=10&sortBy=productId&sortOrder=desc", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "categories", "1", "products" ], "query": [ { "key": "pageNumber", "value": "0" }, { "key": "pageSize", "value": "10" }, { "key": "sortBy", "value": "productId" }, { "key": "sortOrder", "value": "desc" } ] } }, "response": [] } ] }, { "name": "Category", "item": [ { "name": "Get All Categories", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/public/categories", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "categories" ], "query": [ { "key": "pageNumber", "value": "0", "disabled": true }, { "key": "pageSize", "value": "10", "disabled": true }, { "key": "sortBy", "value": "categoryName", "disabled": true }, { "key": "sortOrder", "value": "desc", "disabled": true } ] } }, "response": [] }, { "name": "DELETE Category", "request": { "method": "DELETE", "header": [], "url": { "raw": "http://localhost:8080/api/admin/categories/4", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "admin", "categories", "4" ] } }, "response": [] }, { "name": "Create new Category", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"categoryName\":\"Sports & Fitness\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/public/categories", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "categories" ] } }, "response": [] }, { "name": "Update Category", "request": { "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"categoryName\":\"Travel Updated\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/public/categories/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "public", "categories", "1" ] } }, "response": [] } ] }, { "name": "Authentication", "item": [ { "name": "Sign in", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"username\":\"user1\",\r\n \"password\":\"password1\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/auth/signin", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "auth", "signin" ] } }, "response": [] }, { "name": "GetUserName", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/auth/username", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "auth", "username" ] } }, "response": [] }, { "name": "GetUser", "request": { "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/auth/user", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "auth", "user" ] } }, "response": [] }, { "name": "Sign Out", "request": { "method": "POST", "header": [], "url": { "raw": "http://localhost:8080/api/auth/signout", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "auth", "signout" ] } }, "response": [] }, { "name": "Sign up", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"username\":\"user3\",\r\n \"email\":\"user3email@gmail.com\",\r\n \"password\":\"password3\",\r\n \"role\":[\"admin\"]\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/auth/signup", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "auth", "signup" ] } }, "response": [] } ] }, { "name": "Cart", "item": [ { "name": "Add product to cart", "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [ { "key": "", "value": "", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/carts/products/1/quantity/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "carts", "products", "1", "quantity", "1" ] } }, "response": [] }, { "name": "Get all carts", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "", "value": "", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/carts", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "carts" ] } }, "response": [] }, { "name": "Get User Cart", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [ { "key": "", "value": "", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/carts/users/cart", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "carts", "users", "cart" ] } }, "response": [] }, { "name": "Update quantity of product in Cart", "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [ { "key": "", "value": "", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/cart/products/1/quantity/delete", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "cart", "products", "1", "quantity", "delete" ] } }, "response": [] }, { "name": "Delete product from cart", "request": { "auth": { "type": "noauth" }, "method": "DELETE", "header": [ { "key": "", "value": "", "disabled": true } ], "url": { "raw": "http://localhost:8080/api/carts/1/product/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "carts", "1", "product", "1" ] } }, "response": [] } ] }, { "name": "Addresses", "item": [ { "name": "Create Address", "request": { "auth": { "type": "noauth" }, "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"country\": \"USA\",\r\n \"city\": \"San Francisco\",\r\n \"street\": \"Market Street\",\r\n \"pincode\": \"94103\",\r\n \"buildingName\": \"Bay Apartments\",\r\n \"state\": \"California\"\r\n}\r\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/addresses", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "addresses" ] } }, "response": [] }, { "name": "Update Address", "request": { "auth": { "type": "noauth" }, "method": "PUT", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"country\": \"USA\",\r\n \"city\": \"San Francisco\",\r\n \"street\": \"Market Street\",\r\n \"pincode\": \"94103\",\r\n \"buildingName\": \"Bay Apartments Updated\",\r\n \"state\": \"California\"\r\n}\r\n", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/addresses/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "addresses", "1" ] } }, "response": [] }, { "name": "Get Addresses", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/addresses", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "addresses" ] } }, "response": [] }, { "name": "Get Address By Id", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/addresses/1", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "addresses", "1" ] } }, "response": [] }, { "name": "Delete Address", "request": { "auth": { "type": "noauth" }, "method": "DELETE", "header": [], "url": { "raw": "http://localhost:8080/api/addresses/2", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "addresses", "2" ] } }, "response": [] }, { "name": "Get User Addresses", "request": { "auth": { "type": "noauth" }, "method": "GET", "header": [], "url": { "raw": "http://localhost:8080/api/users/addresses", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "users", "addresses" ] } }, "response": [] } ] }, { "name": "Orders", "item": [ { "name": "Place Order", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"addressId\": 1,\r\n \"pgName\": \"Stripe\",\r\n \"pgPaymentId\": \"pi_1FHEhK2eZvKYlo2CcK4UJNdW\",\r\n \"pgStatus\": \"succeeded\",\r\n \"pgResponseMessage\": \"Payment successful\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/order/users/payments/CARD", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "order", "users", "payments", "CARD" ] } }, "response": [] }, { "name": "StripeClientSecret", "request": { "method": "POST", "header": [], "body": { "mode": "raw", "raw": "{\r\n \"amount\": 2000,\r\n \"currency\": \"usd\"\r\n}", "options": { "raw": { "language": "json" } } }, "url": { "raw": "http://localhost:8080/api/order/stripe-client-secret", "protocol": "http", "host": [ "localhost" ], "port": "8080", "path": [ "api", "order", "stripe-client-secret" ] } }, "response": [] } ] } ] } ] } ================================================ FILE: README.md ================================================ This is the Official repository of **Java Spring Boot: Professional eCommerce Project Masterclass** on Udemy # The Ultimate Java and Spring Boot Mastery Roadmap Welcome to your one-stop-shop for mastering Java and Spring Boot! This repository offers a comprehensive learning experience with high-quality resources and community support. Dive into over 150+ hours of premium content, with everything you need to excel at Java and Spring Boot development. ## 🎓 Learning Roadmap Most of the courses below are available in **Udemy For Business**, so if you have subscription - you can get FREE access. Here’s a structured path to enhance your skills with detailed courses available: 1. **[Spring Boot By Building Complex Projects Step by Step](https://link.embarkx.com/spring-boot) (90+ Hours of Content)** 2. **[Master Spring Boot Microservices by Building eCommerce Project](https://link.embarkx.com/microservices) (55+ Hours of Content)** 3. **[Full Stack AI DevOps for Software Developers (AWS, Azure, GCP)](https://link.embarkx.com/devops) (20+ Hours of Content)** 4. **[Learn Java with 60+ Hours of Content](http://link.embarkx.com/java) (60+ Hours of Content)** 5. **[Master Spring Security with React JS + OAuth2](https://link.embarkx.com/spring-security) (34+ Hours of Content)** 6. **[Master IntelliJ IDEA](http://link.embarkx.com/intellij) (3+ Hours of Content)** ## 🌟 With All Our Courses You Gain Access To - 📝 **Notes:** Detailed and downloadable notes to accompany each lesson. - 💻 **Source Code:** Full access to the source code used in the tutorials. - 🤔 **Doubt Solving:** Responsive instructor and community support. - 🎥 **High-Quality HD Videos:** Easy to understand, high-definition video tutorials. - 🔄 **Free Lifetime Updates:** Continuous updates to course content at no extra cost. ## 📚 Why Choose This Mastery Series? With this series, you're not just learning; you're preparing to dominate the field of Java and Spring Boot development. Our structured learning path ensures that you build your skills progressively, with each course designed to build on the knowledge gained from the previous one. ### Join Us Now! Start your journey today to become a master at Java and Spring Boot. Our community and expert instructors are here to support your learning every step of the way. **Enroll and start building your future, today!** # Usage Policy for Course Materials ## Instructor Information **Instructor:** Faisal Memon **Company:** [EmbarkX.com](http://www.embarkx.com) ## Policy Overview This document outlines the guidelines and restrictions concerning the use of course materials provided by EmbarkX, including but not limited to PDF presentations, code samples, and video tutorials. ### 1. Personal Use Only The materials provided in this course are intended for **your personal use only**. They are to be used solely for the purpose of learning and completing this course. ### 2. No Unauthorized Sharing or Distribution You are **not permitted** to share, distribute, or publicly post any course materials on any websites, social media platforms, or other public forums without prior written consent from the instructor. ### 3. Intellectual Property All course materials are protected by copyright laws and are the intellectual property of Faisal Memon and EmbarkX. Unauthorized use, reproduction, or distribution of these materials is **strictly prohibited**. ### 4. Reporting Violations If you become aware of any unauthorized sharing or distribution of course materials, please report it immediately to [embarkxofficial@gmail.com](mailto:embarkxofficial@gmail.com). ### 5. Legal Action We reserve the right to take legal action against individuals or entities found to be violating this usage policy. ## Thank You Thank you for respecting these guidelines and helping us maintain the integrity of our course materials. ## Contact Information - **Email:** [embarkxofficial@gmail.com](mailto:embarkxofficial@gmail.com) - **Website:** [www.embarkx.com](http://www.embarkx.com) ================================================ FILE: SpringExample/.gitignore ================================================ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ ### IntelliJ IDEA ### .idea/modules.xml .idea/jarRepositories.xml .idea/compiler.xml .idea/libraries/ *.iws *.iml *.ipr ### Eclipse ### .apt_generated .classpath .factorypath .project .settings .springBeans .sts4-cache ### NetBeans ### /nbproject/private/ /nbbuild/ /dist/ /nbdist/ /.nb-gradle/ build/ !**/src/main/**/build/ !**/src/test/**/build/ ### VS Code ### .vscode/ ### Mac OS ### .DS_Store ================================================ FILE: SpringExample/.idea/.gitignore ================================================ # Default ignored files /shelf/ /workspace.xml ================================================ FILE: SpringExample/.idea/encodings.xml ================================================ ================================================ FILE: SpringExample/.idea/misc.xml ================================================ ================================================ FILE: SpringExample/.idea/uiDesigner.xml ================================================ ================================================ FILE: SpringExample/.idea/vcs.xml ================================================ ================================================ FILE: SpringExample/pom.xml ================================================ 4.0.0 org.example SpringExample 1.0-SNAPSHOT 21 21 UTF-8 org.springframework spring-core 6.1.6 org.springframework spring-context 6.1.6 ================================================ FILE: SpringExample/src/main/java/car/example/bean/App.java ================================================ package car.example.bean; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationBeanContext.xml"); MyBean myBean = (MyBean) context.getBean("myBean"); System.out.println(myBean); } } ================================================ FILE: SpringExample/src/main/java/car/example/bean/MyBean.java ================================================ package car.example.bean; public class MyBean { private String message; public void setMessage(String message) { this.message = message; } public void showMessage(){ System.out.println("Message: " + message); } @Override public String toString() { return "MyBean{" + "message='" + message + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/car/example/constructor/injection/App.java ================================================ package car.example.constructor.injection; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationConstructorInjection.xml"); Car myCar = (Car) context.getBean("myCar"); myCar.displayDetails(); } } ================================================ FILE: SpringExample/src/main/java/car/example/constructor/injection/Car.java ================================================ package car.example.constructor.injection; public class Car { private Specification specification; public Car(Specification specification) { this.specification = specification; } public void displayDetails(){ System.out.println("Car Details: " + specification.toString()); } } ================================================ FILE: SpringExample/src/main/java/car/example/constructor/injection/Specification.java ================================================ package car.example.constructor.injection; public class Specification { private String make; private String model; public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { return "Specification{" + "make='" + make + '\'' + ", model='" + model + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/car/example/setter/injection/App.java ================================================ package car.example.setter.injection; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationSetterInjection.xml"); Car myCar = (Car) context.getBean("myCar"); myCar.displayDetails(); } } ================================================ FILE: SpringExample/src/main/java/car/example/setter/injection/Car.java ================================================ package car.example.setter.injection; public class Car { private Specification specification; public void setSpecification(Specification specification) { this.specification = specification; } public void displayDetails(){ System.out.println("Car Details: " + specification.toString()); } } ================================================ FILE: SpringExample/src/main/java/car/example/setter/injection/Specification.java ================================================ package car.example.setter.injection; public class Specification { private String make; private String model; public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { return "Specification{" + "make='" + make + '\'' + ", model='" + model + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/constructor/App.java ================================================ package com.example.autowire.constructor; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("autowireByConstructor.xml"); Car myCar = (Car) context.getBean("myCar"); myCar.displayDetails(); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/constructor/Car.java ================================================ package com.example.autowire.constructor; public class Car { private Specification specification; public Car(Specification specification) { this.specification = specification; } // public void setSpecification(Specification specification) { // this.specification = specification; // } public void displayDetails(){ System.out.println("Car Details: " + specification.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/constructor/Specification.java ================================================ package com.example.autowire.constructor; public class Specification { private String make; private String model; public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { return "Specification{" + "make='" + make + '\'' + ", model='" + model + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/name/App.java ================================================ package com.example.autowire.name; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("autowireByName.xml"); Car myCar = (Car) context.getBean("myCar"); myCar.displayDetails(); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/name/Car.java ================================================ package com.example.autowire.name; public class Car { private Specification specification; public void setSpecification(Specification specification) { this.specification = specification; } public void displayDetails(){ System.out.println("Car Details: " + specification.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/name/Specification.java ================================================ package com.example.autowire.name; public class Specification { private String make; private String model; public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { return "Specification{" + "make='" + make + '\'' + ", model='" + model + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/type/App.java ================================================ package com.example.autowire.type; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("autowireByType.xml"); Car myCar = (Car) context.getBean("myCar"); myCar.displayDetails(); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/type/Car.java ================================================ package com.example.autowire.type; public class Car { private Specification specification; public void setSpecification(Specification specification) { this.specification = specification; } public void displayDetails(){ System.out.println("Car Details: " + specification.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowire/type/Specification.java ================================================ package com.example.autowire.type; public class Specification { private String make; private String model; public String getMake() { return make; } public void setMake(String make) { this.make = make; } public String getModel() { return model; } public void setModel(String model) { this.model = model; } @Override public String toString() { return "Specification{" + "make='" + make + '\'' + ", model='" + model + '\'' + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/autowired/annotation/App.java ================================================ package com.example.autowired.annotation; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); Employee employee = context.getBean("employee", Employee.class); System.out.println(employee.toString()); Manager manager = context.getBean("manager", Manager.class); System.out.println(manager.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/autowired/annotation/AppConfig.java ================================================ package com.example.autowired.annotation; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan(basePackages = "com.example.autowired.annotation") public class AppConfig { } ================================================ FILE: SpringExample/src/main/java/com/example/autowired/annotation/Employee.java ================================================ package com.example.autowired.annotation; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component("employee") public class Employee { private int employeeId; @Value("Hello") private String firstName; @Value("${java.home}") private String lastName; @Value("#{4*4}") private double salary; public int getEmployeeId() { return employeeId; } public void setEmployeeId(int employeeId) { this.employeeId = employeeId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } @Override public String toString() { return "Employee{" + "employeeId=" + employeeId + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", salary=" + salary + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/autowired/annotation/Manager.java ================================================ package com.example.autowired.annotation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.stereotype.Component; @Component public class Manager { @Autowired @Qualifier("employee") private Employee employee; /*@Autowired public Manager(Employee employee) { this.employee = employee; }*/ @Override public String toString() { return "Manager{" + "employee=" + employee + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/componentscan/App.java ================================================ package com.example.componentscan; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("componentScanDemo.xml"); Employee employee = context.getBean("employee", Employee.class); System.out.println(employee.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/componentscan/Employee.java ================================================ package com.example.componentscan; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component("employee") public class Employee { private int employeeId; @Value("Hello") private String firstName; @Value("${java.home}") private String lastName; @Value("#{4*4}") private double salary; public int getEmployeeId() { return employeeId; } public void setEmployeeId(int employeeId) { this.employeeId = employeeId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } @Override public String toString() { return "Employee{" + "employeeId=" + employeeId + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", salary=" + salary + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/example/componentscan/annotation/App.java ================================================ package com.example.componentscan.annotation; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class App { public static void main(String[] args) { ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); Employee employee = context.getBean("employee", Employee.class); System.out.println(employee.toString()); } } ================================================ FILE: SpringExample/src/main/java/com/example/componentscan/annotation/AppConfig.java ================================================ package com.example.componentscan.annotation; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @Configuration @ComponentScan(basePackages = "com.example.componentscan.annotation") public class AppConfig { } ================================================ FILE: SpringExample/src/main/java/com/example/componentscan/annotation/Employee.java ================================================ package com.example.componentscan.annotation; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component("employee") public class Employee { private int employeeId; @Value("Hello") private String firstName; @Value("${java.home}") private String lastName; @Value("#{4*4}") private double salary; public int getEmployeeId() { return employeeId; } public void setEmployeeId(int employeeId) { this.employeeId = employeeId; } public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public double getSalary() { return salary; } public void setSalary(double salary) { this.salary = salary; } @Override public String toString() { return "Employee{" + "employeeId=" + employeeId + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", salary=" + salary + '}'; } } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/IOCExample.java ================================================ package com.ioc.coupling; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class IOCExample { public static void main(String[] args) { ApplicationContext context = new ClassPathXmlApplicationContext("applicationIoCLooseCouplingExample.xml"); UserManager userManagerWithDB = (UserManager) context.getBean("userManagerWithUserDataProvider"); System.out.println(userManagerWithDB.getUserInfo()); UserManager userManagerWithWS = (UserManager) context.getBean("userManagerWithWebServiceProvider"); System.out.println(userManagerWithWS.getUserInfo()); UserManager userManagerWithNewDB = (UserManager) context.getBean("userManagerWithNewDatabaseProvider"); System.out.println(userManagerWithNewDB.getUserInfo()); } } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/NewDatabaseProvider.java ================================================ package com.ioc.coupling; public class NewDatabaseProvider implements UserDataProvider { @Override public String getUserDetails() { return "New Database in action"; } } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/UserDataProvider.java ================================================ package com.ioc.coupling; public interface UserDataProvider { String getUserDetails(); } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/UserDatabaseProvider.java ================================================ package com.ioc.coupling; // A - MySQL, PostgreSQL // B - Web Service, MongoDB public class UserDatabaseProvider implements UserDataProvider { @Override public String getUserDetails(){ // Directly access database here return "User Details From Database"; } } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/UserManager.java ================================================ package com.ioc.coupling; public class UserManager { private UserDataProvider userDataProvider; public UserManager(UserDataProvider userDataProvider) { this.userDataProvider = userDataProvider; } public String getUserInfo(){ return userDataProvider.getUserDetails(); } } ================================================ FILE: SpringExample/src/main/java/com/ioc/coupling/WebServiceDataProvider.java ================================================ package com.ioc.coupling; public class WebServiceDataProvider implements UserDataProvider { @Override public String getUserDetails() { return "Fetching Data From WebService"; } } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/LooseCouplingExample.java ================================================ package com.loose.coupling; public class LooseCouplingExample { public static void main(String[] args) { UserDataProvider databaseProvider = new UserDatabaseProvider(); UserManager userManagerWithDB = new UserManager(databaseProvider); System.out.println(userManagerWithDB.getUserInfo()); UserDataProvider webServiceProvider = new WebServiceDataProvider(); UserManager userManagerWithWS = new UserManager(webServiceProvider); System.out.println(userManagerWithWS.getUserInfo()); UserDataProvider newDatabaseProvider = new NewDatabaseProvider(); UserManager userManagerWithNewDB = new UserManager(newDatabaseProvider); System.out.println(userManagerWithNewDB.getUserInfo()); } } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/NewDatabaseProvider.java ================================================ package com.loose.coupling; public class NewDatabaseProvider implements UserDataProvider{ @Override public String getUserDetails() { return "New Database in action"; } } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/UserDataProvider.java ================================================ package com.loose.coupling; public interface UserDataProvider { String getUserDetails(); } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/UserDatabaseProvider.java ================================================ package com.loose.coupling; // A - MySQL, PostgreSQL // B - Web Service, MongoDB public class UserDatabaseProvider implements UserDataProvider { @Override public String getUserDetails(){ // Directly access database here return "User Details From Database"; } } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/UserManager.java ================================================ package com.loose.coupling; public class UserManager { private UserDataProvider userDataProvider; public UserManager(UserDataProvider userDataProvider) { this.userDataProvider = userDataProvider; } public String getUserInfo(){ return userDataProvider.getUserDetails(); } } ================================================ FILE: SpringExample/src/main/java/com/loose/coupling/WebServiceDataProvider.java ================================================ package com.loose.coupling; public class WebServiceDataProvider implements UserDataProvider{ @Override public String getUserDetails() { return "Fetching Data From WebService"; } } ================================================ FILE: SpringExample/src/main/java/com/tight/coupling/TightCouplingExample.java ================================================ package com.tight.coupling; public class TightCouplingExample { public static void main(String[] args) { UserManager userManager = new UserManager(); System.out.println(userManager.getUserInfo()); } } ================================================ FILE: SpringExample/src/main/java/com/tight/coupling/UserDatabase.java ================================================ package com.tight.coupling; // A - MySQL, PostgreSQL // B - Web Service, MongoDB public class UserDatabase { public String getUserDetails(){ // Directly access database here return "User Details From Database"; } } ================================================ FILE: SpringExample/src/main/java/com/tight/coupling/UserManager.java ================================================ package com.tight.coupling; public class UserManager { private UserDatabase userDatabase = new UserDatabase(); public String getUserInfo(){ return userDatabase.getUserDetails(); } } ================================================ FILE: SpringExample/src/main/resources/applicationBeanContext.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/applicationConstructorInjection.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/applicationIoCLooseCouplingExample.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/applicationSetterInjection.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/autowireByConstructor.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/autowireByName.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/autowireByType.xml ================================================ ================================================ FILE: SpringExample/src/main/resources/componentScanDemo.xml ================================================ ================================================ FILE: ecom-frontend/.gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* node_modules dist dist-ssr *.local # Editor directories and files .vscode/* !.vscode/extensions.json .idea .DS_Store *.suo *.ntvs* *.njsproj *.sln *.sw? .env ================================================ FILE: ecom-frontend/README.md ================================================ # React + Vite This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. Currently, two official plugins are available: - [@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 - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh ================================================ FILE: ecom-frontend/eslint.config.js ================================================ import js from '@eslint/js' import globals from 'globals' import react from 'eslint-plugin-react' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' export default [ { ignores: ['dist'] }, { files: ['**/*.{js,jsx}'], languageOptions: { ecmaVersion: 2020, globals: globals.browser, parserOptions: { ecmaVersion: 'latest', ecmaFeatures: { jsx: true }, sourceType: 'module', }, }, settings: { react: { version: '18.3' } }, plugins: { react, 'react-hooks': reactHooks, 'react-refresh': reactRefresh, }, rules: { ...js.configs.recommended.rules, ...react.configs.recommended.rules, ...react.configs['jsx-runtime'].rules, ...reactHooks.configs.recommended.rules, 'react/jsx-no-target-blank': 'off', 'react-refresh/only-export-components': [ 'warn', { allowConstantExport: true }, ], }, }, ] ================================================ FILE: ecom-frontend/index.html ================================================ Vite + React
================================================ FILE: ecom-frontend/package.json ================================================ { "name": "ecom-frontend", "private": true, "version": "0.0.0", "type": "module", "scripts": { "dev": "vite", "build": "vite build", "lint": "eslint .", "preview": "vite preview" }, "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", "@headlessui/react": "^2.2.9", "@mui/material": "^7.3.7", "@mui/x-data-grid": "^8.25.0", "@reduxjs/toolkit": "^2.11.2", "@stripe/react-stripe-js": "^5.4.1", "@stripe/stripe-js": "^8.6.3", "axios": "^1.13.2", "classnames": "^2.5.1", "react": "^19.2.3", "react-dom": "^19.2.3", "react-hook-form": "^7.71.1", "react-hot-toast": "^2.6.0", "react-icons": "^5.5.0", "react-loader-spinner": "^8.0.2", "react-redux": "^9.2.0", "react-router-dom": "^7.12.0", "swiper": "^12.0.3" }, "devDependencies": { "@eslint/js": "^9.39.2", "@tailwindcss/postcss": "^4.1.18", "@types/react": "^19.2.9", "@types/react-dom": "^19.2.3", "@vitejs/plugin-react": "^5.1.2", "eslint": "^9.39.2", "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.0.1", "eslint-plugin-react-refresh": "^0.4.26", "globals": "^17.0.0", "postcss": "^8.5.6", "tailwindcss": "^4.1.18", "vite": "^7.3.1" } } ================================================ FILE: ecom-frontend/postcss.config.js ================================================ export default { plugins: { '@tailwindcss/postcss': {}, }, } ================================================ FILE: ecom-frontend/src/App.css ================================================ ================================================ FILE: ecom-frontend/src/App.jsx ================================================ import React, { useState } from 'react' import './App.css' import Products from './components/products/Products' import { BrowserRouter as Router, Routes, Route } from 'react-router-dom' import Home from './components/home/Home' import Navbar from './components/shared/Navbar' import About from './components/About' import Contact from './components/Contact' import { Toaster } from 'react-hot-toast' import Cart from './components/cart/Cart' import LogIn from './components/auth/LogIn' import PrivateRoute from './components/PrivateRoute' import Register from './components/auth/Register' import Checkout from './components/checkout/Checkout' import PaymentConfirmation from './components/checkout/PaymentConfirmation' import AdminLayout from './components/admin/AdminLayout' import Dashboard from './components/admin/dashboard/Dashboard' import AdminProducts from './components/admin/products/AdminProducts' import Sellers from './components/admin/sellers/Sellers' import Category from './components/admin/categories/Category' import Orders from './components/admin/orders/Orders' function App() { return ( }/> }/> }/> }/> }/> }> }/> }/> }> }/> }/> }> }> } /> } /> } /> } /> } /> ) } export default App ================================================ FILE: ecom-frontend/src/api/api.js ================================================ import axios from "axios"; const api = axios.create({ baseURL: `${import.meta.env.VITE_BACK_END_URL}/api`, withCredentials: true, }); export default api; ================================================ FILE: ecom-frontend/src/components/About.jsx ================================================ import ProductCard from "./shared/ProductCard"; const products = [ { image: "https://embarkx.com/sample/placeholder.png", productName: "iPhone 13 Pro Max", description: "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.", specialPrice: 720, price: 780, }, { image: "https://embarkx.com/sample/placeholder.png", productName: "Samsung Galaxy S21", description: "Experience the brilliance of the Samsung Galaxy S21 with its vibrant AMOLED display, powerful camera, and sleek design that fits perfectly in your hand.", specialPrice: 699, price: 799, }, { image: "https://embarkx.com/sample/placeholder.png", productName: "Google Pixel 6", description: "The Google Pixel 6 boasts cutting-edge AI features, exceptional photo quality, and a stunning display, making it a perfect choice for Android enthusiasts.", price: 599, specialPrice: 400, } ]; const About = () => { return (

About Us

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

About Us

Our Products

{products.map((product, index) => ( )) }
); } export default About; ================================================ FILE: ecom-frontend/src/components/BackDrop.jsx ================================================ import React from 'react' const BackDrop = ({ data }) => { return (
) } export default BackDrop ================================================ FILE: ecom-frontend/src/components/Contact.jsx ================================================ import { FaEnvelope, FaMapMarkedAlt, FaPhone } from "react-icons/fa"; const Contact = () => { return(

Contact us

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