Nx vs Turborepo: Which to Choose for My Full-Stack Monorepo?

0
0
Asked By CuriousCoder93 On

Hey folks! I'm in the process of setting up a monorepo and I need some insights on whether I should go with **Nx** or **Turborepo**. Here's what I've got planned:

- **Frontend:** Using Next.js
- **Admin Panel:** Also built with Next.js
- **Backend API:** Running on Express
- I'm looking to share:
- Types between the frontend and backend (if needed)
- Shared components, types, and utility functions between both frontends

Overall, nothing too complex — no microservices or a massive team involved, just aiming for a clean full-stack setup with some code reuse.

Here are my main questions:
- Is Nx overkill for this project?
- Does Turborepo handle an Express backend effectively?
- Any long-term pain points with either option?

I'd really appreciate hearing about your experiences or any recommendations!

4 Answers

Answered By CodeJuggler77 On

Honestly, you might be fine sticking with just PNPM for your workspace management. I'm not entirely sold on the big benefits of Nx or Turborepo for simpler setups. Plus, I'm a bit confused about the mention of having two backends? Are you referring to Next.js and Express as separate backends?

CuriousCoder93 -

Yeah, I mean the Next.js app and the Express API are both part of my backend architecture.

Answered By DevWhisperer38 On

If your builds don’t depend on each other, maybe kick things off with `yarn workspaces`. If you hit some snags with build times later, you could always add Turborepo into the mix easily. Nx is more for complex setups, which might not be necessary for your case right now!

FrontendFanatic21 -

I’d actually recommend trying out pnpm workspaces instead of yarn!

Answered By DevDude42 On

I think Turborepo will work great for your setup! I've been using it for a while with a similar stack and rarely run into issues. It’s pretty solid for handling Next.js projects.

Answered By FrontendFanatic21 On

If you're focused on Next.js, definitely go with Turborepo. We’ve tried Nx, and while it works well, it sometimes takes longer for Nx to catch up with the latest Next.js versions compared to Turborepo. It might be less hassle in the long run!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.