5ed2ef0958
Build and Deploy Platform / build-push-deploy (push) Has been cancelled
Harbor in-cluster builds via Kaniko, ArgoCD auto-sync, and production Helm values for abrban.com domains. Co-authored-by: Cursor <cursoragent@cursor.com>
94 lines
2.9 KiB
TypeScript
94 lines
2.9 KiB
TypeScript
import { Module } from '@nestjs/common';
|
|
import { ConfigModule, ConfigService } from '@nestjs/config';
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
import { BullModule } from '@nestjs/bull';
|
|
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
|
|
import { APP_GUARD } from '@nestjs/core';
|
|
import { AuthModule } from './auth/auth.module';
|
|
import { UsersModule } from './users/users.module';
|
|
import { ApplicationsModule } from './applications/applications.module';
|
|
import { DeploymentsModule } from './deployments/deployments.module';
|
|
import { ClustersModule } from './clusters/clusters.module';
|
|
import { KubernetesModule } from './kubernetes/kubernetes.module';
|
|
import { BuildModule } from './build/build.module';
|
|
import { TicketsModule } from './tickets/tickets.module';
|
|
import { BillingModule } from './billing/billing.module';
|
|
import { SnapshotsModule } from './snapshots/snapshots.module';
|
|
import { LifecycleModule } from './lifecycle/lifecycle.module';
|
|
import { ApplicationMigrationsModule } from './application-migrations/application-migrations.module';
|
|
import { AdminModule } from './admin/admin.module';
|
|
import { HealthModule } from './health/health.module';
|
|
import { StorageModule } from './storage/storage.module';
|
|
import configuration from './config/configuration';
|
|
|
|
@Module({
|
|
imports: [
|
|
// Configuration
|
|
ConfigModule.forRoot({
|
|
isGlobal: true,
|
|
load: [configuration],
|
|
}),
|
|
|
|
// Database
|
|
TypeOrmModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
type: 'postgres',
|
|
host: configService.get('database.host'),
|
|
port: configService.get('database.port'),
|
|
username: configService.get('database.username'),
|
|
password: configService.get('database.password'),
|
|
database: configService.get('database.name'),
|
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
|
synchronize: configService.get('nodeEnv') === 'development',
|
|
logging: configService.get('nodeEnv') === 'development' ? ['error', 'warn'] : false,
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
|
|
// Redis / Bull Queue
|
|
BullModule.forRootAsync({
|
|
imports: [ConfigModule],
|
|
useFactory: (configService: ConfigService) => ({
|
|
redis: {
|
|
host: configService.get('redis.host'),
|
|
port: configService.get('redis.port'),
|
|
},
|
|
}),
|
|
inject: [ConfigService],
|
|
}),
|
|
|
|
ThrottlerModule.forRoot([
|
|
{
|
|
name: 'default',
|
|
ttl: 60_000,
|
|
limit: 120,
|
|
},
|
|
]),
|
|
|
|
// Feature modules
|
|
StorageModule,
|
|
AuthModule,
|
|
UsersModule,
|
|
ApplicationsModule,
|
|
DeploymentsModule,
|
|
ClustersModule,
|
|
KubernetesModule,
|
|
BuildModule,
|
|
TicketsModule,
|
|
BillingModule,
|
|
SnapshotsModule,
|
|
LifecycleModule,
|
|
ApplicationMigrationsModule,
|
|
AdminModule,
|
|
HealthModule,
|
|
],
|
|
providers: [
|
|
{
|
|
provide: APP_GUARD,
|
|
useClass: ThrottlerGuard,
|
|
},
|
|
],
|
|
})
|
|
export class AppModule {}
|