The project should follow this folder structure
api
folder houses all the endpoints, including their corresponding controllers and services. In certain scenarios, subdividing the api
folder further is sensible. For instance, if there’s an app and a dashboard each accessing different endpoints or having distinct logic, creating separate controllers and services for each is prudent to retain clarity. For example, a dashboard
folder for all dashboard endpoints and an app
folder for all app endpoints.
api
folder alongside controllers and services. Instead, they reside at the root src
level within a schemas
folder.
globals
folder is designated for global functions, services, and variables, all neatly organized into sub-folders.
src
root level in a dedicated dtos
folder, where each schema’s DTOs are defined.
guards
, dtos
, etc. For the specifics on how files within these folders should be named, refer to the Naming Conventions section.