DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

How do you frontend-backend monorepo?

That also includes backend isn't JavaScript.

My folder structure a while ago is like this,

- package.json
- .eslintrc
- packages/
  - local-frontend/
  - web-frontend/
  - server/
Enter fullscreen mode Exit fullscreen mode

I don't use Lerna, nor Workspace.

But if so, how do I deploy?

Top comments (3)

Collapse
 
hendrikfoo profile image
Hendrik Richert

If your FE and BE code is both Typescript-based (Angular/React + Express/NestJS), I highly recommend NX (nx.dev/), but as you mentioned, Lerna and Yarn Workspaces are both viable options, just with a little bit less "automagic".

What do you mean wrt deploying exactly?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I am not familiar with both Angular and React (I generally use Vue), but I can try.

Collapse
 
qm3ster profile image
Mihail Malo

There's also pnpm, whose workspaces hoist all node_modules and enable other features like upgrading dependency version or running tests across all or a subset of packages. I religiously use pnpm because of its correctness and speed.

And Rush, which manages things like only bumping dependencies when needed and based on commit messages, and releasing. It can use npm, yarn, or pnpm. It's especially useful when packages in your monorepo depend on each other, and not just independent applications that support one feature.
Still, you could definitely use it to only deploy the package you touched.