Skip to content

Issue #93: Backend — AppModule Configuration #246

@wumibals

Description

@wumibals

Labels: backend setup nestjs
Area: backend/src/app.module.ts
Difficulty: Intermediate

Description

AppModule is the root module that wires together every feature module, database connection, configuration, and global providers. It needs to be set up correctly so all modules can resolve their dependencies.

Acceptance Criteria

  • Create backend/src/app.module.ts with @Module({}) AppModule
  • Import ConfigModule.forRoot({ isGlobal: true, envFilePath: ".env", load: [appConfig, databaseConfig, cloudinaryConfig] })
  • Import TypeOrmModule.forRootAsync(typeormConfig) using the config factory from Issue [Contract] Order Management — Status Lifecycle & Cancellation #84
  • Import all feature modules: AuthModule, AdminModule, MenuModule, ContactModule, GalleryModule, InstagramModule, AnalyticsModule, TrendingModule, AuditModule, UploadModule
  • Import ThrottlerModule.forRoot([{ ttl: 60000, limit: 100 }]) for basic rate limiting
  • Apply ThrottlerGuard globally via APP_GUARD provider
  • No controllers or providers defined directly in AppModule — all logic lives in feature modules

Technical Notes

  • ConfigModule with isGlobal: true makes ConfigService available everywhere without re-importing ConfigModule
  • Rate limiting at 100 requests per minute is a sensible default; individual controllers can override with @Throttle()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions