# Best Practices — NestJS: Scalable Node.js APIs बनाना

Source: https://www.skillbyai.com/hi/nestjs/nestjs-best-practices

> NestJS conventions अपनाएँ: feature-आधारित folders, boundary पर DTO validation और एक समान error handling।

## Folder structure और naming

एक feature एक folder में; consistent naming (*.controller.ts, *.service.ts, *.module.ts); type से नहीं बल्कि domain से group करें।

## DTOs और validation

Input validation के लिए हमेशा DTOs का उपयोग करें; create/update DTOs को separate करें; boundary (controller) पर validate करें।

## Error handling uniformity

Clear messages के साथ HTTP exceptions throw करें; responses को consistently format करने के लिए global filter का उपयोग करें।
