
Domain-First Nx Monorepos: Using `packages/` to Make Ownership and Boundaries Obvious
Where should this go? Which apps are using this library? Those two questions are plaguing my team as our monorepo grows. Not because we don’t know Nx, TypeScript, or React—but because our folder structure doesn’t clearly communicate ownership . We started with a pretty standard setup: apps/<app> libs/<domain>/<lib> libs/shared/<lib> That structure was a great starting point (this was our first real dive into monorepo architecture). It was simple, it scaled enough , and it let us move fast early on. But we’re now at ~40 libraries and growing, and it’s becoming less obvious: where a new library should live, and whether a library is truly domain-specific or actually shared. This post explains why we plan to migrate to a domain-first packages/ layout . The main goal being domain clarity (and making module boundaries easier to enforce consistently ). Flat libs/ worked… until it didn’t The hardest part of a growing monorepo isn’t the tooling—it’s the ambiguity. When everything live
Continue reading on Dev.to
Opens in a new tab




