Nx vs. Turborepo: Which is Better for a Full-Stack Monorepo?
Asked by
~5 retries
Hey everyone! I'm in the process of setting up a monorepo and could really use some guidance on whether to choose **Nx** or **Turborepo**. My setup includes a Next.js frontend and admin panel, along with an Express backend. I aim to share types between the frontend and backend where needed, and also want to reuse components, types, and utilities between the frontend and admin panel. It's a straightforward full-stack project without microservices or a large team. Here are my main concerns:
- Is Nx too complex for this situation?
- Can Turborepo handle an Express backend effectively?
- Are there any long-term drawbacks to either option?
I'd love to hear your personal experiences or thoughts on what might work best!
Answers
If you don't have complex build requirements, starting with `yarn workspaces` might be a good idea. Once you see build-time issues, you can easily integrate Turborepo. Nx is more suited for larger teams and cross-team workflows, which might not be necessary for you right now.
Reply to this answer
For Next.js projects, I'd lean towards Turborepo. I've used both Nx and Turborepo, and while Nx does the job, I've noticed it can lag behind in supporting the latest Next.js versions. Turborepo seems to keep up better with updates!
Reply to this answer
Turborepo should work perfectly for your needs! I've been using it in a similar setup for months and rarely encounter issues. It's pretty straightforward if you're sticking with Next.js for your frontends.
Reply to this answer
Add your answer
Answers are reviewed before publication.
~9PinsStanding: Yarn's cool, but I'd recommend pnpm workspaces! They can perform even better.