This commit is contained in:
2025-12-09 17:02:27 +09:00
parent 26f8e1dab2
commit 83127da569
275 changed files with 139682 additions and 1 deletions

66
backend/src/app.module.ts Normal file
View File

@@ -0,0 +1,66 @@
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { RedisModule } from './redis/redis.module';
import { AuthModule } from './auth/auth.module';
import { UserModule } from './user/user.module';
import { CommonModule } from './common/common.module';
import { SharedModule } from './shared/shared.module';
import { HelpModule } from './help/help.module';
import { JwtModule } from './common/jwt/jwt.module';
import { JwtStrategy } from './common/jwt/jwt.strategy';
// 새로 생성한 모듈들
import { FarmModule } from './farm/farm.module';
import { CowModule } from './cow/cow.module';
import { GenomeModule } from './genome/genome.module';
import { MptModule } from './mpt/mpt.module';
import { DashboardModule } from './dashboard/dashboard.module';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
}),
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (configService: ConfigService) => ({
type: 'postgres',
host: configService.get('POSTGRES_HOST'),
port: configService.get('POSTGRES_PORT'),
username: configService.get('POSTGRES_USER'),
password: configService.get('POSTGRES_PASSWORD'),
database: configService.get('POSTGRES_DB'),
synchronize: configService.get('POSTGRES_SYNCHRONIZE'),
logging: configService.get('POSTGRES_LOGGING'),
autoLoadEntities: true,
entities: [],
}),
}),
// 인프라 모듈
RedisModule,
JwtModule,
CommonModule,
SharedModule,
// 인증/사용자 모듈
AuthModule,
UserModule,
// 비즈니스 모듈
FarmModule,
CowModule,
GenomeModule,
MptModule,
DashboardModule,
// 기타
HelpModule,
],
controllers: [AppController],
providers: [AppService, JwtStrategy],
})
export class AppModule {}