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
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?
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!
I’d actually recommend trying out pnpm workspaces instead of yarn!
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.
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!
Yeah, I mean the Next.js app and the Express API are both part of my backend architecture.