feat: Initialize NestJS backend project with Prisma, core modules, configuration, and common utilities.

This commit is contained in:
pradeepkumar
2025-12-18 23:05:04 +05:30
commit 7990846711
28 changed files with 21284 additions and 0 deletions

54
src/app.module.ts Normal file
View File

@@ -0,0 +1,54 @@
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { ThrottlerModule, ThrottlerGuard } from '@nestjs/throttler';
import { APP_GUARD } from '@nestjs/core';
import { ScheduleModule } from '@nestjs/schedule';
import { EventEmitterModule } from '@nestjs/event-emitter';
import { configuration } from './config';
import { PrismaModule } from './prisma';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [
// Configuration
ConfigModule.forRoot({
isGlobal: true,
load: [configuration],
envFilePath: ['.env.local', '.env'],
}),
// Rate Limiting
ThrottlerModule.forRoot([
{
ttl: 60000, // 60 seconds
limit: 100, // 100 requests per minute
},
]),
// Task Scheduling
ScheduleModule.forRoot(),
// Event Emitter
EventEmitterModule.forRoot(),
// Database
PrismaModule,
// Feature Modules (will be added as we develop them)
// AuthModule,
// UsersModule,
// AgentsModule,
],
controllers: [AppController],
providers: [
AppService,
// Global Rate Limiting Guard
{
provide: APP_GUARD,
useClass: ThrottlerGuard,
},
],
})
export class AppModule {}