Getting started with Turborepo

  Рет қаралды 48,447

Hamed Bahram

Hamed Bahram

Күн бұрын

Пікірлер: 131
@engageintellect
@engageintellect Жыл бұрын
Spent a few hours looking for docs to add tailwind to turbo (and share between projects). Your walkthrough was very well explained, made a ton of sense, and saved me time. Cheers 🍻
@hamedbahram
@hamedbahram Жыл бұрын
Great to hear that! welcome to the channel 😀
@koigxiritb7ttgyuv
@koigxiritb7ttgyuv Жыл бұрын
Great video, answered 90% of my questions. Thanks for using Tailwind as an example.
@hamedbahram
@hamedbahram Жыл бұрын
Glad it was helpful!
@anbarasu1997
@anbarasu1997 Жыл бұрын
Wow! So elegantly explained. Thanks for the video. I started working on a project which is managing multiple projects using turborepo. This video will definitely help me in exploring further.
@hamedbahram
@hamedbahram Жыл бұрын
Glad it was helpful!
@rishabh7g
@rishabh7g Жыл бұрын
Great content. Please continue to make such excellent content. 34 minutes Worth it.
@hamedbahram
@hamedbahram Жыл бұрын
Thanks! I'm glad you think so.
@emee__
@emee__ Жыл бұрын
Hello, how can someone add env file, because for some reasons turborepo isn't importing my .env files
@hamedbahram
@hamedbahram Жыл бұрын
Each project can have its own environment variables.
@codewithguillaume
@codewithguillaume Жыл бұрын
Thank you for this presentation Hamed ! Subscribed :)
@hamedbahram
@hamedbahram Жыл бұрын
Welcome to the channel Guillaume.
@mumk
@mumk Жыл бұрын
Thanks you so much, just what I needed, Turborepo with Tailwind configs as packages! Awesome tutorial and hope you have a great day, cheers
@hamedbahram
@hamedbahram Жыл бұрын
Glad it helped! And welcome to the channel
@mumk
@mumk Жыл бұрын
@@hamedbahram glad to be here too :)
@igmtink
@igmtink Жыл бұрын
this is the only one tutorial on youtube that I clearly understand 😊 love it! ❤ btw I see the NextUI is created too turborepo, can you do a tutorial how to create own component library using also the turborepo then publish to npm package?
@hamedbahram
@hamedbahram Жыл бұрын
Glad to hear that! Interesting idea, that'd be quite a project 🤓
@igmtink
@igmtink Жыл бұрын
@@hamedbahram thank you 😊
@stevenlocke5917
@stevenlocke5917 2 жыл бұрын
Congrats on hitting 1000 subs!!!
@hamedbahram
@hamedbahram 2 жыл бұрын
Thank you Steven, and welcome to the channel.
@JaredFL
@JaredFL Жыл бұрын
I'm curious why you wouldn't install tailwind as a dev dep on the root since it'll be used in the docs and web workspace
@sams64sf
@sams64sf Жыл бұрын
Imagine you add another package that’s not UI-related - an API or cli tool etc. it might not need tailwind.
@hamedbahram
@hamedbahram Жыл бұрын
Good question Jared, you can if you want, but you might have other workspaces like configs and utility packages that don't depend on tailwind.
@hamedbahram
@hamedbahram Жыл бұрын
Thanks Sam for contributing to the question.
@joylodralive
@joylodralive Жыл бұрын
Hi Hamed, great video. How do we deploy this monorepo to the Internet? Do we still have to deploy them one by one?
@hamedbahram
@hamedbahram Жыл бұрын
It depends on your project, if they are meant to work separately which is often the case, you'll deploy them separately.
@GigsofRam
@GigsofRam Жыл бұрын
I really appreciate this tutorial. Thanks for being so thorough.
@hamedbahram
@hamedbahram Жыл бұрын
You are so welcome! I'm glad it was helpful. I appreciate your comment.
@danilocunha5220
@danilocunha5220 Жыл бұрын
We are attempting to use Turbopack, but we consistently encounter issues when attempting to locate a required module for a package. For example, if you need to add "plugin:prettier/recommended" on the ESLint extends, the eslint fails to load the prettier package.
@hamedbahram
@hamedbahram Жыл бұрын
Hmm 🤔 never encountered that problem before! Don't have much insights around that to share...
@ThanHtutZaw3
@ThanHtutZaw3 10 ай бұрын
Can I use mono repo for MEVN stack that are separately deployed on vercel. The problem is cannot access zod schema in both frontend and backend in production
@hamedbahram
@hamedbahram 10 ай бұрын
Good question 🤔 I'm not sure!
@mohdsahil226
@mohdsahil226 Жыл бұрын
Thank you! Your way of teaching is really amazing. Would you please create a video on how to add react-testing library to turborepo?
@hamedbahram
@hamedbahram Жыл бұрын
Thank you Mohd. I'll definitely have a video on testing in NextJs.
@SanderCokart
@SanderCokart Жыл бұрын
Wouldn't adding ../../packages to tailwind content key result in your tailwind in docs to generate redundant css? Like unused classes for that particular apps/app. I'd recommend spreading the config and extending it with your own content key value pair per project.
@hamedbahram
@hamedbahram Жыл бұрын
Hmmm 🤔 interesting! will have a look at it.
@SanderCokart
@SanderCokart Жыл бұрын
@@hamedbahram adding packages is fine if you do have a only tailwind consuming repos within the mono. Gotta find a way to only generate the tailwind required for that particular repo
@macktheknife2037
@macktheknife2037 8 ай бұрын
Hi, it does not seem to be working with pnpm anymore? I get dependency issues.
@hamedbahram
@hamedbahram 8 ай бұрын
Hmm 🤔 I haven't tested it recently!
@shahidullahmuffakir668
@shahidullahmuffakir668 Жыл бұрын
It was very helpful, thank you. Keep it up!
@hamedbahram
@hamedbahram Жыл бұрын
Glad it helped!
@_sumitdey.exe1
@_sumitdey.exe1 Жыл бұрын
Do you think adding packages is a good option in the purge content array inside the shared config and not on individual workspace level ? If yes then How are you going to extend the tailwind config in ui? for example let's say I need a different theme in ui library. How can you do that? 2nd if you don't use tailwind config, you will not get tailwind intelligence in vs code.
@hamedbahram
@hamedbahram Жыл бұрын
That's a good question, I'd extend the tailwind config, but I'd have to think about the purging and theming... I'll keep you posted.
@parth_patel2933
@parth_patel2933 7 ай бұрын
how do we deploy our app on any hosting platform with this turborepo ?
@hamedbahram
@hamedbahram 7 ай бұрын
Each package will be it's own deployment, if you use vercel it detects the monorepo and prompts you in choosing which app you want to deploy.
@jakubsalanyk8830
@jakubsalanyk8830 Жыл бұрын
Nice intro, however, you have react in devDependencies in ui package, and also in dependencies in your web and doc apps (all using the same version). Isn't it duplication? Say, since I'm the owner of the monorepo, I want to use the same version of react in all workspaces (so if i update react, it should be reflected across all my apps and packages). Would such setup be a good approach?
@hamedbahram
@hamedbahram Жыл бұрын
I see... to me each package in your monorepo has its own dependencies, here React seems to be common between them, you can structure it in a different way, and that'll be fine.
@KNITHINKUMARREDDY
@KNITHINKUMARREDDY 8 ай бұрын
There is an environment variable in my .env file .Precisely, NEXTAUTH_SECRET = "ARJUN" , error: NEXTAUTH_SECRET is not listed as a dependency in turbo.json. Can someone help me fix this.
@hamedbahram
@hamedbahram 8 ай бұрын
Well, first of all you need a longer random secret that "ARJUN" but that aside, you need to load your environment variables in your monorepo explained in the following guide → turbo.build/repo/docs/handbook/environment-variables
@Mehdi-z4g
@Mehdi-z4g 2 ай бұрын
I have a question regarding Tailwind CSS. All the examples on the Turbo site focus on Tailwind, but we need examples with other design systems. How can I integrate a different design system with Turbo? Additionally, after building with pnpm, npm, or Yarn with Next.js, I can start the project, but I’m unsure how to do this with Turbo. What matters most to the customer is ensuring that the chosen methods effectively meet their needs. The problem with many techniques is that they are often left to unfold without clear guidance. I want to avoid wasting time on extensive building and configuration; I'd prefer to stick with familiar methods and concentrate on the application's logic. Thank you!
@hamedbahram
@hamedbahram 2 ай бұрын
What design system are you using?
@devsuthar6795
@devsuthar6795 5 ай бұрын
great video Hamed 👍👍
@hamedbahram
@hamedbahram 5 ай бұрын
Thanks 👍
@brianwachira
@brianwachira Жыл бұрын
I have followed your tutorial and I keep getting the error "Error: Cannot find module 'tailwind-config/tailwind-config.js' Require stack: - /Documents/otm/demov3.0/apps/web/tailwind.config.js" I keep getting that error even when I follow other tutorials. What could be the issue?
@hamedbahram
@hamedbahram Жыл бұрын
Try cloning my code and see if you get the same error. Here is a link to the source code on Github: github.com/HamedBahram/turbo-demo
@brianwachira
@brianwachira Жыл бұрын
@@hamedbahram Thank you, I found the solution to be adding tailwind-config to next config transpilePackages. Nextjs has changed since you released this tutorial.
@hamedbahram
@hamedbahram Жыл бұрын
@@brianwachira Sweet! glad you found the solution, and thanks for sharing it. Can you create a PR on my repo?
@brianwachira
@brianwachira Жыл бұрын
@@hamedbahram Yes I will. Thank you for the opportunity to contribute to your Repo.
@hamedbahram
@hamedbahram Жыл бұрын
@@brianwachira Awesome!
@jedi_v
@jedi_v Жыл бұрын
Thank you for making this video. It would be nice to create a similar video one for managing environment variable in this set up. :-)
@hamedbahram
@hamedbahram Жыл бұрын
Interesting use case 🤔 I'll look into that. Thanks for the suggestion.
@SumitDey-q3z
@SumitDey-q3z Жыл бұрын
Great Video Man. One question : You have not installed tailwind in ui. But still able to use tailwind inside that. How's it possible? Can you share the github repo of this?
@hamedbahram
@hamedbahram Жыл бұрын
There are different ways to add tailwind, I have it on the `ui` workspace and then pull it in my other workspaces. I don't think I have a repo for this, but you see the sample project on the docs here turbo.build/repo/docs/getting-started/create-new
@amineayachi335
@amineayachi335 Жыл бұрын
how i can add new apps in the apps folder like a new next application
@hamedbahram
@hamedbahram Жыл бұрын
Same way you would in any other project by running the create-next-app script. You can then go in the `package.json` and update the dependencies to use your other workspaces.
@saketabhishek5147
@saketabhishek5147 Жыл бұрын
One of the best video on Turbo
@hamedbahram
@hamedbahram Жыл бұрын
Thanks Saket! Glad you think so.
@rarutu
@rarutu Жыл бұрын
how do u deploy a turborepo project to cloudflare pages?
@hamedbahram
@hamedbahram Жыл бұрын
Good question! haven't done that unfortunately.
@iamAmeeeeeer
@iamAmeeeeeer 4 ай бұрын
can this be deployed on a VPS or is this vercel locked meaning can be only deployed on vercel
@hamedbahram
@hamedbahram 4 ай бұрын
Yes you can. Turborepo is a JS/TS build tool. You don't really deploy a turborepo but the individual projects it contains.
@iamAmeeeeeer
@iamAmeeeeeer 4 ай бұрын
@@hamedbahram alright got it! Thanks
@kevinhg9515
@kevinhg9515 9 ай бұрын
Absolutely great tutorial, thanks!
@hamedbahram
@hamedbahram 9 ай бұрын
Glad it was helpful!
@SanderCokart
@SanderCokart Жыл бұрын
This walkthrough is very underrated AWESOME! Maybe a better title such as Getting started with Turborepo | Example add tailwindcss to monorepo
@hamedbahram
@hamedbahram Жыл бұрын
Glad to hear that! Thanks.
@lenvaz8957
@lenvaz8957 Ай бұрын
Lovely... Thank you! Very helpful
@hamedbahram
@hamedbahram Ай бұрын
Glad it was helpful!
@maverick456-33
@maverick456-33 2 жыл бұрын
I like your tutorial a lot ! Thanks man ! I think Turborepo/Turbopack would be a game changer with Rust !
@hamedbahram
@hamedbahram 2 жыл бұрын
Yeah they are amazing!
@wizz1e80
@wizz1e80 5 ай бұрын
Great tutorial Can i add other kinds of applications to the monorepo like maybe a nestjs backend application?
@hamedbahram
@hamedbahram 5 ай бұрын
Yup!
@Lindhult
@Lindhult 2 жыл бұрын
Thanks for a really nice video 🙏⭐ I am curious about one thing. You are not transpiling the ui library, but instead exporting the “raw” tsx files. I guess this brings the responsibility of transpiling the shared library to the apps? And it makes it possible for the apps to auto-refresh directly when the files in the “ui” package changes. However, at 17:23 (kzbin.info/www/bejne/o6mvfXytj55mpLs) you show that the app “web” has a tsconfig containing “exclude”: [“node_modules”]. How is the “ui” library being transpiled?
@hamedbahram
@hamedbahram 2 жыл бұрын
Welcome to the channel Magnus. That's a good questions, in the tsconfig we're excluding the npm packages (i.e. "node_modules") and not our local workspace packages (i.e. the "ui" workspace) if that makes sense.
@Lindhult
@Lindhult 2 жыл бұрын
@@hamedbahram Thanks for the answer. Do you mean that the "ui" folder inside of the node_modules is still being targeted? Or are you reaching outside of the apps folder to target transpilation of the "ui" folder? Do you have the example as a repo in github or similar? It would be nice to have a look at the details of the project :)
@hamedbahram
@hamedbahram 2 жыл бұрын
@@Lindhult If you look at the repo linked below for a basic example of a turborepo project, you'll see a base tsconfig package that's being extended by other packages. github.com/vercel/turbo/tree/main/examples/basic
@k2nnethtan949
@k2nnethtan949 2 жыл бұрын
hmm... interesting... can I use app/docs as the backend, and app/web as a frontend?
@hamedbahram
@hamedbahram 2 жыл бұрын
Absolutely
@k2nnethtan949
@k2nnethtan949 2 жыл бұрын
@@hamedbahram How to install the library into packages\layout, then other projects I can share the same Navbar UI and so on...?
@hamedbahram
@hamedbahram 2 жыл бұрын
@@k2nnethtan949 you can create a 'UI' workspace and reference it as a dependency in your other workspaces, similar to the what I show in the video.
@DudesVerses
@DudesVerses Жыл бұрын
I really appreciate this tutorial, thank you for knowledge sharing❤
@hamedbahram
@hamedbahram Жыл бұрын
Glad it was helpful!
@shahidullahmuffakir668
@shahidullahmuffakir668 Жыл бұрын
I have one suggestion, rallly is an open source app. It is monorepo, with turbo. can you locally setup the repo. I want to contribute to it, but don't don't its project structure. Thank you
@hamedbahram
@hamedbahram Жыл бұрын
You can fork the open source project in your repo, and clone it locally, make changes, and open a PR to contribute to it.
@shahidullahmuffakir668
@shahidullahmuffakir668 Жыл бұрын
@@hamedbahram Thanks a lot for replying, but it has so many environment variables and it is monorepo, a little difficult for me.
@hamedbahram
@hamedbahram Жыл бұрын
@@shahidullahmuffakir668 Which project are you talking about?
@yonsama6469
@yonsama6469 Жыл бұрын
Hey great video! I have one question do you know if it’s possible to share an pages/api/folder between different app as dependencies ?
@hamedbahram
@hamedbahram Жыл бұрын
Hey Yon, good question, you can definitely expose an API as a standard workspace and share it as a dependency.
@rishabhsharma_4769
@rishabhsharma_4769 Ай бұрын
can you please create the dockerfile
@fakhrulislamfuad8072
@fakhrulislamfuad8072 Жыл бұрын
can you do something for app directory as well?!
@hamedbahram
@hamedbahram Жыл бұрын
Maybe! I'll have that in mind.
@MehrdadPanahandeh
@MehrdadPanahandeh Жыл бұрын
Great stuff!
@hamedbahram
@hamedbahram Жыл бұрын
Appreciate that!
@ericdonaldpitcher
@ericdonaldpitcher Жыл бұрын
Great overview! Thanks!
@hamedbahram
@hamedbahram Жыл бұрын
Thanks Eric!
@ghassanclassic7689
@ghassanclassic7689 Жыл бұрын
Thank you very much 🎉
@hamedbahram
@hamedbahram Жыл бұрын
No problem!
@roniaxelrad9493
@roniaxelrad9493 2 жыл бұрын
Such a great video. I never heard about turbo repo before. It's very interesting. Is it correct to say that my main motivation to use it, is if I have a several applications which i want to share a ui app or configuration between them?
@hamedbahram
@hamedbahram 2 жыл бұрын
Exactly 💯
@miladmohammadi3233
@miladmohammadi3233 5 ай бұрын
This tutorial is perfect
@hamedbahram
@hamedbahram 5 ай бұрын
Thanks! Glad you think so.
@giovannitonussi3746
@giovannitonussi3746 Жыл бұрын
Amazing content, thank you!
@hamedbahram
@hamedbahram Жыл бұрын
My pleasure!
@Китаймоимиглазами
@Китаймоимиглазами 10 ай бұрын
thanks
@hamedbahram
@hamedbahram 10 ай бұрын
My pleasure!
@anandhukraju9382
@anandhukraju9382 Жыл бұрын
This was perfect
@hamedbahram
@hamedbahram Жыл бұрын
Thanks, and welcome to the channel Anandhu!
@Cat_loveers101
@Cat_loveers101 Жыл бұрын
add translate to arabic watching you from syria thank you so much
@hamedbahram
@hamedbahram Жыл бұрын
I'll look into that Anas! Welcome to the channel.
@dzungko
@dzungko 11 ай бұрын
appreciate this vid. But just kinda hate it when that there's a warning, and u just pass it. No one like there's always a warning in the code.
@hamedbahram
@hamedbahram 11 ай бұрын
Thanks for your feedback!
@Kamleshsharma35
@Kamleshsharma35 10 ай бұрын
You should speak more about turbo repo features and not about yarn or pnpm command
@hamedbahram
@hamedbahram 10 ай бұрын
Why don't you make a video and talk about whatever you think you should talk about.
@ibraheemassiri
@ibraheemassiri 2 жыл бұрын
interesting.
@hamedbahram
@hamedbahram 2 жыл бұрын
turborepo is cool.
@lotfikamel5947
@lotfikamel5947 Жыл бұрын
nice content ! but stop saying "VEB" please its "WEB"
@hamedbahram
@hamedbahram Жыл бұрын
You're welcome Lotfi! Thanks for your feedback.
What is a monorepo? | Getting started with nx
18:30
Coding Garden
Рет қаралды 15 М.
How to structure a JS/TS monorepo (From Zero to Turbo - Part 1)
11:58
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Why my first webapp only made $29
7:04
Tom Gregory Tech
Рет қаралды 8 М.
Using Prisma with Turborepo
21:17
Hamed Bahram
Рет қаралды 4,7 М.
I built a REAL Desktop App with both Tauri and Electron
12:22
Bufferhead
Рет қаралды 93 М.
Teaching Neovim From Scratch To A Noob
1:12:55
TheVimeagen
Рет қаралды 246 М.
Why's nobody using Astro?
9:26
Maximilian Schwarzmüller
Рет қаралды 32 М.
I used a Monorepo for 12 months - here’s my opinion
9:50
Software Developer Diaries
Рет қаралды 32 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.