Skip to content

Commit

Permalink
Merge pull request #224 from boostcampwm-2024/dev
Browse files Browse the repository at this point in the history
[Deploy] 5주차 스프린트 배포 - 1
  • Loading branch information
ShipFriend0516 authored Nov 25, 2024
2 parents 4e98435 + 50020a7 commit 6006b87
Show file tree
Hide file tree
Showing 73 changed files with 1,774 additions and 1,851 deletions.
5 changes: 3 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"semi": true,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSpacing": true,
"arrowParens": "always",
"bracketSameLine": false,
"jsxSingleQuote": false,
Expand All @@ -21,7 +21,8 @@
{
"files": "backend/**/*.{js,jsx,ts,tsx}",
"options": {
"tabWidth": 4
"tabWidth": 4,
"printWidth": 100
}
}
]
Expand Down
6 changes: 6 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:dev1": "PORT=3001 nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
Expand All @@ -28,15 +29,20 @@
"@nestjs/platform-socket.io": "^10.4.6",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.4.6",
"@socket.io/redis-adapter": "^8.3.0",
"@types/passport-jwt": "^4.0.1",
"axios": "^1.7.7",
"cookie-parser": "^1.4.7",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"dotenv": "^16.4.5",
"ioredis": "^5.4.1",
"mysql2": "^3.11.4",
"nestjs-redis-om": "^0.1.2",
"passport": "^0.7.0",
"passport-custom": "^1.1.1",
"passport-jwt": "^4.0.1",
"redis-om": "^0.4.7",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"socket.io": "^4.8.1",
Expand Down
22 changes: 0 additions & 22 deletions backend/src/app.controller.spec.ts

This file was deleted.

10 changes: 6 additions & 4 deletions backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { Module } from "@nestjs/common";
import { AppController } from "./app.controller";
import { AppService } from "./app.service";

import { SocketModule } from "./signaling-server/socket.module";
import { RoomModule } from "./room/room.module";
import { RedisModule } from "./redis/redis.module";
import { AuthModule } from "./auth/auth.module";
import { UserModule } from "./user/user.module";
import { TypeOrmModule } from "@nestjs/typeorm";
Expand All @@ -14,19 +12,23 @@ import "dotenv/config";

import { createDataSource, typeOrmConfig } from "./config/typeorm.config";
import { QuestionListModule } from "./question-list/question-list.module";
import { RedisOmModule } from "nestjs-redis-om";
import { SigServerModule } from "@/signaling-server/sig-server.module";

@Module({
imports: [
TypeOrmModule.forRootAsync({
useFactory: async () => typeOrmConfig, // 설정 객체를 직접 반환
dataSourceFactory: async () => await createDataSource(), // 분리된 데이터소스 생성 함수 사용
}),
SocketModule,
RedisOmModule.forRoot({
url: `redis://${process.env.REDIS_HOST}:${process.env.REDIS_PORT}`,
}),
RoomModule,
RedisModule,
AuthModule,
UserModule,
QuestionListModule,
SigServerModule,
],
controllers: [AppController],
providers: [AppService],
Expand Down
16 changes: 6 additions & 10 deletions backend/src/question-list/question-list.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ export class QuestionListRepository {
}

async findCategoryNamesByQuestionListId(questionListId: number) {
const questionList = await this.dataSource
.getRepository(QuestionList)
.findOne({
where: { id: questionListId },
relations: ["categories"], // 질문지와 관련된 카테고리도 함께 조회
});
console.log(questionList);
return questionList
? questionList.categories.map((category) => category.name)
: [];
const questionList = await this.dataSource.getRepository(QuestionList).findOne({
where: { id: questionListId },
relations: ["categories"], // 질문지와 관련된 카테고리도 함께 조회
});

return questionList ? questionList.categories.map((category) => category.name) : [];
}

async findCategoriesByNames(categoryNames: string[]) {
Expand Down
7 changes: 0 additions & 7 deletions backend/src/redis/redis.module.ts

This file was deleted.

251 changes: 0 additions & 251 deletions backend/src/redis/redis.service.spec.ts

This file was deleted.

Loading

0 comments on commit 6006b87

Please sign in to comment.