Build a NestJS & NextJS Monorepo with Turborepo - Step by Step Tutorial
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- In this tutorial, you'll learn how to create a monorepo that combines both a NestJS project and a NextJS project using Turborepo. Follow along with Vahid, your host, as he walks you through the process of setting up the monorepo, installing necessary packages, and managing dependencies efficiently. You'll discover how to share packages between projects and how to run both applications simultaneously with ease.
This video is perfect for developers interested in streamlining their project management and improving workflow efficiency. If you're new to monorepos or looking to enhance your knowledge of Turborepo, this tutorial provides a comprehensive, hands-on guide.
Key Topics Covered:
1- Installing and setting up Turborepo
2- Combining NestJS and NextJS projects into a single monorepo
3- Managing dependencies across multiple projects
4- Running and building applications in a monorepo environment
If you find this video helpful, don't forget to like, share, and subscribe for more in-depth tutorials and courses on Node.js frameworks, especially NestJS and NextJS. Stay tuned for more content!
Your training video covers the topic of authentication perfectly! I haven’t seen anything better even in paid courses! I like the way you explain the material: repeating important aspects whenever possible. This way the information is absorbed better and everything becomes clear.
Wow, thank you so much for such amazing feedback! 😊 I’m truly honored to hear that you found the video so helpful, even compared to paid courses.
By the way, if you enjoy learning and want to dive deeper into computer science topics made simple, I run another channel where I summarize key concepts from CS books. I would be very glad if you subscribe to my new channel: th-cam.com/channels/ZYhXrFwhFUOXuSQNgfk-Sw.html
@@SakuraDev
Signed! Serious topics. Great content. I will study. I recommend everyone.
Your nest course has been of great help to me. I hope you can continue to update and complete this course. You are really great. This is a super meaningful thing.
Thanks for your support 🙏. After a short break, I'll be resuming my tutorials this week. Is there any specific topic you want me to cover
@@SakuraDev ❤thank you for your efforts。About next combining with nest, plus GraphQl, prisma, and combining with database. These are combined into a relatively comprehensive small tutorial or small project. Or microservice project。
Amazing useful tutorial. Thanks
Mamnoonam doost e aziz
Ojazo pa, buenos vídeos la verdad. Se aprecia el tema que compartas el contenido B)
¡Gracias, hermano! Me alegra que te gusten los vídeos. Seguiré compartiendo más contenido interesante. ¡Un saludo
That’s awesome 💯🔥
Thanks for your support 💖🙏
@@SakuraDev thank you for excellent content and sincere self giving 🙏
@@Mahadev-x7u I am really glad to have you in my channel ❤️
great stuff, I want more
Thanks 🙏. The next video is also on this topic
exceelent. please also make deploy on vercel both project
Thank you! I'm glad you found it helpful! 😊 I'll definitely consider creating a tutorial on deploying both projects on Vercel. Stay tuned for updates, and let me know if there's anything specific you'd like me to cover!
By the way, if you enjoy learning and want to dive deeper into computer science topics made simple, I run another channel where I summarize key concepts from CS books. Check it out: th-cam.com/channels/ZYhXrFwhFUOXuSQNgfk-Sw.html
This is so cool, thank your for this awesome tutorial, nestjs and nextjs monorepo seem like a very good stack for a full stack project, why don't you make us a tutorial of building an entire web app with this stack.
Thanks for the suggestion! I totally agree-Nest.js and Next.js make a powerful full-stack combo. I’ll definitely consider making a tutorial series where we build a complete web app using this stack. Stay tuned! 🚀
@@SakuraDev I hope you can create a tutorial that combines nest and next. Please continue to complete this nest tutorial.
@@tiantaichen8514 I have recorded that and I upload it on Monday
Awsm 👏👏
Let's do more on this topic
Let's deploy it on Vercel on same server
Awesome! Deploying it on Vercel sounds like a great idea. I'll make sure to cover that in an upcoming videos. Stay tuned! 🚀💻
Great tutorial! Hope you can create an example to deploy nest on vercel :)
Thanks! That's a good idea. I will think about it.
Thank you soooo much 🎉
You’re welcome 😊
@@SakuraDev Can you make a ci/cd and dev, prod docker tutorial using aws?
@@furkanc6407 I will add it on my list
Please more on this topic
Thanks for the feedback, Alessio! I'll definitely dive deeper into this topic in future videos. Stay tuned! 😊📚
Hi Am created a turborepo nestjs & nextjs project but how to handle deployment in vercel ?
I will create a short tutorial about it
Thank you so much for your effort ♥🎉. I saw in the video that when you use the monorepo structure, you can use one command to run both projects, and they share the same node_modules. Does this setup have any extra benefits? I mean, what's the difference between a Next.js and Nest.js monorepo project compared to having both as standalone projects? Also, how do we deploy this type of monorepo project on Vercel? Do we need any specific configuration?
Thanks for the great question! A monorepo allows you to share dependencies and code between Next.js and Nest.js, making development more streamlined. It also simplifies versioning and project management. For deploying on Vercel, you can configure both apps in the same repository with a vercel.json file, ensuring each project is built and deployed correctly.
Please explain! Is it necessary to use Nextjs api route to set cookies in the browser? Isn't it better to do this using Nestjs? Will this help eliminate unnecessary redirects and the need to pass sensitive information to searchParams?
Yes, you’re absolutely right! Using NestJS to handle cookies directly is often a better approach, as it centralizes logic and avoids unnecessary redirects or exposing sensitive information in searchParams. It’s a cleaner solution, especially in production-level applications. Let me know if you’d like more details or examples!
@@SakuraDev Thank you very much for the answer! You are the best teacher. Please write down a lesson on how to properly process cookies in Nestjs. He really needs him!
Thanks about content. With turbo repo, web and api wil store in diffrence repo on git, right ?
is it possible to run them both in same port ?
Nice question. You can configure nginx for running two apps on the same Port
awesome .. but what about the git stuff, since nest initialize its own git
Good point, I'll talk about it my next video
how would authentication work in such scenario? please make a video on that
It should be handled in nestjs. My next video is about that. Stay tuned
It would be great if you could build a small Nextjs Nestjs Postgres contact app and deploy it on a cloud server. thanks
That’s a great idea! I'll work on creating a small Next.js + Nest.js app with PostgreSQL and deploy it to a cloud server. Thanks for the suggestion! Stay tuned! 🚀
It does not work fine for me. Like In my setup I have 2 Nextjs Apps and 1 Nest app. Also I have some packages in my mono repo. When I try to import something from the packages folder in my nest app it gives error because nest use common js modules and next js use es modules. can you please use packages in both next and nest js app and give me a demo
Thanks
Thanks for pointing that out! The issue arises from the difference in module systems used by Next.js (ES modules) and Nest.js (CommonJS). I'll work on a demo that shows how to set up and share packages between Next.js and Nest.js in a monorepo. Stay tuned for that! 🚀
@@SakuraDev Thank you so much. I'm waiting for demo. It will be very helpful for me
please turborepo with next and prisma ... greetings from Venezuela
Of course 👋💖🙏
I think you can read my mind 😆😆
Haha, maybe I can! 😄 I’m just here to help bring your ideas to life. Glad we’re on the same page! 🚀🧠
How to handle deployment?!
It's easy but a little tricky. I will upload a video for it
It would have been much better if you would have made the setup from scratch for once rather than using the turbo-cli, it just helps to understand all the wirings.
Hi, Thanks for your suggestion. I will create a video for that
is this gonna be fullstactk project
Yes, it will be a full-stack project! The frontend will be built with Next.js, the backend with Nest.js, and PostgreSQL will handle the database. Stay tuned! 🚀
Plis do with prisma on nest js
In the next video I will use Prisma
@@SakuraDev great, can you do after next video using prisma, make it with docker compose? 😁