eShopping Application implemented with Spring Boot, Spring Security, Spring Data and Spring Session
Make sure docker is up and running on your local machine
-
Download the repo and execute the following commands in the same order
-
Build the project
$ mvn clean package -DskipTests
-
Build eShopping docker image
$ docker build -t eshopping .
-
Create docker network
$ docker network rm eshopping_network $ docker network create eshopping_network
-
Run MySql instance in the same docker network. This will help to resolve database hostname using the docker container name. Make sure to change the MYSQL_ROOT_PASSWORD placeholder
$ docker stop db && docker rm db $ docker run --name db -e MYSQL_ROOT_PASSWORD=<db_password> -e MYSQL_DATABASE="eshopping" --network=eshopping_network -p 3306:3306 -d mariadb
-
Run eShopping application in the same docker network.
$ docker stop eshopping && docker rm eshopping $ docker run -e DB_USERNAME=root -e DB_PASSWORD=<db_password> -e DB_URL='jdbc:mysql://db:3306/eshopping?serverTimezone=UTC' -e ACTIVE_PROFILE=dev --network=eshopping_network -p 8082:8082 eshopping
-
Load data into MySql database by following steps from here
-
That's it you should be able to access the application using the link http://localhost:8082/api/v1/category/list and use credentials admin/admin as password
- Create database named eshopping on Mysql or MariaDb
- Import the project on IntelliJ and Run it. It will create all the tables required
- Execute steps 3,4 and 5 in the same order. Go to User_Data_SqlCommands.txt and copy all the commands and execute them in to Mysql Workbench or MySql shell
- Go to Insert_Country_State_City_TaxRate_Data.txt and copy all the commands and execute them in to Mysql Workbench or MySql shell
- Go to Insert_Category_Manufacturer_Product_Data_SqlCommands.txt and copy all the commands and execute them in to Mysql Workbench or MySql shell
- Go to http://localhost:8082/api/v1/manufacturer/list and enter admin/admin(username and password) to see list of manufacturers
- If the login credentils does not work in step 6, go to BCrypt online tool https://www.browserling.com/tools/bcrypt and enter your admin password and select rounds as 12 and copy generated encrypted password.
- Go to Mysql workbench and update admin user password with the following SQL statement. Replace with the password created in step 7
UPDATE `eshopping`.`user` SET `password`=<encrypted password> WHERE `username`='admin';
- For better experience go to my Angular9 project eShopping-UI and run it see nice UI
- Java 11
- Spring Boot and listed Spring modules
- Spring Data JPA
- Spring Security
- Spring AOP
- Spring Session
- Spring Cache
- MySQL database