Giter Site home page Giter Site logo

zhulinn / springboot-angular7-online-shopping-store Goto Github PK

View Code? Open in Web Editor NEW
360.0 26.0 287.0 181 KB

🛒An e-commerce shopping website. Docker, Java 11, REST API, JWT, Bootstrap, 购物车, 电子商城

Home Page: https://springboot-angular-shop.herokuapp.com/

JavaScript 1.08% TypeScript 31.59% HTML 17.04% CSS 0.19% Java 49.92% Dockerfile 0.17%
spring-boot angular7 jwt boostrap java11-maven springsecurity springjpa docker

springboot-angular7-online-shopping-store's Introduction

Online Shop Application

A full-stack Online Shop web application using Spring Boot 2 and Angular 7.

This is a Single Page Appliaction with client-side rendering. It includes backend and frontend two seperate projects on different branches. The frontend client makes API calls to the backend server when it is running.

This project is based on my previous project Online-Shopping-Store, which uses FreeMarker as template engine for server-side rendering.

Live Demo: https://springboot-angular-shop.herokuapp.com/ Heroku has removed free tier on Postgres, the demo is no longer working...:(

For Heroku application repo cloning, please check Angular7-SpringBoot-hybrid-project.

Screenshot

Features

  • REST API
  • Docker
  • Docker Compose
  • JWT authentication
  • Cookie based visitors' shopping cart
  • Persistent customers' shopping cart
  • Cart & order management
  • Checkout
  • Catalogue
  • Order management
  • Pagination

Technology Stacks

Backend

  • Java 11
  • Spring Boot 2.2
  • Spring Security
  • JWT Authentication
  • Spring Data JPA
  • Hibernate
  • PostgreSQL
  • Maven

Frontend

  • Angular 7
  • Angular CLI
  • Bootstrap

Database Schema

How to Run

Start the backend server before the frontend client.

Backend

  1. Install PostgreSQL
  2. Configure datasource in application.yml.
  3. cd backend.
  4. Run mvn install.
  5. Run mvn spring-boot:run.
  6. Spring Boot will import mock data into database by executing import.sql automatically.
  7. The backend server is running on localhost:8080.

Frontend

  1. Install Node.js and npm
  2. cd frontend.
  3. Run npm install.
  4. Run ng serve
  5. The frontend client is running on localhost:4200.

Note: The backend API url is configured in src/environments/environment.ts of the frontend project. It is localhost:8080/api by default.

Run in Docker

You can build the image and run the container with Docker.

  1. Build backend project
cd backend
mvn package
  1. Build fontend project
cd frontend
npm install
ng build --prod
  1. Build images and run containers
docker-compose up --build

springboot-angular7-online-shopping-store's People

Contributors

zhulinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

springboot-angular7-online-shopping-store's Issues

Lombok error

I don't know why if i implement the project the "@" function throws : can not found the function getXXX()

Cant find object

May i know what the environment you use? im getting this using openjdk13..

image

Error in frontend build

When i run "npm install" it return "Error: error:0308010C:digital envelope routines::unsupported". i think is a problem with openssl in node.js

can't use mvn install

[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< me.zhulin:shop-api >-------------------------
[INFO] Building shop-api 0.0.1-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom
Downloading from spring-milestones: https://repo.spring.io/milestone/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.pom (6.4 kB at 24 kB/s)
Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/apache/maven/plugins/maven-plugins/25/maven-plugins-25.pom
Downloading from spring-milestones: https://repo.spring.io/milestone/org/apache/maven/plugins/maven-plugins/25/maven-plugins-25.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/25/maven-plugins-25.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-plugins/25/maven-plugins-25.pom (9.6 kB at 95 kB/s)
Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/apache/maven/maven-parent/24/maven-parent-24.pom
Downloading from spring-milestones: https://repo.spring.io/milestone/org/apache/maven/maven-parent/24/maven-parent-24.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/24/maven-parent-24.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-parent/24/maven-parent-24.pom (37 kB at 315 kB/s)
Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/apache/apache/14/apache-14.pom
Downloading from spring-milestones: https://repo.spring.io/milestone/org/apache/apache/14/apache-14.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/apache/14/apache-14.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/apache/14/apache-14.pom (15 kB at 117 kB/s)
Downloading from spring-snapshots: https://repo.spring.io/snapshot/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.jar
Downloading from spring-milestones: https://repo.spring.io/milestone/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-install-plugin/2.5.2/maven-install-plugin-2.5.2.jar (33 kB at 591 kB/s)
[INFO]
[INFO] --- resources:3.1.0:resources (default-resources) @ shop-api ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- compiler:3.8.1:compile (default-compile) @ shop-api ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 43 source files to C:\Users\84337\OneDrive - Tra Vinh University\Máy tính\SUCCESS\SpringBoot-Angular7-Online-Shopping-Store\backend\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.360 s
[INFO] Finished at: 2023-07-01T19:04:51+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project shop-api: Fatal error compiling: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x5db90818) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x5db90818 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

broken install

C:\Users\Lord\source\repos\SpringBoot-Angular7-Online-Shopping-Store-master\frontend>npm install

[email protected] install C:\Users\Lord\source\repos\SpringBoot-Angular7-Online-Shopping-Store-master\frontend\node_modules\node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.10.0/win32-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.10.0/win32-x64-83_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall C:\Users\Lord\source\repos\SpringBoot-Angular7-Online-Shopping-Store-master\frontend\node_modules\node-sass
node scripts/build.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.