DESCRIPTION
The NestJS API has no auto-generated documentation. Contributors and frontend developers must read raw TypeScript source to discover available endpoints, required headers, request bodies, and response shapes. NestJS ships with @nestjs/swagger which generates an interactive Swagger UI and an openapi.json spec from decorators — zero separate doc-writing required.
GOAL
A Swagger UI is served at /api/docs when the API runs locally. Every endpoint shows its HTTP method, path, required auth, request body schema, and possible response codes. Developers can explore and test the API from the browser without reading source code.
REQUIREMENTS
- Install
@nestjs/swagger and swagger-ui-express in apps/api
- Bootstrap the
SwaggerModule in apps/api/src/main.ts with project metadata (title: VELAR API, version, description)
- Mount the UI at
/api/docs (only in non-production environments)
- Add
@ApiTags() to every controller: auth, bonds, transfers, audit, users, parties, reports
- Add
@ApiBearerAuth() to every controller or route guarded by AuthGuard
- Decorate the main DTOs / input classes with
@ApiProperty() so request body schemas appear in the UI:
RegisterDto (or current RegisterInput)
RegisterBondInput and BondRequestInput from @velar/types
- Add
@ApiResponse() on at least the most important responses (200, 201, 400, 401, 403)
- Export the
openapi.json spec as a static file under apps/api/public/openapi.json so it can be consumed by external tools
ACCEPTANCE CRITERIA
NOTES
Relevant files: apps/api/src/main.ts, apps/api/src/auth/auth.controller.ts, apps/api/src/bonds/bonds.controller.ts, apps/api/src/transfers/transfers.controller.ts, apps/api/src/audit/audit.controller.ts.
Reference: https://docs.nestjs.com/openapi/introduction
Good first task — no blockchain or Stellar knowledge required. Purely additive change with no risk of breaking existing behavior.
Difficulty: Beginner
Priority: Medium
DESCRIPTION
The NestJS API has no auto-generated documentation. Contributors and frontend developers must read raw TypeScript source to discover available endpoints, required headers, request bodies, and response shapes. NestJS ships with
@nestjs/swaggerwhich generates an interactive Swagger UI and anopenapi.jsonspec from decorators — zero separate doc-writing required.GOAL
A Swagger UI is served at
/api/docswhen the API runs locally. Every endpoint shows its HTTP method, path, required auth, request body schema, and possible response codes. Developers can explore and test the API from the browser without reading source code.REQUIREMENTS
@nestjs/swaggerandswagger-ui-expressinapps/apiSwaggerModuleinapps/api/src/main.tswith project metadata (title: VELAR API, version, description)/api/docs(only in non-production environments)@ApiTags()to every controller:auth,bonds,transfers,audit,users,parties,reports@ApiBearerAuth()to every controller or route guarded byAuthGuard@ApiProperty()so request body schemas appear in the UI:RegisterDto(or currentRegisterInput)RegisterBondInputandBondRequestInputfrom@velar/types@ApiResponse()on at least the most important responses (200, 201, 400, 401, 403)openapi.jsonspec as a static file underapps/api/public/openapi.jsonso it can be consumed by external toolsACCEPTANCE CRITERIA
GET /api/docsreturns the Swagger UI when runningnpm run start:devinapps/api/auth/registerand/bondsare fully described (no{}body)npm run buildpasses inapps/apinpm run lintwithout new errorsNODE_ENV === 'production'guard inmain.ts)NOTES
Relevant files:
apps/api/src/main.ts,apps/api/src/auth/auth.controller.ts,apps/api/src/bonds/bonds.controller.ts,apps/api/src/transfers/transfers.controller.ts,apps/api/src/audit/audit.controller.ts.Reference: https://docs.nestjs.com/openapi/introduction
Good first task — no blockchain or Stellar knowledge required. Purely additive change with no risk of breaking existing behavior.
Difficulty: Beginner
Priority: Medium