Skip to content

Commit 17cc32a

Browse files
committed
Fixed the mysqldb and react errors.
1 parent 5b2be5b commit 17cc32a

File tree

8 files changed

+51
-46
lines changed

8 files changed

+51
-46
lines changed

client/package.json

+30-30
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,38 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"@material-ui/core": "latest",
6+
"@material-ui/core": "~4.12.4",
77
"@material-ui/icons": "latest",
88
"@material-ui/lab": "latest",
9-
"@stripe/react-stripe-js": "^1.1.2",
10-
"@stripe/stripe-js": "^1.8.0",
11-
"axios": "^0.19.2",
12-
"env-cmd": "^10.1.0",
13-
"express": "^4.17.1",
14-
"fontsource-roboto": "^2.1.3",
15-
"js-base64": "^2.5.2",
16-
"js-cookie": "^2.2.1",
17-
"lodash": "^4.17.15",
18-
"loglevel": "^1.6.8",
19-
"node-sass": "^4.14.1",
20-
"path": "^0.12.7",
21-
"prop-types": "^15.7.2",
22-
"react": "latest",
23-
"react-dom": "latest",
24-
"react-helmet": "^6.1.0",
25-
"react-id-swiper": "^4.0.0",
26-
"react-redux": "^7.2.0",
27-
"react-router-dom": "^5.2.0",
28-
"react-scripts": "latest",
29-
"react-stripe-checkout": "^2.6.3",
30-
"redux": "^4.0.5",
31-
"redux-form": "^8.3.6",
32-
"redux-thunk": "^2.3.0",
33-
"semantic-ui-css": "^2.4.1",
34-
"semantic-ui-react": "^0.88.2",
35-
"stripe": "^8.78.0",
36-
"styled-components": "^5.1.1",
37-
"swiper": "^5.4.2"
9+
"@stripe/react-stripe-js": "~1.1.2",
10+
"@stripe/stripe-js": "~1.8.0",
11+
"axios": "~0.19.2",
12+
"env-cmd": "~10.1.0",
13+
"express": "~4.17.1",
14+
"fontsource-roboto": "~2.1.3",
15+
"js-base64": "~2.5.2",
16+
"js-cookie": "~2.2.1",
17+
"lodash": "~4.17.15",
18+
"loglevel": "~1.6.8",
19+
"node-sass": "~4.14.1",
20+
"path": "~0.12.7",
21+
"prop-types": "~15.7.2",
22+
"react": "~16.13.0",
23+
"react-dom": "~16.13.0",
24+
"react-helmet": "~6.1.0",
25+
"react-id-swiper": "~4.0.0",
26+
"react-redux": "~7.2.0",
27+
"react-router-dom": "~5.2.0",
28+
"react-scripts": "~3.4.4",
29+
"react-stripe-checkout": "~2.6.3",
30+
"redux": "~4.0.5",
31+
"redux-form": "~8.3.6",
32+
"redux-thunk": "~2.3.0",
33+
"semantic-ui-css": "~2.4.1",
34+
"semantic-ui-react": "~0.88.2",
35+
"stripe": "~8.78.0",
36+
"styled-components": "~5.1.1",
37+
"swiper": "~5.4.2"
3838
},
3939
"scripts": {
4040
"start": "node server.js",

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
volumes:
1313
- ./mysql-db/user.sql:/docker-entrypoint-initdb.d/user.sql
1414
ports:
15-
- 3312:3306
15+
- 3306:3306
1616
networks:
1717
- spring-cloud-microservices
1818

@@ -159,4 +159,4 @@ services:
159159
- spring-cloud-microservices
160160
networks:
161161
spring-cloud-microservices:
162-
external: true
162+
external: true

mysql-db/user.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
GRANT ALL PRIVILEGES ON *.* TO 'springstudent'@'%';
1+
GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'%';

server/common-data-service/src/main/java/com/ujjaval/ecommerce/commondataservice/config/CorsConfig.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ public class CorsConfig implements WebMvcConfigurer
1111
{
1212
@Override
1313
public void addCorsMappings(CorsRegistry registry) {
14-
registry.addMapping("/**").allowedOrigins("https://shoppers-ecom-app.herokuapp.com")
15-
.allowedMethods("GET", "POST");
14+
registry.addMapping("/**");
15+
//registry.addMapping("/**").allowedOrigins("https://shoppers-ecom-app.herokuapp.com")
16+
// .allowedMethods("GET", "POST");
1617
}
1718
}

server/common-data-service/src/main/java/com/ujjaval/ecommerce/commondataservice/service/LoadFakeDataServiceImpl.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public boolean loadFixedPatternData(String filename, FileNameType filenameType)
193193
switch (filenameType) {
194194
case SORT_BY:
195195
for (String line; (line = reader.readLine()) != null; ) {
196-
System.out.println("SortBy Line = " + line);
196+
// System.out.println("SortBy Line = " + line);
197197
String[] result = line.split("\\|");
198198
String id = result[0];
199199
String type = result[1];
@@ -206,7 +206,7 @@ public boolean loadFixedPatternData(String filename, FileNameType filenameType)
206206
break;
207207
case PRICE_RANGE:
208208
for (String line; (line = reader.readLine()) != null; ) {
209-
System.out.println("PriceRange Line = " + line);
209+
// System.out.println("PriceRange Line = " + line);
210210
String[] result = line.split("\\|");
211211
String id = result[0];
212212
String type = result[1];
@@ -271,7 +271,7 @@ public boolean loadTestData() {
271271

272272
if(!priceRangeCategoryList.isEmpty()) {
273273
for(PriceRangeCategory priceRangeCategory: priceRangeCategoryList) {
274-
System.out.println("STORED PRICE RANGE CATEGORY id = " + priceRangeCategory.getId() + "type = "+ priceRangeCategory.getType());
274+
// System.out.println("STORED PRICE RANGE CATEGORY id = " + priceRangeCategory.getId() + "type = "+ priceRangeCategory.getType());
275275
}
276276
} else {
277277
System.out.println("PRICE RANGE CATEGORY LIST IS EMPTY..Hence exiting.....");
@@ -310,8 +310,6 @@ public boolean loadTestData() {
310310
String imageURL = result[7];
311311
String imageLocalPath = replaceSpacesWithUnderscore(String.format("%s/%s/%s", gender, apparel, fileName));
312312

313-
System.out.println("TestData = " + line);
314-
315313
// File file = ResourceUtils.getFile("classpath:static/images_2/" + filePath);
316314
//
317315
// if (!file.isFile()) {
@@ -371,7 +369,7 @@ public boolean loadTestData() {
371369
productBrandCategoryRepository.save(productBrandCategory);
372370
}
373371

374-
System.out.println("price = " + price);
372+
// System.out.println("price = " + price);
375373
Optional<PriceRangeCategory> priceRangeCategory = findPriceRangeCategory(Integer.parseInt(price));
376374

377375
if(priceRangeCategory.isPresent()) {

server/common-data-service/src/main/resources/application.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spring.cache.redis.time-to-live=10
99

1010
# debugging purpose
1111
spring.jpa.properties.hibernate.format_sql=true
12-
logging.level.org.hibernate.SQL=DEBUG
13-
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
14-
logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
15-
logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE
12+
#logging.level.org.hibernate.SQL=DEBUG
13+
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
14+
#logging.level.org.springframework.jdbc.core.JdbcTemplate=DEBUG
15+
#logging.level.org.springframework.jdbc.core.StatementCreatorUtils=TRACE

start-all.sh

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/usr/bin/env bash
22

3+
# Stop and delete the containers
4+
#docker-compose down
5+
6+
# Stop and delete the containers
7+
docker-compose stop
8+
39
# Deleting network if available
410
docker network rm spring-cloud-microservices
511

stop-all.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
docker-compose down
55

66
# Deleting network
7-
docker network rm spring-cloud-microservices
7+
docker network rm spring-cloud-microservices

0 commit comments

Comments
 (0)