import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AuthModule } from './auth/auth.module';
import { User } from './user/user.entity';
import { Workspace } from './workspace/workspace.entity';
import { Project } from './project/project.entity';
import { AiConfig } from './ai/ai-config.entity';
import { PluginConfig } from './plugins/plugin-config.entity';

@Module({
  imports: [
    TypeOrmModule.forRoot({
      type: 'postgres',
      host: 'localhost',
      port: 5432,
      username: 'postgres',
      password: 'postgres',
      database: 'aiframe',
      entities: [User, Workspace, Project, AiConfig, PluginConfig],
      synchronize: true,
    }),
    AuthModule,
  ],
})
export class AppModule {}