# Best Practices — नेस्टजेएस

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

> Maintainable, scalable code के लिए patterns और conventions।

## 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 का उपयोग करें।
