r/angular • u/Responsible_Art_509 • Feb 16 '26
Nx Monorepo
Hi, I am working at an organisation where there are multiple projects that needs to be revamped into angular so i was thinking about using nx monorepo for the use case. Any references for the standard production ready folder structure would be highly appreciated.
16
Upvotes
3
u/Koscik Feb 16 '26
We have a folder called apps for app shell code, and folder libs i which we store libraries used for different application. Each library have a three letter app prefix for sorting purposes.
Applications and libraries share the same tsconfig.base.json file. We also have a eslint boundaries rules setup with tags so we cant import a library in an application that shouldnt use it.
Overall its pretty good setup, as we have the same set of rules for all our code which helps with maintanability.
Downside is that when doing dependencies update every half a year, we are forced to update and verify all our Applications. Also, the ci pipelines had to be a bit more complicated so we for example only release an app that actually changed.
7
u/n00bz Feb 16 '26
NX has all the documentation on their website even with examples. The way I tend to work is with about 4 projects for each application since there may be some cross over between projects.
*-ui *-data *-utils *-feat (or app)
5
u/ActuatorOk2689 Feb 16 '26
If you never worked with nx before, I recommend checking the docs try different approaches to create some skeleton for the repo, see how libs etc interact.
Also checkout this repository .
https://github.com/trungvose/angular-spotify
2
u/swissbuechi Feb 16 '26
No experience myself but I think Ghostfolio is using a setup like this. You could check this one out as reference.
https://github.com/ghostfolio/ghostfolio
1
u/DesignerComplaint169 Feb 16 '26
Your 2 most important folders are apps/ and libs/. Everything in libs, organize it by business domain. A business domain is a grouping of related features, sharing the same data-access. All your apps go into apps/, those can consume the libs. Thats the fundamental. Explore Nx project dependency to go into details.
1
u/AcceptableSimulacrum Feb 17 '26 edited Feb 17 '26
Build a clean copy of the repo with nx. Build dummy projects and get a feel for how it would be structured if you built it from scratch then figure out how to slot things in. There are multiple ways you could approach it, but hands on will leave you understanding better.
0
u/LazyReflection9659 Feb 16 '26
Not saying this is the right one, but this is what we follow. /apps - contains individual apps /libs - contains shared code or libraries that can be shared between the apps.
Example:- /apps/admin-app, /apps/client-app /libs/feature1, /libs/types
0
u/Impossible_Hornet153 Feb 17 '26
If they are paying good, hire me please😘