Labels: good first issue backend documentation setup
Area: backend/src/main.ts
Difficulty: Beginner
Description
The backend needs interactive API documentation so frontend developers and contributors can explore endpoints without reading source code. NestJS integrates with Swagger via @nestjs/swagger to auto-generate this from decorators.
Acceptance Criteria
Technical Notes
transform: true on ValidationPipe enables automatic type coercion for query params (strings → numbers)
- Swagger should only be mounted when
NODE_ENV !== "production" to avoid exposing docs in production
Labels:
good first issuebackenddocumentationsetupArea:
backend/src/main.tsDifficulty: Beginner
Description
The backend needs interactive API documentation so frontend developers and contributors can explore endpoints without reading source code. NestJS integrates with Swagger via
@nestjs/swaggerto auto-generate this from decorators.Acceptance Criteria
backend/src/main.tsas the NestJS application bootstrap fileSwaggerModulewith aDocumentBuilderthat sets:title: "The Lighted API"description: "Restaurant management platform API"version: "1.0"addBearerAuth()for JWT authentication/api/docsusingSwaggerModule.setup("api/docs", app, document)app.enableCors()withorigin: process.env.FRONTEND_URL,credentials: trueValidationPipewithwhitelist: true,forbidNonWhitelisted: true,transform: trueClassSerializerInterceptorto respect@Exclude()decorators on entitiesprocess.env.PORTfalling back to3001Technical Notes
transform: trueonValidationPipeenables automatic type coercion for query params (strings → numbers)NODE_ENV !== "production"to avoid exposing docs in production