Decorators are special functions that add metadata to classes, methods, or properties. They enable Nest.js to understand how to structure and handle different parts of the application.
Common decorators:
@Controller('users') // Defines a controller
@Get() // HTTP GET method
@Post() // HTTP POST method
@Injectable() // Makes class injectable
@Module() // Defines a module
@Param('id') // Route parameter
@Body() // Request body
@Query() // Query parameters
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.