Skip to content

Commit

Permalink
백엔드 코드 리팩터링 (#176)
Browse files Browse the repository at this point in the history
* refactor: space.controller , space.service

* feat: 작업 내용 저장

* fix: save point

* refactor: lint 스타일로 코드 재작성
  • Loading branch information
fru1tworld authored Dec 2, 2024
1 parent 66b4afe commit b5ab48b
Show file tree
Hide file tree
Showing 38 changed files with 5,903 additions and 11,246 deletions.
11 changes: 11 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Backend
/packages/backend/*
/packages/backend/**/*

# Build outputs
**/dist
**/build
**/coverage

# Dependencies
**/node_modules
16 changes: 0 additions & 16 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
version: "3.8"

services:
redis:
image: redis:latest
container_name: redis-container
ports:
- "6379:6379"
networks:
- app-network
command: redis-server --bind 0.0.0.0 --requirepass 1234

mysql:
image: mysql:8.0
container_name: mysql-container
Expand All @@ -31,7 +22,6 @@ services:
timeout: 5s
retries: 3
command: --bind-address=0.0.0.0

backend:
build:
context: .
Expand All @@ -43,8 +33,6 @@ services:
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_started
mongodb:
condition: service_healthy
environment:
Expand All @@ -54,10 +42,6 @@ services:
- MYSQL_PASSWORD=1234
- MYSQL_USER=honey
- NODE_ENV=dev
- REDIS_HOST=redis-container
- REDIS_PASSWORD=1234
- REDIS_PORT=6379
- REDIS_TTL=3600
- MONGO_HOST=mongodb-container
- MONGO_USER=honey
- MONGO_PASSWORD=1234
Expand Down
6 changes: 0 additions & 6 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ services:
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}

# Redis 세팅
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_TTL=${REDIS_TTL}
- REDIS_PASSWORD=${REDIS_PASSWORD}

# Mongo 세팅
- MONGO_HOST=${MONGO_HOST}
- MONGO_USER=${MONGO_USER}
Expand Down
25 changes: 0 additions & 25 deletions packages/backend/.eslintrc.js

This file was deleted.

12 changes: 0 additions & 12 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/backend/src/main.js",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
Expand All @@ -35,18 +34,14 @@
"@nestjs/terminus": "^10.2.3",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.4.8",
"cache-manager-redis-store": "2.0.0",
"dotenv": "^16.4.5",
"ioredis": "^5.4.1",
"mongoose": "^8.8.1",
"mysql2": "^3.11.4",
"nest-winston": "^1.9.7",
"prosemirror": "^0.11.1",
"redis": "^4.7.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"shared": "workspace:*",
"snowflake-uuid": "^1.0.0",
"socket.io": "^4.8.1",
"swagger-ui-express": "^5.0.1",
"typeorm": "^0.3.20",
Expand All @@ -63,8 +58,6 @@
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/cache-manager": "^4.0.6",
"@types/cache-manager-redis-store": "^2.0.4",
"@types/express": "^5.0.0",
"@types/jest": "^29.5.2",
"@types/mongoose": "^5.11.97",
Expand All @@ -73,11 +66,6 @@
"@types/supertest": "^6.0.0",
"@types/uuid": "^10.0.0",
"@types/ws": "^8.5.13",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
Expand Down
7 changes: 0 additions & 7 deletions packages/backend/src/app.controller.ts

This file was deleted.

22 changes: 8 additions & 14 deletions packages/backend/src/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { Logger, Module, OnModuleInit } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { SpaceModule } from './space/space.module';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { TypeOrmModule } from '@nestjs/typeorm';
import { YjsModule } from './yjs/yjs.module';
import { NoteModule } from './note/note.module';
import { RedisModule } from './redis/redis.module';
import { MongooseModule } from '@nestjs/mongoose';
import { TypeOrmModule } from '@nestjs/typeorm';

import { CollaborativeModule } from './collaborative/collaborative.module';
import { getMongooseConfig } from './common/config/mongo.config';
import { getTypeOrmConfig } from './common/config/typeorm.config';
import { NoteModule } from './note/note.module';
import { SpaceModule } from './space/space.module';
import { YjsModule } from './yjs/yjs.module';

@Module({
imports: [
Expand All @@ -28,21 +26,17 @@ import { getTypeOrmConfig } from './common/config/typeorm.config';
SpaceModule,
YjsModule,
NoteModule,
RedisModule,
CollaborativeModule,
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule implements OnModuleInit {
private readonly logger = new Logger(AppModule.name);
constructor() {}

async onModuleInit() {
this.logger.debug('Application initilized For Debug');
async onModuleInit(): Promise<void> {
this.logger.debug('Application initialized for debug');
this.logger.log('Application initialized', {
module: 'AppModule',
environment: process.env.NODE_ENV,
environment: process.env.NODE_ENV ?? 'development',
timestamp: new Date().toISOString(),
});
}
Expand Down
3 changes: 0 additions & 3 deletions packages/backend/src/app.service.ts

This file was deleted.

61 changes: 0 additions & 61 deletions packages/backend/src/collaborative/collaborative.controller.ts

This file was deleted.

7 changes: 3 additions & 4 deletions packages/backend/src/collaborative/collaborative.module.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Module } from '@nestjs/common';
import { NoteModule } from 'src/note/note.module';
import { SpaceModule } from 'src/space/space.module';

import { NoteModule } from '../note/note.module';
import { SpaceModule } from '../space/space.module';
import { CollaborativeService } from './collaborative.service';
import { CollaborativeController } from './collaborative.controller';

@Module({
imports: [NoteModule, SpaceModule],
providers: [CollaborativeService],
exports: [CollaborativeService],
controllers: [CollaborativeController],
})
export class CollaborativeModule {}
Loading

0 comments on commit b5ab48b

Please sign in to comment.