I have seen the following project structure so far:
src
- cats
- dto
- create-cat.dto.ts
- interfaces
- cat.interface.ts
- cats.controller.ts
- cats.module.ts
- cats.service.ts
- app.module.ts
- main.ts
The cats module units related functionalities (service and controller) and it makes sense.
Let s now imagine we have 2 parts of our application:
- Customer portal for users to manage their cats.
- Admin panel for admins to manage all cats.
Each part needs its own controller, but I feel like both controllers should use the same service. What would be a proper way to achieve this functionality?
Is it a good idea to make a module for service and 2 modules for controllers importing it? Or maybe 1 module for both controllers? The best option, which comes to my mind just make a controllers directory and make each controller (admin and portal) part of the same cats module.