Skip to content

Issue/247/lab server (Draft)#248

Draft
aariprom wants to merge 19 commits intodevfrom
issue/247/lab-server
Draft

Issue/247/lab server (Draft)#248
aariprom wants to merge 19 commits intodevfrom
issue/247/lab-server

Conversation

@aariprom
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review by ChatGPT

@Module({
imports: [WeaviateModule.register()],
})
export class AppModule {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치가 전반적으로 괜찮아 보이지만, 몇 가지 잠재적인 버그와 개선 사항이 있습니다.

  1. 의존성 관리: WeaviateModule.register()의 인자가 지정되지 않았습니다. 설정 매개변수가 필요할 수 있으며, 그에 따라 필요한 인수를 전달해야 할 것으로 보입니다.

  2. 모듈 초기화: WeaviateModule의 초기화가 성공적으로 이루어졌는지 확인할 필요가 있습니다. 에러 핸들링 또는 로그를 추가하는 것이 좋습니다.

  3. 문서화 부족: 코드에 대한 주석이나 문서화가 부족합니다. 특히 WeaviateModule에 대한 간단한 설명이 있으면, 다른 개발자가 이 모듈의 목적과 사용방법을 이해하는 데 도움이 될 것입니다.

  4. 성능 고려: register() 메서드의 구현에 따라서 초기화 시 성능 문제가 발생할 수 있습니다. 비동기 초기화를 고려하거나, 필요 시점에 로딩하는 방법을 검토해보는 것이 좋습니다.

이와 같은 사항들을 개선하면, 코드의 안정성과 가독성이 향상될 것입니다.


bootstrap().catch((err) => {
console.error('otlplus-nest lab-server failed to boot', err)
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 코드는 전반적으로 잘 작성되었지만 몇 가지 잠재적인 버그 및 개선 사항이 있습니다.

  1. 에러 처리: 현재 부트스트랩 함수 내에서 'catch' 블록을 통해 에러를 로그로 남기고 있지만, 서버가 시작되지 않을 경우 어떤 동작을 해야 하는지에 대한 논리는 없습니다. 이를 해결하기 위해, 예를 들어 다시 시도하거나 종료하는 로직을 추가하는 것이 좋습니다.

  2. 포트 번호 하드코딩: 포트 번호인 9009가 코드에 하드코딩되어 있습니다. 이는 나중에 환경에 따라 변동이 필요할 경우를 고려하지 않습니다. 환경 변수를 사용하거나 설정 파일에서 포트 번호를 관리하는 것이 더 좋습니다.

  3. CORS 설정의 유효성 검사: CORS 설정을 하는 부분에서 settings().getCorsConfig()가 유효한지를 검증하는 과정이 필요합니다. 잘못된 설정이 들어올 경우 서버가 예상치 못하게 작동할 수 있습니다.

  4. 부트스트랩 함수 명확화: 부트스트랩 함수가 async로 작성된 만큼, 가능하면 Promise를 반환하거나, 프로미스가 반환되는 방식으로 명확하게 처리하는 것이 바람직합니다. 예를 들어, return bootstrap().catch(...)와 같은 방식으로 수정할 수 있습니다.

따라서 코드의 기본적인 구조는 좋지만, 이러한 개선 사항을 반영할 경우 더욱 견고한 코드가 될 것입니다.

}
},
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 코드 패치는 TypeScript 설정 파일(tsconfig.json)과 관련되어 있습니다. 전체적으로 설정이 잘 구성되어 있으나 몇 가지 잠재적인 문제와 개선 사항이 있습니다.

  1. strictBindCallApply: 'strictBindCallApply' 플래그가 false로 설정되어 있는데, 가능하면 true로 설정하는 것이 좋습니다. 이를 통해 함수의 bind, call, apply 메서드 사용 시 더 엄격한 체크를 받을 수 있습니다.

  2. forceConsistentCasingInFileNames: 이 플래그도 false로 되어 있습니다. 프로젝트가 대소문자를 구분하는 파일 시스템에서 운영될 가능성이 있다면 true로 설정하여 파일 경로의 대소문자 일관성을 보장하는 것이 좋습니다.

  3. noFallthroughCasesInSwitch: 이 설정이 false로 되어 있어 switch 문에서 case 누락 시 경고를 받지 않습니다. 코드의 안정성을 높이기 위해 true로 설정하는 것을 추천합니다.

  4. 경로 설정: '@otl/scholar-sync' 및 '@otl/prisma-client'와 같은 경로 설정이 상대 경로로 되어 있습니다. 이는 프로젝트 구조가 변경될 경우에 의도치 않은 오류를 유발할 수 있으니, 절대 경로를 사용하는 것이 더 안전할 수 있습니다.

  5. exclude 경로 검사: 'exclude' 배열에 작성된 경로가 올바른지, 의도한 대로 제외되고 있는지 재검토하는 것이 필요합니다. 예를 들어, 'test'와 'dist'가 적절하게 제외되는지 확인하세요.

이 설정을 검토한 후, 잠재적인 문제를 해결하고 프로젝트의 일관성을 위해 수정하기를 권장합니다.

getSwaggerConfig: () => getSwaggerConfig(),
loggingConfig: () => getLoggingConfig(),
weaviateConfig: () => getWeaviateConfig(),
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰

잠재적 버그 및 리스크

  1. 환경 변수 체크: process.env.READ_ONLY_DATABASE_URL, process.env.WEAVIATE_URL, process.env.OLLAMA_URL 등에서 환경 변수를 사용하고 있습니다. 이 변수들이 정의되지 않았을 경우 에러가 발생할 수 있습니다. 이를 방지하기 위해서는 변수들이 존재하는지 확인하는 로직을 추가해야 합니다.

  2. 데이터베이스 연결: getReplicatedPrismaConfig 함수가 생성하는 데이터베이스 설정에 대해, url이 올바른 형식인지 검증하거나 필요한 경우 기본값을 설정하는 것이 좋습니다.

  3. 로깅 레벨: log 설정에서 'query'와 'warn' 레벨이 주석 처리 되어 있습니다. 필요에 따라 로그 레벨을 조정할 수 있도록 주석을 풀던가 작성자와 협의가 필요합니다.

개선 제안

  1. 코드의 일관성: 각 설정 객체의 프로퍼티를 정리하여 일관성 있게 맞추는 것이 좋습니다. 예를 들어, getWeaviateConfiggetReplicatedPrismaConfig의 반환 구조를 통일하면 이해하기 쉬워질 것입니다.

  2. 주석 추가: 코드에 주석을 추가하여 각 함수의 목적인데 대한 설명을 명시하는 것도 좋습니다. 향후 유지보수 시 도움이 될 것입니다.

  3. 유효성 검사: 각 함수 내에서 제공하는 설정 값들을 검증하는 유효성 검사 로직을 추가하여 안전성을 강화하는 것이 좋습니다.

이러한 사항들을 고려하여 코드를 수정한 후 다시 검토를 요청하면 좋겠습니다.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 혹시 .env 빡세게 유효성 검사할 수 있는 라이브러리 같은거 있는지 보고 함 적용해조.
매번 as string으로 타입 선언하고 있어가지고..!
예를 들면 ENV 파일에 해당 환경변수가 없으면 실행이나 빌드가 아예 안되는 식으로

LabModule,
ClsModule.forRoot({
global: true,
middleware: { mount: true },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치에 몇 가지 주의할 점과 개선 방안이 있습니다.

  1. 모듈 의존성 이해: LabModule이 추가되었습니다. 이 모듈의 기능이나 의존성이 전체 애플리케이션 구조에 어떤 영향을 미칠 수 있는지 명확히 이해하고 있어야 합니다. 모듈 간 의존성이 복잡해지면 유지보수가 어려워질 수 있습니다.

  2. Sentry와의 통합: Sentry 모듈이 함께 사용되고 있는데, LabModule에서 Sentry와의 통합이 필요할 경우, 관련 코드 또는 서비스가 제대로 설정되어 있는지 확인해야 합니다. 만약 LabModule이 Sentry를 사용할 경우, Sentry와의 연결 구성에 주의하십시오.

  3. 서버 성능: 새로운 모듈의 addition이 전체 성능에 미치는 영향을 고려해야 합니다. LabModule이 많은 데이터를 처리하거나 리소스를 사용한다면, 캐시 메커니즘을 지향하는 것이 중요하며, 성능 저하를 방지하기 위한 미리 정의된 기준이 필요합니다.

  4. 테스트 코드: 해당 모듈에 대한 테스트 케이스가 존재하는지 확인하세요. 새로 추가된 모듈 기능에 대한 단위 테스트 및 통합 테스트가 필요합니다. 테스팅이 부족하면 버그 발생 시 찾아내기 힘듭니다.

  5. 문서화: 이 변경사항에 대한 문서화가 필요합니다. 팀원들이 새로 추가된 모듈의 기능과 사용 방법을 이해할 수 있도록 명확하게 문서화하십시오.

이와 같은 사항을 고려하여 패치를 계속 진행하는 것이 좋습니다.

Comment thread libs/weaviate-client/src/weaviate.module.ts
Comment thread libs/weaviate-client/src/weaviate.service.ts
}
},
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치는 TypeScript 설정 파일에 대한 구성 요소를 포함하고 있습니다. 그러나 몇 가지 주의 사항이 있습니다:

  1. Strict 모드 설정: 'strictNullChecks' 및 'strictBindCallApply'를 false로 설정했는데, 이는 코드의 타입 안전성을 낮춥니다. 가능하면 이 옵션들을 true로 설정하는 것이 좋습니다.

  2. noImplicitAny 설정: 'noImplicitAny'를 false로 두면 개발 중 타입 검사가 덜 엄격해져서 의도치 않은 버그를 초래할 수 있습니다. 이 옵션을 true로 설정하는 것을 고려하세요.

  3. 디렉토리 경로: 경로 설정의 정확성을 확인하세요. 상대 경로를 사용할 경우 경로 변경 시 문제가 발생할 수 있습니다. 유지보수가 용이하도록 절대 경로를 사용하는 방법도 고려해 볼 수 있습니다.

  4. exclude 옵션: 'exclude'에 'test'와 'dist' 디렉토리가 포함되어 있으나, 필요한 경우 이러한 디렉토리에서 TypeScript 컴파일이 요구될 수도 있습니다. 필요한 파일이 컴파일되지 않도록 주의하세요.

이 외에도, 'baseUrl' 설정이 './'로 되어 있는데, 이 설정으로 인해 상대 경로 import에 문제가 발생할 수 있습니다. 전체 프로젝트의 구조를 다시 한번 검토하여 이 설정이 적절한지 확인하는 것이 좋습니다.

Comment thread package.json
"weaviate-client": "^3.6.2",
"winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0"
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰 코멘트

  1. 경로 문제: start:server:prod의 경로를 변경하였는데, dist/apps/server/apps/server/src/bootstrap/bootstrap.js로 수정한 것이 맞는지 확인이 필요합니다. 일반적으로 dist 폴더 아래에 있는 파일은 빌드 결과물로 되어 있어야 하며, 이러한 경로가 잘못될 경우 서버가 정상적으로 시작되지 않을 수 있습니다.

  2. 의존성 추가: @prisma/extension-read-replicasweaviate-client 패키지를 추가하였는데, 이 패키지들이 현재 프로젝트에서 실제로 사용되고 있는지 확인이 필요합니다. 사용하고 있지 않은 의존성을 추가하는 것은 프로젝트의 유지보수성을 떨어뜨릴 수 있습니다. 추가된 의존성들이 실제로 필요한 경우라면, 이를 사용하는 코드가 포함되어 있는지 검토해 보아야 합니다.

  3. 의존성 버전 관리: 추가된 의존성들의 버전이 최신인지 또는 안정성을 보장하는 버전인지 확인해보아야 합니다. 프로젝트에서 사용하는 모든 의존성의 호환성 및 버전 안정성은 매우 중요합니다. 특히, 주요 기능에 영향을 미치는 라이브러리들의 경우에는 더욱 주의해야 합니다.

  4. 다른 수정사항들에 대한 검토: 코드 변경의 목적 및 필요성을 주석으로 남기는 것이 좋습니다. 변경된 내용을 이해하는 데 도움이 됩니다.

결론적으로, 코드 변경이 올바른지 확인하고, 필요 없는 의존성이 추가되지 않았는지 검토한 후에 머지하는 것이 좋습니다.

Comment thread tsconfig.json
"@otl/weaviate-client/*": ["libs/weaviate-client/src/*"],
"@otl/server-nest/": ["apps/server/src"],
"@otl/server-nest/*": ["apps/server/src/*"],
"@otl/scholar-sync/": ["apps/scholar-sync/src"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 리뷰:

  1. 경로 확인: 추가된 두 줄의 경로 libs/weaviate-client/srclibs/weaviate-client/src/*가 실제로 존재하는지 확인해야 합니다. 만약 해당 경로가 존재하지 않으면 컴파일 오류가 발생할 수 있습니다.

  2. 명명 일관성: @otl/weaviate-client와 같은 패키지 이름이 기존 패턴(@otl/prisma-client, 등)에 잘 맞는지 확인하십시오. 기존 패키지와의 명명 규칙을 일관되게 유지하는 것이 유지보수에 유리합니다.

  3. 테스트 필요성: 이 변경 사항이 기존 코드에 미치는 영향을 고려하여 구체적인 테스트가 필요합니다. 새로운 모듈을 추가하는 경우, 해당 모듈과의 통합 테스트를 고려해야 합니다.

  4. 문서화: 변경 사항에 대한 관련 문서가 없으면 나중에 문제를 추적하기 어렵습니다. 코드 변경에 대한 문서를 업데이트하는 것을 잊지 마세요.

따라서, 코드가 평범하게 보이지만 추가적인 확인 및 테스트가 필요하여 머지하기에 우려가 있습니다.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review by ChatGPT

},
"/api/lectures": {
"get": {
"summary": "LecturesController.getLectures",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치에서 몇 가지 문제가 발견되었습니다. 먼저, '/api/lab/autocomplete'의 응답 스키마가 'type': 'null'로 설정되어 있는데, 이는 유효한 JSON 응답을 제공하는 데 적합하지 않습니다. 클라이언트가 예상하는 데이터 구조를 명확히 정의해야 합니다. 즉, 실제로 반환될 데이터 형태(예: 배열, 객체 등)를 반영해야 합니다. 또한 이 엔드포인트에서 반환할 예제 응답을 추가하여 API 문서의 명확성을 높이는 것이 좋습니다.

둘째, 'prefix' 파라미터가 필수로 설정되어 있어야 하며, 이 값에 대한 유효성 검사가 필요합니다. 잘못된 값이 입력될 경우 API 호출이 실패할 수 있으므로, 더 친절한 오류 메시지를 제공하는 방법을 고려해야 합니다.

이러한 점들을 수정한 후에 코드가 머지될 준비가 되었는지 다시 검토하는 것이 좋겠습니다.


@Module({
imports: [WeaviateModule.register()],
controllers: [LabController],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치에서 WeaviateModule 임포트 경로가 변경되었습니다. 새로운 경로가 올바른지 확인해야 합니다. 특히, 패키지 구조가 변경되었거나 모듈이 이동되었을 경우, 이전 의존성이 누락되거나 불완전할 수 있습니다. 또한, register() 메소드를 사용하고 있는 부분이 맞는지 확인하십시오. 만약 이 메소드가 비동기적이거나 설정 옵션이 필요하다면, 이를 반영하지 않으시면 런타임 에러가 발생할 수 있습니다. 추가적으로, 모듈이 서로 의존성을 가지고 있는 경우 초기화 순서나 시간 관련 문제를 야기할 수 있으므로 주의가 필요합니다. 전체적으로, 새로운 경로의 신뢰성을 확인하고 사용하기 전에 충분한 테스트가 이루어져야 합니다.

constructor(private weaviate: WeaviateService) {}

// TODO: implement autocomplete/hybrid search logic below
autocomplete(prefix: string) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리뷰 코멘트:

  1. 수입 경로 변경:

    • WeaviateService의 수입 경로가 변경되었습니다. 이 변경이 실제 프로젝트의 디렉터리 구조와 일치하는지 확인해야 합니다. 만약 이 경로가 잘못되었거나 해당 파일이 존재하지 않는다면 컴파일 오류가 발생할 수 있습니다.
  2. 데코레이터 사용법:

    • @Injectable() 데코레이터가 괄호와 함께 사용되었습니다. NestJS에서는 이 방식이 일반적이지만, 현재 사용 중인 NestJS 버전에서 차이가 날 수 있습니다. 이점도 확인해 보아야 합니다.
  3. 테스트 커버리지:

    • 변경된 코드에 대한 테스트가 포함되어 있는지 확인해야 합니다. WeaviateService의 기능이 변경되었거나 해당 서비스와의 통신 방식에 변화가 있을 경우, 관련 기능이 테스트되고 있는지 검토해야 합니다.
  4. 문서화:

    • LabService 클래스와 그 안의 코드에 대한 문서화가 부족할 수 있습니다. 좋은 코드 리뷰는 다른 팀원이 해당 코드를 이해하는 데 도움을 줍니다. 각 메서드와 주요 단계에 대한 간단한 설명을 추가하는 것을 고려해 보세요.

},
"/api/lectures": {
"get": {
"summary": "LecturesController.getLectures",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주어진 코드 패치에는 몇 가지 문제와 개선 사항이 있습니다.

  1. 응답 스키마: 200 응답의 schema가 `type:

"@otl/weaviate-client/*": ["../../libs/weaviate-client/src/*"]
},
"assets": [
{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 패치에서 두 개의 새로운 별칭이 추가되었습니다: @otl/weaviate-client@otl/weaviate-client/*. 기본적으로 이러한 추가는 문제가 없어 보이지만, 몇 가지 우려 사항이 있습니다.

  1. 경로 확인: 추가된 경로 ../../libs/weaviate-client/src../../libs/weaviate-client/src/*가 실제로 존재하는지 확인하는 것이 중요합니다. 잘못된 경로가 지정되면 모듈을 찾지 못하는 문제가 발생할 수 있습니다.

  2. 네이밍 일관성: 네이밍 컨벤션이 일관성이 있어야 합니다. 리팩토링을 고려할 때, 클라이언트 이름이 scholarweaviate-client로 다르게 네이밍된 경우 모듈 간의 일관성이 떨어질 수 있습니다.

  3. 주석 추가: 이 변경 사항의 이유와 목적을 설명하는 주석을 추가하면 나중에 코드 유지보수 시 도움이 될 수 있습니다.

  4. 테스트 필요성: 새로운 별칭이 추가됨에 따라, 해당 모듈을 사용하는 코드에 대한 테스트가 충분히 이루어졌는지 확인할 필요가 있습니다. 이미 작성된 테스트가 있다면, 그 테스트가 이 변경 사항을 커버하고 있는지 점검해야 합니다.

이러한 점을 고려하여 코드 패치에 대해 추가 검토가 필요합니다.

Comment thread libs/weaviate-client/tsconfig.lib.json
Comment thread nest-cli.json
},
"common": {
"type": "library",
"root": "libs/common",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다음은 코드 패치에 대한 몇 가지 우려 사항입니다:

  1. 구문 오류: common 라이브러리 정의의 끝에 있는 쉼표가 문제를 일으킬 수 있습니다. JSON 객체의 마지막 항목 뒤에 쉼표를 포함하면 구문 오류가 발생합니다. 해당 쉼표를 제거해야 합니다.

  2. 중복성: tsConfigPath와 같은 속성이 각 라이브러리에 대해 반복되고 있습니다. 이는 코드를 유지 관리하기 어렵게 하고 버그의 원인이 될 수 있습니다. 이러한 반복을 줄이기 위해 공통 구성 파일로 설정할 수 있습니다.

  3. 정의 일관성: 모든 라이브러리 정의에서 구조와 필드가 일관성 있게 유지되는지 확인해야 합니다. 특히 새로 추가된 weaviate-client 라이브러리의 속성이 다른 라이브러리의 정의와 일치하는지 검토해야 합니다.

  4. 문서화 부족: 새로운 라이브러리에 대한 설명이나 주석이 부족합니다. 팀원이거나 미래에 코드를 읽을 사람이 이해하기 쉽게 라이브러리에 대한 설명을 추가하는 것이 좋습니다.

이와 같이 여러 측면에서 개선할 점이 있으니, 코드를 머지하기 전에 이러한 사항들을 검토 후 처리하는 것이 좋습니다.

Comment thread package.json
@LarryKwon LarryKwon changed the base branch from main to dev July 16, 2025 05:14

@Injectable()
export class WeaviateService {
private readonly endpoint = 'http://localhost:8080/v1/graphql'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 이렇게 하지 말고 환경변수로 빼야하고, localhost가 아니라, dev,pord 환경따라 주소 다 바뀔 거 같아

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 다음에 weaviateService로 weaviateClient를 한 번 감싸야할 거 같은데 이렇게 되면 아무것도 없는 껍데기만 있는거지 않나..?

Comment thread env/.env.example Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 올라마 쓰는게 아니라 Gemini API 써서 임베딩할 수 있도록 바꿔야해.
그리고 weaviate_URL이랑 저기 weaviateService에서 쓰는 URL이랑 다른건가?

Comment thread apps/scholar-sync/src/settings.ts Outdated
getVersion: () => getVersion(),
getSwaggerConfig: () => getSwaggerConfig(),
loggingConfig: () => getLoggingConfig(),
weaviateConfig: () => getWeaviateConfig(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거가 왜 여기 들어가있지...?
이거 settings.ts가 lab-server 밑에 들어가야하는거 아닌감

@@ -0,0 +1,26 @@
import { ValidationPipe } from '@nestjs/common'
import { NestFactory } from '@nestjs/core'
import settings from '@otl/scholar-sync/settings'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 잘못들어가있는거 같아

app.enableCors(settings().getCorsConfig())
app.enableShutdownHooks()

await app.listen(9009)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

왜 9009로 해놨어ㅋㅋ
8001이나 8002로 하자

Comment thread apps/lab-server/src/bootstrap/bootstrap.ts
@LarryKwon LarryKwon force-pushed the issue/247/lab-server branch from 7767bbc to b9cc0f6 Compare July 28, 2025 08:04
Comment on lines +61 to +72
app.use(
swaggerStats.getMiddleware({
swaggerSpec: swaggerDocument,
uriPath: '/swagger-stats',
authentication: true,
onAuthenticate(_req, username, password) {
// simple check for username and password
const swaggerStatsConfig = settings().getSwaggerStatsConfig()
return username === swaggerStatsConfig.username && password === swaggerStatsConfig.password
},
}),
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 더 이상 안 쓸거라서 제거 부탁해요~

Comment on lines +74 to +75
app.use('/api/sync', json({ limit: '50mb' }))
app.use(json({ limit: '100kb' }))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도 필요 없는 거라서 제거 부탁해요~

app.use('/api/sync', json({ limit: '50mb' }))
app.use(json({ limit: '100kb' }))
app.useGlobalFilters(new UnexpectedExceptionFilter(), new HttpExceptionFilter<HttpException>())
console.log(v8.getHeapStatistics().heap_size_limit / 1024 / 1024)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이것도~

Comment on lines +1 to +5
export interface FieldData {
id: string
keyword: string
parentField?: string
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 것들은 도메인 클래스로 보여지는데 Agreement 한거보고 class로 만들고 분리 부탁해요~

Comment on lines +1 to +8
export interface LabData {
id: string
name: string
prof: string
department: string
keywords: string[]
location?: string
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기도~

Comment on lines +10 to +8
export interface LabRepositoryInterface {
insert(data: any): Promise<void>
findById(id: string): Promise<any | null>
findByProfName(name: string): Promise<any[]>
deleteById(id: string): Promise<any>
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이런 것도 any 타입 말고 다른 걸로 할 수 있게끔..!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

밑에 PaperRepository 하듯이

Comment on lines +1 to +2
export interface PaperData {
id: string
title: string
prof: string
keywords: string[]
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘도 도메인 클래스처럼 보이는데 Agreement 한거보구 class로 분리해서 해줘요~

Comment thread apps/lab-server/src/settings.ts Outdated
Comment on lines +60 to +65
const getSyncConfig = () => ({
slackKey: process.env.SLACK_KEY,
scholarKey: process.env.SCHOLAR_AUTH_KEY,
scholarUrl: process.env.SCHOLAR_BASE_URL,
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘는 필요 업써

ClientsModule,
DeviceModule,
NotificationModule,
LabModule,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 필요 없지 않나?

@LarryKwon LarryKwon force-pushed the issue/247/lab-server branch from 0dcd3b4 to 2b7cc0c Compare August 11, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants