묻고 답해요
129만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
5분 경에 질문있습니다.
@Post() @UseGuards(AccessTokenGuard) @UseInterceptors(TransactionInterceptor) async postPost(@User("id") userId: number, @Body() body: CreatePostDto, @QueryRunner() qr: QR) { // temp -> posts로 옮긴다음에 포스팅 const post = await this.postsService.createPost(userId, body, qr); // throw new InternalServerErrorException("에러가 생겼습니다."); // 포스트만 생성하고, 이미지는 생성안해버림 throw 에러에서 걸림. 원래는 포스트 게시글이 생기면 안됨. for (let i = 0; i < body.images.length; i++) { await this.PostsImagesService.createPostImage( { post, order: i, path: body.images[i], type: ImageModelType.POST_IMAGE, }, qr, ); } // Transaction 타입에 따라서 Transaction이 커밋 되기전에 최신 값을 가져오지 못할 수 있다. (service에서 해당 문제 처리 직접 qr받아서) // 가장 최근상태의 포스트를 받아와서, 반환해줌. return this.postsService.getPostById(post.id, qr);Transaction 타입에 따라서 Transaction이 커밋 되기 전에 최신 값을 가져오지 못할 수 있다고 하셔서, getPostById service에서 직접적으로 qr을 주입받아서, 사용했는데 정확히 어떤 이유로 최신 값을 못받아오는지 잘 이해가 안가서, 자세히 설명을 해주실 수 있나요?
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
프로젝트가 만들어지지 않습니다.
맥북 m1으로 똑같이 설정을 했습니다.그리고 npx react-native init MatzipApp으로 프로젝트를 실행하면 아래오 같은 메시지가 나옵니다. Downloading template ✔ Copying template ⠸ Processing template➤ YN0000: Retrieving https://repo.yarnpkg.com/3.6.4/packages/yarnpkg-cli/bin/yarn.js ⠙ Processing template➤ YN0000: Saving the new release in ../../../.yarn/releases/yarn-3.6.4.cjs ➤ YN0000: Done in 0s 666ms ⠼ Processing template➤ YN0000: Successfully set nodeLinker to 'node-modules' ✔ Processing template ⠸ Installing dependencieserror Installing pods failed. This doesn't affect project initialization and you can safely proceed. However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section. ✖ Installing dependencies info 💡 To enable automatic CocoaPods installation when building for iOS you can create react-native.config.js with automaticPodsInstallation field. For more details, see https://github.com/react-native-community/cli/blob/main/docs/projects.md#projectiosautomaticpodsinstallation ✔ Initializing Git repository Run instructions for Android: • Have an Android emulator running (quickest way to get started), or a device connected. • cd "/Users/xxx/React-Project/React-Native/MatzipApp" && npx react-native run-android Run instructions for iOS: • cd "/Users/sss/React-Project/React-Native/MatzipApp/ios" • Install Cocoapods • bundle install # you need to run this only once in your project. • bundle exec pod install • cd .. • npx react-native run-ios - or - • Open MatzipApp/ios/MatzipAppcd .xcodeproj in Xcode or run "xed -b ios" • Hit the Run button Run instructions for macOS: • See https://aka.ms/ReactNativeGuideMacOS for the latest up-to-date instructions.이런 메시지가 뜨고 npm run start로 실행을 하면 command not found메시지가 뜨면서 애뮬레이터도 실행이 안됩니다.ㅠㅠ
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
[6-7] FeedDetail화면에서 뒤로가기시(goBack) 질문
안녕하세요.하단 탭 메뉴 중 즐겨찾기 탭으로 이동하여 FeedItem 선택 후 FeedDetail 화면으로 이동한 후 뒤로 가기를 누르면 즐겨찾기 탭 으로 가는게 아니라 FeedHome 탭으로 이동합니다.즐겨찾기탭으로 돌아가게 하려면 어떻게 해야 될까요. ❗질문 작성시 참고해주세요최대한 상세히 현재 문제(또는 에러)와 코드(또는 github)를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다.맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요!
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
docker-compose.yml 파일 환경변수 관리
안녕하세요,docker-compose.yml 파일 같은 경우는 .gitignore 처리를 하는 파일인지, 아니면 이 부분도 환경변수로 데이터 접근하는 값들을 환경변수로 바꿔줘야하는지 어떻게 관리하는지 알고 싶어 질문드립니다.
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
ios 앱 심사 정보
안녕하세요 친절한 강의에 정말 감사드립니다^^ios앱 심사 정보 작성에 여쭤볼게 있는데요.심사 과정에 통과하려면 backend 배포가 된 상태여야 심사가 가능하니, backend 배포가 선행돼야 하는건가요?앱에 로그인할 수 있도록 사용자 이름 및 암호를 입력하십시오. 앱 심사를 완료하려면 로그인 정보가 필요합니다.
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
No overload matches this call.
안녕하세요 강사님강의 진행중에 아래와 같은 안내가 있는데 제공해주신 강의 깃헙 코드와 비교했을 때 아무리 찾아봐도 다른 코드가 보이질 않습니다 따로 에러는 발생하지 않는데 혹시 일종의 경고의 메세지 같은걸까요??
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
Prettier 세팅 관련 문의!
1분 30초 즈음에..탭키 눌러서 저장하시면, 16, 17, 18번쨰 줄 이렇게 한줄씩 정렬이 되시는데저는 해당 부분이 자동으로 프리티어 정렬이 들어갑니다 .혹시 프리티어 세팅 부분을 알 수 있을까요?
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
android MainActivity.java 문의 건
안녕하세요 강사님2:05 진행 과정에서 저는 java가 아닌 Kotlin으로 되어있어서요ChatGPT로 변경하는 요청을 했는데 아래와 같이 안내하고 있습니다혹시 이대로 진행하면 될까요? override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(null) }
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
input에 입력 시 오류 문의 건
안녕하세요 강사님input에 입력을 하면 텍스트가 자꾸 사라지면서 로그에는 아래와 같이 오류가 발생하는데 혹시 해결방법을 알 수 있을까요...!?
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
시뮬레이터가 안열립니다.
ios는 저 상태로 무반응이구요. 안드로이드는 이런에러가 나는데 다른분 질문 참고해서 안드 시뮬레이터를 켜고 하면 되긴하는데미리 시뮬레이터를 켜지 않은 상태에서는 저런 에러가 나네요특이사항은 예전에 혼자 expo로 간단하게 ios, android 시뮬레이터연결 해본적 있었습니다.방금도 expo 프로젝트에서는 ios랑 android 시뮬레이터 잘 오픈되구요혹시 몰라 구글링해서 xcode 캐시삭제해보라해서 삭제한 상태구요 "react-native": "0.72.6" "node": v20.10.0 nvm:0.39.7 watchman : 2024.04.22.00 ruby : ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin23] xcode: 15.3
-
해결됨[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
guard와 controller 토큰 추출 / 디코드 중복 코드 관련 질문
// POST auth/login/email @Post('login/email') @UseGuards(BasicTokenGuard) // authorization 기준으로 rawToken을 받아옴. postLoginEmail(@Headers('authorization') rawToken: string, @Request() req) { // email:password -> base64 // adsfasdfasfdad => email:password const token = this.authService.extractTokenFromHeader(rawToken, false); const credentials = this.authService.decodeBasicToken(token); return this.authService.loginWithEmail({ email: credentials.email, password: credentials.password, }); }질문이 있습니다.req.user.email , req.user.password 이런식으로 Guard를 통해 요청에 대한 값을 받아올 수 있다고 설명해주셨습니다. 실제로 guard 부분에서, 해당 extractTokenFromHeader부분과, decodeBasicToken 부분이 겹치는 것 같은데, 이중적으로 처리해주는 것이 맞는지 아니면 아래와 같이 req.user.password 부분을 디코드 해주어서, 중복 부분을 생략해 줄 수 있을 것이라고 생각하는데 어떤 접근방법이 맞는지 궁금합니다! 이 부분도 중복을 해결해야 하는 부분 아닌가 해서 궁금합니다! // POST auth/login/email @Post('login/email') @UseGuards(BasicTokenGuard) // authorization 기준으로 rawToken을 받아옴. postLoginEmail(@Headers('authorization') rawToken: string, @Request() req) { // 여기는 req.user.password를 직접 입력하게되면 인코드된 값이므로, 디코드 된 값이 들어가야 할 것 같긴합니다. (JWT 모듈같은 것을 활용해서!) return this.authService.loginWithEmail({ email: req.user.email, password: req.user.password, }); }
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
시뮬레이터가 작동하지 않아요ㅠ
상황: 1-5 강의 듣는중이고, ruby 2.7.6 까지 세팅 하였습니다.(과정에 조금 문제가 있었지만 성공);npx ~ --version 0.72.6 에러 없이 성공그 후 npm run ios >> 시뮬레이터 뜸 >> 앱 실행 안됨에러 내용이 너무 많아 처음과 끝만 올렸어요ㅠinfo Found Xcode workspace "MatdoriApp.xcworkspace" info Found booted iPhone SE (3rd generation) info Launching iPhone SE (3rd generation) info Building (using "xcodebuild -workspace MatdoriApp.xcworkspace -configuration Debug -scheme MatdoriApp -destination id=CBBF6748-CE87-48B0-B69A-") info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor . . . error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening MatdoriApp.xcworkspace. Command line invocation: /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace MatdoriApp.xcworkspace -configuration Debug -scheme MatdoriApp -destination id=CBBF6748-CE87-48B0-B69A-14A62A514208 User defaults from command line: IDEPackageSupportUseBuiltinSCM = YES Prepare packages warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MatdoriApp' from project 'MatdoriApp') warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'MatdoriApp' from project 'MatdoriApp') --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:iOS Simulator, id:CBBF6748-CE87-48B0-B69A-, OS:17.4, name:iPhone SE (3rd generation) } { platform:iOS Simulator, id:CBBF6748-CE87-48B0-B69A-, OS:17.4, name:iPhone SE (3rd generation) } ** BUILD FAILED ** The following build commands failed: CompileC /Users/ajrfyd/Library/Developer/Xcode/DerivedData/MatdoriApp-dzlyrdyzrnadjbcljrudendrtkwk/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FlipperKit.build/Objects-normal/arm64/FlipperPlatformWebSocket.o /Users/ajrfyd/Desktop/practice/inflearn/MatdoriApp/ios/Pods/FlipperKit/iOS/FlipperKit/FlipperPlatformWebSocket.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'FlipperKit' from project 'Pods') (1 failure) 환경: OS: macOS 14.4.1CPU: (8) arm64 Apple M1 Node: 18.16.0 Yarn: 1.22.22 npm: 9.5.1Watchman: 2024.04.15.00CocoaPods: 1.15.2iOS SDK: Platforms: - DriverKit 23.4 - iOS 17.4 - macOS 14.4 - tvOS 17.4 Android SDK: Not Found // 이건 왜 그런지 몰겠음...강의 따라 설치 되어 있는데..ㅠAndroid Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 15.3/15E204aJava: 17.0.11 Ruby: 2.7.6npmPackages: "@react-native-community/cli": Not Found react: 18.2.0 react-native: 0.72.6 react-native-macos: Not FoundnpmGlobalPackages: "*react-native*": Not FoundAndroid: hermesEnabled: true newArchEnabled: falseiOS: hermesEnabled: true newArchEnabled: false 에러 내용으로 아무리 검색 해 봐도 답이 없네요ㅠ도와 주실 수 있을까요??참고로 예전에 리엑트 네이티브, 엑스포 프로젝트 좀 했었고,이번에 한번 다시 듣고파 결제 했습니다 .xcode 버전 지원안된다 하여 최신으로 깔고, watchmanpython에러 잡아서 다시 깔고, 루비 이슈 해결하고, 안드로이드 스튜디오는 딱히 다시 깔지 않아도 될것 같아 놔두고 설명해 주신 이미지 13이랑 32?? 등등 깔고, 공식문서에서 이미 깔린 react-native/cli는 지우는걸 추천해서 지우고 이정도 입니다 ..
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
Column Property 질문드립니다
안녕하세요섹션 10에 [Column Property 정리하기] 수강중 3분 40초 부분에 질문드립니다.@Column({}) 에 type을 변경했을때 데이터 안에 title이 전부 null로 변경되는데 유지되게 할 수 있는 방법 있을까요??
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
exist가 deprecated 되고, exists로 변경된 것 같습니다!!
exist deprecate => exists 로 변경된 것 같습니다!!!
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
자동 import 질문
안녕하세요 강사님저는 import 할 때마다 아래 처럼 생성했더니 따로 import 줄이 생성이 됩니다import { SafeAreaView } from './node_modules/react-native/types/index';혹시 강사님처럼 자동으로 아래 코드에 들어갈 수 있도록 하는 방법을 알 수 있을까요?import {SafeAreaView, Button, StyleSheet, Text, View} from 'react-native';
-
미해결[코드팩토리] [초급] NestJS REST API 백엔드 완전 정복 마스터 클래스 - Part 1 NestJS Core
데이터베이스 삭제후 nullable false일떄 에러 발생하지 않습니다.
DB도 지우고, 강의 그대로 코드도 동일하나 nullable이 에러가 발생하지 않습니다. 아래 질문하고 동일한 현상이 발생합니다!
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
레퍼지토리 주입 기준이 궁금합니다.
안녕하세요.개인프로젝트하면서 필요한부분들 다시 보는중인데 궁금한점이 생겨서 질문드립니다. 이전 1:1 관계등록 API 강의에서는 상품판매위치 레퍼지토리를 상품의 service에서 주입받지 않고 따로 service를 만들어서 거기서 주입받고 해당 로직을 처리했었습니다.검증로직을 통일시키기 위해서라고 하셨는데, 이번 강의에서는 포인트 레퍼지토리가 주입되어있는 상태에서 추가적으로 유저 레퍼지토리를 주입받아서 유저정보를 가져오시는데, 차이나 기준이 궁금합니다. 더불어 나중 강의인 트랜젝션에서도 현재 주입받은 유저 레퍼지토리를 기준으로 진행되는데, 만약 레퍼지토리를 service별로 분리해야된다면, 쿼리러너를 해당 service로 던졌다가 받던지, 아니면 해당 service에서 xxRepository.create()로 만든걸 받던지 하는 식으로 해야할듯 싶은데 그런 불편함보다는 그냥 한곳에서 처리하는게 낫지 않나 하는 생각이 들기도합니다. 그래서 트랜젝션 사용할때의 레퍼지토리 기준과 만약 service별로 나뉘게 된다면 사용 방법이 궁금합니다. 마지막으로 제가 트렌젝션을 써봤는데, 다른 테이블의 레퍼지토리를 한 개의 service에서 레퍼지토리 주입은 안받고, 모듈에서만 import의 TypeOrmModule.forFreature([]) 부분에 넣어줘도 잘 동작하던데 이렇게 써도 되는게 맞는지 궁금합니다. 혹시 몰라 아래에 해당 코드 첨부해봅니다.// restAPI입니다. // auth.module.ts import { Module } from '@nestjs/common'; import { AuthController } from './auth.controller'; import { AuthService } from './auth.service'; import { UsersService } from '../02.Users/users.service'; import { TypeOrmModule } from '@nestjs/typeorm'; import { User } from '../02.Users/entities/users.entity'; import { Auth } from './entities/auth.entity'; @Module({ imports: [TypeOrmModule.forFeature([Auth, User])], controllers: [AuthController], providers: [AuthService], }) export class AuthModule {} // auth.service.ts import { BadRequestException, ConflictException, Injectable, InternalServerErrorException, } from '@nestjs/common'; import { UsersService } from '../02.Users/users.service'; import { InjectRepository } from '@nestjs/typeorm'; import { Auth } from './entities/auth.entity'; import { DataSource, Repository } from 'typeorm'; import { ConfigService } from '@nestjs/config'; import * as bcrypt from 'bcrypt'; import { IAuthServiceCheckInput, IAuthServiceCreate, IAuthServiceLogin, } from './interfaces/auth-service.interface'; import { User } from '../02.Users/entities/users.entity'; @Injectable() export class AuthService { constructor( @InjectRepository(Auth) private readonly authRepository: Repository<Auth>, private readonly configService: ConfigService, private readonly dataSource: DataSource, ) {} // 생략 async create({ createUserInput }: IAuthServiceCreate): Promise<User> { const { user_id, user_pw, id, ...userData } = createUserInput; const { user_email, user_nick } = userData; if (!id) { const checkUserInput = { user_id, user_email, user_nick }; await this.checkUser({ checkUserInput }); } const queryRunner = this.dataSource.createQueryRunner(); await queryRunner.connect(); await queryRunner.startTransaction(); try { const user = await queryRunner.manager.save( User, id ? { id: id, ...userData } : userData, ); const hashedPw = await this.hashPw({ user_pw }); await queryRunner.manager.save(Auth, { user_id, user_pw: hashedPw, user, }); await queryRunner.commitTransaction(); return user; } catch (error) { await queryRunner.rollbackTransaction(); throw new InternalServerErrorException('회원 가입 실패(DB)'); } finally { queryRunner.release(); } } // 생략
-
해결됨맛집 지도앱 만들기 (React Native + NestJS)
맥북이 없는데 어떻게 하나요?
❗질문 작성시 참고해주세요최대한 상세히 현재 문제(또는 에러)와 코드(또는 github)를 첨부해주셔야 그만큼 자세히 답변드릴 수 있습니다.맥/윈도우, 안드로이드/iOS, 버전 등의 개발환경도 함께 적어주시면 도움이 됩니다. 에러메세지는 일부분이 아닌 전체 상황을 올려주세요!맥없이 해도 되나요?
-
미해결따라하며 배우는 NestJS
"ID로 특정 게시물 가져오기" 부분이 잘못되었습니다.
@Param('id') 사용 http://localhost/board/id 로 들어가야 하는 것인데, http://localhost/board?id=xxxx 이렇게 설명이 되고 있습니다.아시겠지만.. ?로 처리하는 것은 Query로 해야 하는데, 잘못 설명하신거 같아서 적어봅니다..좋은 강의 감사합니다.다시 개념 잡으려고 보고 있는데, 좋네요.. ㅎㅎ 궁금한게 하나 있는데.. EntityRepostiory를 요새는 사용하지 않는거 같던데..그럼 EntityRepostiory 대신에 뭘 사용하는지 좀 알고 싶습니다. 0.3부터인가 사용하지 않는다고 들어서요..
-
미해결맛집 지도앱 만들기 (React Native + NestJS)
pgadmin 서버생성 오류
서버 생성할때 말씀해주신대로usernamepassword에 postgres를 입력하니에러가 뜨네요.... 새로운 user 를 그전에 생성해는 과정이 필요하나요?아님 설치할때 postgres라는 이름의 계정이 생성되던데 그걸 이용할까요?