import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { AuthModule } from './auth/auth.module';
//import { TypeOrmModule } from '@nestjs/typeorm';
import { AdminModule } from './admin/admin.module';
import { ClientModule } from './client/client.module';
import { UploadService } from './upload/upload.service';
import { DocumentsService } from './documents/documents.service';
import { S3Service } from './s3/s3.service';
import { S3Module } from './s3/s3.module';
import { PrismaService } from './prisma/prisma.service';
import { PrismaModule } from './prisma/prisma.module';
import { ConfigModule } from '@nestjs/config';
import { AuthController } from './auth/auth.controller';
import { DocumentsController } from './documents/documents.controller';
import { JwtModule } from '@nestjs/jwt';

@Module({
  imports: [
    // TypeOrmModule.forRoot({
    //   type: 'postgres',
    //   host: 'localhost',
    //   port: 5432,
    //   username: 'root',
    //   password: 'admin',
    //   database: 'imk',
    //   synchronize: true,
    // }),
    ConfigModule.forRoot({
      isGlobal: true,
    }),
    JwtModule.register({
      secret: process.env.JWT_SECRET,
      signOptions: { expiresIn: '1h' },
    }),
    AuthModule,
    AdminModule,
    ClientModule,
    S3Module,
    PrismaModule,
  ],
  controllers: [AppController, AuthController, DocumentsController],
  providers: [
    AppService,
    UploadService,
    DocumentsService,
    S3Service,
    PrismaService,
  ],
})
export class AppModule {}
