I currently have two modules:
Auth
which handles login and registrationUser
which handles all user crud operations
Auth
requires the User
module to register and validate users. So currently, Auth
imports the User
module:
@Module({
imports: [UserModule],
components: [JwtStrategy, GithubStrategy, TokenService, LoginService],
controllers: [AuthController],
})
However, as a result if I ever wanted to re-use these modules, I'd have to include both. Furthermore, if I moved the User
module, I'd have to update all the references to it within the Auth
module. Is there a better way to organise two dependent modules? Should they be combined?
Is there a better way to do this?