마지막 강의 영상에서 배포 자료는 어디서 볼 수 있나요?
미해결
따라하며 배우는 NestJS
마지막 강의 영상에서 짧게 등장한 배포에 관한 자료는 어느 강의에서 찾아서 볼 수 있을까요? 자료를 보면서 공부를 하고 싶어 질문 남깁니다!
- postgresql
- nestjs
- typeorm
- 배포
- cicd
172만명의 커뮤니티!! 함께 토론해봐요.
미해결
따라하며 배우는 NestJS
마지막 강의 영상에서 짧게 등장한 배포에 관한 자료는 어느 강의에서 찾아서 볼 수 있을까요? 자료를 보면서 공부를 하고 싶어 질문 남깁니다!
해결됨
실전! 스프링 부트와 JPA 활용2 - API 개발과 성능 최적화
2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2023-10-09T19:14:55.542+09:00 INFO 2455 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 0 ms 2023-10-09T19:14:55.660+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 offset ? rows fetch first ? rows only 2023-10-09T19:14:55.662+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495662 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 offset ? rows fetch first ? rows only select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 offset 0 rows fetch first 100 rows only; 2023-10-09T19:14:55.668+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select m1_0.member_id, m1_0.city, m1_0.street, m1_0.zipcode, m1_0.name from member m1_0 where array_contains(?,m1_0.member_id) 2023-10-09T19:14:55.672+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495672 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select m1_0.member_id,m1_0.city,m1_0.street,m1_0.zipcode,m1_0.name from member m1_0 where array_contains(?,m1_0.member_id) select m1_0.member_id,m1_0.city,m1_0.street,m1_0.zipcode,m1_0.name from member m1_0 where array_contains('ar0: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT)]',m1_0.member_id); 2023-10-09T19:14:55.674+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select d1_0.id, d1_0.city, d1_0.street, d1_0.zipcode, d1_0.status from delivery d1_0 where array_contains(?,d1_0.id) 2023-10-09T19:14:55.674+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495674 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select d1_0.id,d1_0.city,d1_0.street,d1_0.zipcode,d1_0.status from delivery d1_0 where array_contains(?,d1_0.id) select d1_0.id,d1_0.city,d1_0.street,d1_0.zipcode,d1_0.status from delivery d1_0 where array_contains('ar1: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT)]',d1_0.id); 2023-10-09T19:14:55.676+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.677+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495677 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=1; 2023-10-09T19:14:55.677+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.678+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495678 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=2; 2023-10-09T19:14:55.680+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.order_item_id, o1_0.count, o1_0.item_id, o1_0.order_price from order_item o1_0 where array_contains(?,o1_0.order_id) 2023-10-09T19:14:55.686+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495686 | took 5ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.order_item_id,o1_0.count,o1_0.item_id,o1_0.order_price from order_item o1_0 where array_contains(?,o1_0.order_id) select o1_0.order_id,o1_0.order_item_id,o1_0.count,o1_0.item_id,o1_0.order_price from order_item o1_0 where array_contains('ar2: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL]',o1_0.order_id); 2023-10-09T19:14:55.687+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select i1_0.item_id, i1_0.dtype, i1_0.name, i1_0.price, i1_0.stock_quantity, i1_0.artist, i1_0.etc, i1_0.author, i1_0.isbn, i1_0.actor, i1_0.director from item i1_0 where array_contains(?,i1_0.item_id) 2023-10-09T19:14:55.688+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495688 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select i1_0.item_id,i1_0.dtype,i1_0.name,i1_0.price,i1_0.stock_quantity,i1_0.artist,i1_0.etc,i1_0.author,i1_0.isbn,i1_0.actor,i1_0.director from item i1_0 where array_contains(?,i1_0.item_id) select i1_0.item_id,i1_0.dtype,i1_0.name,i1_0.price,i1_0.stock_quantity,i1_0.artist,i1_0.etc,i1_0.author,i1_0.isbn,i1_0.actor,i1_0.director from item i1_0 where array_contains('ar3: ARRAY [CAST(1 AS BIGINT), CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(4 AS BIGINT)]',i1_0.item_id); 이 결과값에서 강의랑 다른 부분이 있어서 질문 드립니다 하이버네이트 6.2 라서 array_contains 인거 아는데 아래 부분이 이해가 안됩니다. select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.677+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495677 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=1; 2023-10-09T19:14:55.677+09:00 DEBUG 2455 --- [nio-8080-exec-1] org.hibernate.SQL : select o1_0.order_id, o1_0.delivery_id, o1_0.member_id, o1_0.order_date, o1_0.status from orders o1_0 where o1_0.delivery_id=? 2023-10-09T19:14:55.678+09:00 INFO 2455 --- [nio-8080-exec-1] p6spy : #1696846495678 | took 0ms | statement | connection 7| url jdbc:h2:tcp://localhost/~/jpanew select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=? select o1_0.order_id,o1_0.delivery_id,o1_0.member_id,o1_0.order_date,o1_0.status from orders o1_0 where o1_0.delivery_id=2; orders 를 처음에 조회하고 나서 또 추가적으로 o1_0.delivery_id=? 이걸로 조회하는 결과가 왜 생기는걸까요?.. (배치사이즈도 강의랑 똑같이 100입니다) OrderApiController.java @GetMapping("/api/v3.1/orders") public List<OrderDto> ordersV3_page(@RequestParam(value ="offset",defaultValue = "0") int offset, @RequestParam(value ="limit",defaultValue = "100") int limit) { List<Order> orders = orderRepository.findAllWithMemberDelivery(offset,limit); List<OrderDto> result = orders.stream() .map(o -> new OrderDto(o)) .collect(Collectors.toList()); return result; } OrderRepository.java public List<Order> findAllWithMemberDelivery(int offset, int limit) { return em.createQuery( "select o from Order o" , Order.class ).setFirstResult(offset) .setMaxResults(limit) .getResultList(); } 이렇게 바꾸고 난 이후에 일어난 결과입니당.. 강의랑 In말고도 추가적으로 다른 부분이 있어서 질문드립니다 일단 제 스프링부트 버전은 3.1.3 입니다.
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
프론트엔드에서 진행할 때는 이런 이상이 없었습니다 postman으로 로그인 했고, 바탕화면에서 바로 이미지 업로드하려고 하니 'This file isn't in your working directory' 라는 에러가 나와서 구글링하니 포스트맨으로 이미지 업로드하려면 지정된 경로에서 업로드해야한다고 하더라구요. 포스트맨 설정에서 경로 찾아서 C:\Users\admin\Postman\files에 업로드할 이미지 넣고, 다시 로그인 한 다음 강의대로 진행하니 아래 사진과 같이 나옵니다 Unauthorized이니 jwt와 컨트롤러 이미지 업로드 api의 JwtAuthGuard 부분이 문제라고 생각되는데.. 어떻게 확인을 해보면 될까요? 조언 부탁드립니다.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
jest 를 이용하여 테스트코드를 짜고 있는데 처음이라 너무 어렵네요. softdelete는 어떤식으로 테스트코드를 짜야될까요? 그리고 조인해서 결과 값을 뽑을 때 테스트코드를 어떻게 짜야할지 감이 안옵니다. 구글링해도 자료가 별로 없네여...
미해결
자바 ORM 표준 JPA 프로그래밍 - 기본편
안녕하세요! 강의영상에서는 가능한 많은 예제를 보여주려고 다양한 연관관계 매핑을 사용했다고 하셨는데 단방향을 지향하는 실무 관점에서 궁금한게 있습니다. Order N:1 Member => 다대일 단방향이 가능한지 OrderItem N:1 Order => 다대일 단방향이 가능한지 Order와 Delivery 관계에서 단방향이 안되는 이유 Item과 Category를 일대다, 다대일로 풀어내는게 맞는지 답변해주시면 감사하겠습니다!!
해결됨
Slack 클론 코딩[백엔드 with NestJS + TypeORM]
12:00 시작된 join 매서드를 만들고 실행을 시켜보니 에러 처리를 하면 커넥션 pool이 종료되지 않는거 같습니다. 이메일이 중복된 user를 insert하려 할 때 new ForbiddenException이 실행이 됩니다. 하지만 finally문이 실행이 안되는거 같습니다. async join(email: string, nickname: string, password: string) { const queryRunner = this.dataSource.createQueryRunner(); await queryRunner.connect(); await queryRunner.startTransaction(); const user = await queryRunner.manager .getRepository(Users) .findOne({ where: { email } }); if (user) { throw new ForbiddenException('이미 존재하는 사용자입니다'); } const hashedPassword = await bcrypt.hash(password, 12); try { const returned = await queryRunner.manager.getRepository(Users).save({ email, nickname, password: hashedPassword, }); const workspaceMember = queryRunner.manager .getRepository(WorkspaceMembers) .create(); workspaceMember.User = returned.id; workspaceMember.Workspace = 1; // throw new NotFoundException('롤백해봐'); await queryRunner.manager .getRepository(WorkspaceMembers) .save(workspaceMember); await queryRunner.manager.getRepository(ChannelMembers).save({ User: returned.id, ChannelId: 1, }); await queryRunner.commitTransaction(); return true; } catch (error) { console.error(error); await queryRunner.rollbackTransaction(); throw error; } finally { console.log('이거 실행됨?'); await queryRunner.release(); } } '이거 실행됨?' 이라는 문자가 출력이 되지 않습니다. 여러번 반복한 후 pgAdmin에서 database activity를 살펴보니 커넥션 pool이 release되지 않고 idle 상태로 되어있습니다. 이 때문에 서버의 pool이 가득차서 서버가 종료됩니다. user의 중복검사도 try문 안에 넣으면 해결되는거 같습니다. 🟩 혹시 존재하는 사용자 로직을 try문 밖에 빼신 이유가 있는지 궁금합니다.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
선생님, 질문두가지 드릴게요, 감사합니다 1. nestjs+graphql로 작업할때 response도 dto로 만들어야하나요? 2. class-validator를 entity에서 사용하고 dto를 pick, omit으로 상속받는게 좋나요? 아니면 dto들에서 따로 class-validator를 적용하는게 좋나요?
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
async findCatByIdWithoutPassword(id: string): Promise<Cat | null> { const cat = await this.catModel.findById(id).select('-password'); return cat; } 위 함수에서 Pomise의 반환값이 Cat 또는 null인데 cat은 password가 없는 Cat이라서 Cat이라고 할 수 없는데 return을 cat으로 해도 에러가 안나는 이유를 알고 싶습니디.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
docker-compose 에 있는 my-database의 연결 app.module.ts에 있는 typeOrmModule에 있는 데이터베이스 연결이 어떤 원리로 작동되는지 궁금합니다. my-database: image: mysql:latest environment: MYSQL_DATABASE: 'mydocker' MYSQL_ROOT_PASSWORD: 'root' ports: - 3306:3306 TypeOrmModule.forRoot({ //.env 파일은 모두 string 형태로 인식이 됩니다. 따라서, type과 port에 추가 설정을 해주었습니다. type: mysql, host: "localhost", port: 3306, username: "root", password: "12345678", database: practice, entities: [Board], synchronize: true, logging: true, })
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
코드 자동저장돼 있고 혹시몰라 수동저장 후 다시 라이브서버 켰는데 박스까지만 만들어지고 정렬이 전혀 되지 않으면서 아무 응답이 없는데 제가 혹시 코드를 잘못 쓴 부분이 있는걸까요?
미해결
Kevin의 알기 쉬운 Spring Reactive Web Applications: Reactor 1부
안녕하세요. Backpressure의 Drop 전략에서 버퍼가 비워질 때까지 Emit된 데이터가 Drop이 된다는 것은 이해했습니다. 그런데 1번 데이터가 subscriber에게 전달되어서 처리가 되면 버퍼에 자리가 한 자리 비게 되는데 왜 데이터가 계속 Drop이 되는건가요? (코드 실습에서 onNext()함수가 호출이 되어도 255,256,257 ~ 1024까지 모두 드랍됨) | 1, 2 | <-------- 3 듣랍 | 2, |. <-------- 4 드랍 (여기서 왜 4번 데이터는 안들어가나요?) | 5, 6 | Buffer DROP-LATEST를 보면 | 1, 2 | <---- 3들어오는 중 버퍼 가득 차서 drop | 2, 4 | <------ 1번이 버퍼에서 나가고 한 자리가 비어서 4번이 들어와짐 이런식으로 동작을 하는데 Drop은 이렇게 동작하지 않는 것 같아 버퍼가 어떻게 동작하는지 궁금하여 질문드립니다.
해결됨
Slack 클론 코딩[백엔드 with NestJS + TypeORM]
안녕하세요 제로초님~! 최근에 socket.io 문제를 해결해주셔서 감사합니다. 제로초님 덕분에 몇주간 있었던 불면증이 사라졌습니다. 이번에 드리고자 하는 질문은 백엔드 api 서버와 리액트 로컬호스트의 websocket 연결에서 cors 에러가 사라지지 않고 있다는 것입니다. 프론트와 백엔드 둘다 localhost 로 사용했을땐 문제 없이 잘 작동하였으나, 백엔드 api 서버와 프론트(리액트) http:// localhost :3000 로 연결하려 하니 cors 에러가 사라지질 않네요. 백엔드 api 서버주소는 https://api.yubinhome.com/ 이고, traefik 을 사용해 https 인증을 받고 있습니다. 제가 어떤 부분을 놓친 것인지 함께 봐주실 수 있을까요? 에러메시지 Access to XMLHttpRequest at 'http://api.yubinhome.com/socket.io/?EIO=4&transport=polling&t=Ohzm2C T' from origin 'http://localhost:300 0' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request. GET http://api.yubinhome.com/socket.io/?EIO=4&transport=polling&t=OhzmhT k net::ERR_FAILED 요청헤더 응답헤더 시도 해 본 방법 1. 공식 문서에 나온대로 api url 에 직접 연결해보니 서버가 작동하고 있는 것은 확실해보입니다. 소켓io 공식문서 cors : https://socket.io/docs/v3/handling-cors/#troubleshooting 2. 서버측 origin, credetials 를 설정하였습니다. origin : "*" 가 문제인가 싶어 http://localhost:3000 url 을 직접 주었습니다. 클라이언트 측에는 withCredentials: true 을 설정해주었습니다. 백엔드 api 서버 코드 https://github.com/fog-of-war/dev-be/blob/dev/src/events/events.gateway.ts @WebSocketGateway({ cors: { origin: "http://localhost:3000", methods: ["GET", "POST"], allowedHeaders: ["authorization", "Authorization"], credentials: true, }, namespace: /\/ws-.+/, transports: ["websocket", "polling"], }) 리액트 코드 https://github.com/fog-of-war/dev-fe/blob/46a8de3a13de4039e9aa511a07cfeea23d8a85fa/src/components/Notifications/NoticeNotifications.tsx REACT_APP_API_URL =https://api.yubinhome.com / REACT_APP_SOCKET_URL=ws:/ /api.yubinhome.com/v1/ws-aler t let socket: any = null; socket = io(socketUrl + "-" + userId, { withCredentials: true, extraHeaders: { Authorization: `Bearer ${sanitizedToken}`, }, });
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
yml파일,mongo 파일,Dockerfile 만들고 docker-compose build docker-compose up 하고 다른 쉘에서 docker ps했는데 아무것도 안뜹니다 파일은 제대로 따라 적었는데도 오류 뜨고 몽고 db는 삭제했고 몽고db 컴패스는 오류걸려서 그냥 삭제했습니다
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
해당 장을 설명해주실 때 철수가 1050번째, 영희가 2050번째라고 가정했을때, 수직 파티셔닝 된 데이터베이스 중 어디에 있는지는 미리 알 수 있는 방법이 있을까요?
미해결
탄탄한 백엔드 NestJS, 기초부터 심화까지
>> 갱신, 2023. 10. 06 해결했습니다. https://github.com/amamov/teaching-nestjs-a-to-z/tree/frontend 위 링크 설명 따라 nestjs root 디렉토리에서 git clone 받고, npm install, npm run dev 하니까 잘 실행되네요 $ npm run dev > frontend@0.1.0 dev > next start ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\.env 잘못된 파일을 받았던것 같습니다.. 어느 질문글에서 본 링크 따라서 들어가서 받았던거로 기억하는데.. 어느 글이었는지 다시 찾아도 보이지 않네요.. >> 질문글, 2023. 10. 04 학습자료 frontend를 다운 받았고, 이 폴더를 05 NestJS 실전 프로젝트와 같은 위치에 두었습니다. 이후 프론트엔드 코드 실행 방법 강의를 보고 frontend 디렉토리로 들어가 npm i를 입력하였습니다 admin@DESKTOP-ALLM3V0 MINGW64 ~/OneDrive/바탕 화면/learning_NestJS/frontend (master) $ npm i npm WARN old lockfile npm WARN old lockfile The package-lock.json file was created with an old version of npm, npm WARN old lockfile so supplemental metadata must be fetched from the registry. npm WARN old lockfile npm WARN old lockfile This is a one-time fix-up, please be patient... npm WARN old lockfile npm WARN deprecated @types/antd@1.0.0: This is a stub types definition for antd (https://github.com/ant-design/ant-design). antd provides its own type definitions, so you don't need @types/antd installed! npm WARN deprecated @types/axios@0.14.0: This is a stub types definition for axios (https://github.com/mzabriskie/axios). axios provides its own type definitions, so you don't need @types/axios installed! npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. added 368 packages, and audited 369 packages in 24s 48 packages are looking for funding run `npm fund` for details 15 vulnerabilities (3 moderate, 7 high, 5 critical) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. 위와 같이 경고 메세지가 나왔고... 이 상태에서 npm run dev를 입력하였더니 admin@DESKTOP-ALLM3V0 MINGW64 ~/OneDrive/바탕 화면/learning_NestJS/frontend (master) $ npm run dev > frontend@0.1.0 dev > next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\.env info - Using webpack 5. Reason: no next.config.js https://nextjs.org/docs/messages/webpack5 Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 node:internal/crypto/hash:71 this[kHandle] = new _Hash(algorithm, xofLen); ^ Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:71:19) at Object.createHash (node:crypto:133:10) at BulkUpdateDecorator.hashFactory (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133790:18) at BulkUpdateDecorator.update (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:133692:50) at OriginalSource.updateHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack-sources2\index.js:1:19148) at NormalModule._initBuildHash (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65772:17) at handleParseResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65837:10) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65928:4 at processResult (C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65651:11) at C:\Users\admin\OneDrive\바탕 화면\learning_NestJS\frontend\node_modules\next\dist\compiled\webpack\bundle5.js:65711:5 { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSUPPORTED' } Node.js v18.16.0 위와 같은 에러가 발생하며 프론트엔드가 웹 서버가 실행되지 않고 있습니다.. 이러한 상황에서는 어떻게 진행하면 좋을지 조언 부탁드립니다.
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
create({productSalesLocation}): Promise<ProductSalesLocation>{ return this.productsSalesLocationsRepository.save({...productSalesLocation}); } 강의 중 위와 같은 코드를 작성해주셨는데, create의 parameter type은 ProductSalesLocation(Entity)의 타입에서 id만 제외하고 사용하는 형태로 작성하는 것이 맞을까요?
해결됨
[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
다음처럼 DeletedDateColumn 데코레이터를 붙인 deletedAt은 db에서 nullable이니까 optional 타입으로 하는 것이 맞을까요? @DeleteDateColumn() deletedAt?: Date; 공식 문서에서는 optional 타입으로 되어 있지는 않네요 https://orkhan.gitbook.io/typeorm/docs/decorator-reference#deletedatecolumn
미해결
실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
강사 님께서는 객체를 인스턴스화 하실 때, 생성자를 사용하거나, 정적 팩토리 메서드를 사용하는 방식 2가지를 이용하셨는데 혹시 코틀린에서 builder 패턴을 사용하는건 어떻게 생각하시나요?? defalut 파라미터를 이용하고 naming을 통해 builder패턴 처럼 사용할 수 는 있겠지만 java에서 builder패턴을 통해 객체를 만들었던 것에 비하면 불편하다는 생각이듭니다. 조언 해주시면 감사하겠습니다.
미해결
재고시스템으로 알아보는 동시성이슈 해결방법
안녕하세요, 강의를 보고 공부를하다 궁금한 점이 생겨 질문드립니다. 제가 예측한 강의 내용으로는, "경쟁 상태 예시(재고 수량)에 대하여 레디스 를 활용한다." 라고 예측 했습니다. 이에 대하여, "레디스는 싱글 스레드 기반이니깐, 락킹 없이 해당 작업이 가능할 것" 이라고 추측하였는데요, 그러나 제가 생각지 못한 레디스 lock 과 관련된 내용을 접하게 되어 신기하면서도 또 궁금한 부분이 생겨 질문드립니다. 레디스 락 전략이 사용되는 이유와 예시를 조금더 들어볼 수 있을까요? 혹은 이와 관련하여 추가적으로 공부해볼 수 있는 자료를추천해주시면 감사하겠습니다.
해결됨
실전! Querydsl
갱신된 강의자료에도 나와 있듯이, fetchResult, fetchCount 등의 메소드는 deprecated 예정입니다. 또한 해당 메소드는 Page 타입을 반환하기 때문에 Page 타입을 직접적으로 조작해야 한다는 제약이 있습니다. 이걸 잘 쓰면 되는데, Page 의 시작번호 등 제약도 있어서 저는 회사에서 Page 를 따로 만들어서 사용하거든요. 그래서 search 메소드와 count 메소드는 항상 분리하고 있습니다. 2. 그런 점에서 count 만 최적화하는 로직만 베껴서 만든 최적화 메소드입니다. 실제로 count 구문을 실행하기 위한 메소드입니다. 필요에 따라서 public 으로 만들어도 될 것 같네요. // count 실행 메소드 private Long countByCond(MemberSearchCond cond) { return query .select(member.countDistinct()) .from(member) .where( usernameEq(cond.getUsername()), teamNameEq(cond.getTeamName()), ageGoe(cond.getAgeGoe()), ageLoe(cond.getAgeLoe()) ) .fetchOne(); } 최적화 로직을 베낀 메소드입니다. 스프링 데이터 JPA 는 아래 코드와 같이 page, size 값이 null 이 아니고, 적절한 범위에 있는지를 판단하여 isPaged 라는 분기를 만듭니다. 참고로 코드를 분석하면서 내린 뇌피셜이니 혹시 틀리다면 말씀해주세요. page 가 0 이 아니라 1 부터 시작하는 건 제 취향입니다. 회사에서 그렇게 쓰고 있거든요. 필요에 따라 0 부터 시작하도록 바꾸는 건 어렵지 않을 것 같습니다. public Long countByCondOptimization(List<?> content, MemberSearchCond cond, Long page, Long size) { boolean isPaged = page != null && size != null && page > 0 && size > 0; long offset = isPaged ? (page - 1) * size : 0L; long contentSize = content.size(); if (!isPaged || offset == 0) { if (!isPaged || size > contentSize) { return contentSize; } return this.countByCond(cond); } if (contentSize != 0 && size > contentSize) { return offset + contentSize; } return this.countByCond(cond); } 이렇게 하여 count 쿼리를 리스트 조회 쿼리와 분리하여 재사용성을 높이면서, 성능도 최적화할 수 있습니다. 감사합니다.