Skip to content

Commit 6006b87

Browse files
Merge pull request #224 from boostcampwm-2024/dev
[Deploy] 5주차 스프린트 배포 - 1
2 parents 4e98435 + 50020a7 commit 6006b87

File tree

73 files changed

+1774
-1851
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1774
-1851
lines changed

.prettierrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"semi": true,
55
"singleQuote": false,
66
"trailingComma": "es5",
7-
"bracketSpacing": true,
7+
"bracketSpacing": true,
88
"arrowParens": "always",
99
"bracketSameLine": false,
1010
"jsxSingleQuote": false,
@@ -21,7 +21,8 @@
2121
{
2222
"files": "backend/**/*.{js,jsx,ts,tsx}",
2323
"options": {
24-
"tabWidth": 4
24+
"tabWidth": 4,
25+
"printWidth": 100
2526
}
2627
}
2728
]

backend/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
1111
"start": "nest start",
1212
"start:dev": "nest start --watch",
13+
"start:dev1": "PORT=3001 nest start --watch",
1314
"start:debug": "nest start --debug --watch",
1415
"start:prod": "node dist/main",
1516
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
@@ -28,15 +29,20 @@
2829
"@nestjs/platform-socket.io": "^10.4.6",
2930
"@nestjs/typeorm": "^10.0.2",
3031
"@nestjs/websockets": "^10.4.6",
32+
"@socket.io/redis-adapter": "^8.3.0",
3133
"@types/passport-jwt": "^4.0.1",
3234
"axios": "^1.7.7",
3335
"cookie-parser": "^1.4.7",
36+
"class-transformer": "^0.5.1",
37+
"class-validator": "^0.14.1",
3438
"dotenv": "^16.4.5",
3539
"ioredis": "^5.4.1",
3640
"mysql2": "^3.11.4",
41+
"nestjs-redis-om": "^0.1.2",
3742
"passport": "^0.7.0",
3843
"passport-custom": "^1.1.1",
3944
"passport-jwt": "^4.0.1",
45+
"redis-om": "^0.4.7",
4046
"reflect-metadata": "^0.2.0",
4147
"rxjs": "^7.8.1",
4248
"socket.io": "^4.8.1",

backend/src/app.controller.spec.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

backend/src/app.module.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import { Module } from "@nestjs/common";
33
import { AppController } from "./app.controller";
44
import { AppService } from "./app.service";
55

6-
import { SocketModule } from "./signaling-server/socket.module";
76
import { RoomModule } from "./room/room.module";
8-
import { RedisModule } from "./redis/redis.module";
97
import { AuthModule } from "./auth/auth.module";
108
import { UserModule } from "./user/user.module";
119
import { TypeOrmModule } from "@nestjs/typeorm";
@@ -14,19 +12,23 @@ import "dotenv/config";
1412

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

1818
@Module({
1919
imports: [
2020
TypeOrmModule.forRootAsync({
2121
useFactory: async () => typeOrmConfig, // 설정 객체를 직접 반환
2222
dataSourceFactory: async () => await createDataSource(), // 분리된 데이터소스 생성 함수 사용
2323
}),
24-
SocketModule,
24+
RedisOmModule.forRoot({
25+
url: `redis://${process.env.REDIS_HOST}:${process.env.REDIS_PORT}`,
26+
}),
2527
RoomModule,
26-
RedisModule,
2728
AuthModule,
2829
UserModule,
2930
QuestionListModule,
31+
SigServerModule,
3032
],
3133
controllers: [AppController],
3234
providers: [AppService],

backend/src/question-list/question-list.repository.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,12 @@ export class QuestionListRepository {
3535
}
3636

3737
async findCategoryNamesByQuestionListId(questionListId: number) {
38-
const questionList = await this.dataSource
39-
.getRepository(QuestionList)
40-
.findOne({
41-
where: { id: questionListId },
42-
relations: ["categories"], // 질문지와 관련된 카테고리도 함께 조회
43-
});
44-
console.log(questionList);
45-
return questionList
46-
? questionList.categories.map((category) => category.name)
47-
: [];
38+
const questionList = await this.dataSource.getRepository(QuestionList).findOne({
39+
where: { id: questionListId },
40+
relations: ["categories"], // 질문지와 관련된 카테고리도 함께 조회
41+
});
42+
43+
return questionList ? questionList.categories.map((category) => category.name) : [];
4844
}
4945

5046
async findCategoriesByNames(categoryNames: string[]) {

backend/src/redis/redis.module.ts

Lines changed: 0 additions & 7 deletions
This file was deleted.

backend/src/redis/redis.service.spec.ts

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)