fastify-cli icon indicating copy to clipboard operation
fastify-cli copied to clipboard

[Code organisation] Appropriate place to add middlewares, hooks and decorators in the project directory?

Open Ashvith10 opened this issue 1 year ago • 0 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the issue has not already been raised

Issue

This would've been a nice question to ask on the Discussion tab, but there isn't any for the fastify-cli project, hence I've added this to "Issues".

The project I am working on is a simple URL shortener. perhaps with some extras like authentication, JWT and analytics. But since I want to create a well-polished project for my portfolio, I also want to be able to arrange the internal components in a clean, organized format.

In the default template, there is a plugin directory that contains community-made plugins. Given how there's decorators in the template, would it be proper of me to assume that all the hooks, middle-wares and decorators go in this? Or do I create separate folders?

Should I be concerned about how these hooks, decorators and middlewares are loaded, and in what sequence?

Ashvith10 avatar Dec 07 '24 08:12 Ashvith10