I'm going insane on how to rigorously structure my monorepo (backend + frontend)
TL;DR: Is there already a good framework/starter-kit for designing good maintainable frontend/backend monorepos? I'm not talking about bundlers like turborepo or NX, neither I'm talking about t3-stack or better-t-stack, I'm talking more of a very strict paradigm to design typescript frontend/backend monorepos.
I am currently slowly migrating a vibe-coded prototype of a huge software (20+ domains) to an actual production-ready product and I'm noticing how I'm slowly starting to hate the freedom TS/JS gives you, the fact that you can shape your codebase how you wish, the first refactoring I did was migrating all those scattered small sloppy ts files to domain services/sub-services, providing strong hiearchy (Java/C# like), but then noticed that I wasn't leveraging monorepo's features the fullest, so I had to modularize everything, but here I don't know what to do anymore, I don't think I was the only one facing this issue, and I can't migrate to another language 'cause we just can't afford it. The architecture I've thought of was to divide domains in packages and make packages have a strict structure both folder-wise and code-wise:
@acme/foo/
├── app/
│ ├── services/
│ │ └── foo/
│ │ ├── index.ts
│ │ └── types.ts
│ └── routers/
│ └── index.ts
├── data/
│ ├── models/
│ │ └── index.ts
│ └── index.ts
└── web/
├── components/
│ ├── Foo.svelte
│ └── Bar.svelte
└── index.ts
But I feel I'm reinventing something someone must have already figured out, but I don't know where to search anymore...