Hey Folks! I want to brainstorm something with y'all regarding module boundaries/project structure.
Let's imagine that I'm building a Modular Monolith that has two different Bounded Contexts: one Users and one Purchase. In a micro(or macro)service world, these could be two different services. In a Modular Monolith approach I'm making them 2 different modules in NestJS. They only export their Use Cases. Each module has a transaction boundary that cannot span beyond that module.
Now, inside User and inside Purchase a similar situation can happen. You can keep dividing by domain (if you want) but let's assume that this is not the case. What would the structure for these modules look like? We want to still to have some kind of structure for modules, but these modules do not form a "bounded context", meaning that a transaction may span sub entities.
What are your thoughts on this?