Using Prisma with Turborepo

Sdílet
Vložit
  • čas přidán 2. 08. 2024
  • In this video, we'll use Prisma to create a database client and share it as a workspace in our Monorepo using Turborepo.
    👉🏼 New courses
    → www.hamedbahram.io/courses
    👉🏼 Project source code (Github)
    → github.com/HamedBahram/next-t...
    👉🏼 Turborepo website
    → turbo.build/repo
    👉🏼 Work with me
    → www.hamedbahram.io/hire
    Chapters
    0:00 Intro
    1:40 Creating a Monorepo
    7:10 Using Prisma
    15:50 Importing DB functions
    20:26 Recap
  • Věda a technologie

Komentáře • 45

  • @imkir4n
    @imkir4n Před měsícem

    Great video Hamed.

  • @haritpatel5001
    @haritpatel5001 Před 2 měsíci +1

    Very detailed and insightful video + the soothing voice of yours . Can you do one on setting up a docker in turborepo as well, that'd be awesome.

  • @raphauy
    @raphauy Před 2 měsíci +1

    Thank you!!!

  • @mohammadabbas1623
    @mohammadabbas1623 Před 2 měsíci +3

    Ur calming voice ❤

  • @jfhandfield
    @jfhandfield Před 2 měsíci +1

    Great video once again Hamed! Thank you for your time. One thing you didn't explain and could be nice to know is what if I have multiple databases to connect to ? What is the correct way to do that ? Right now I have 2 clients in the client.ts named differently is that the way to go?

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +1

      Thank you! That's a good question, I would put them in two different workspace to separate the schemas and db access functions.

  • @patolorde
    @patolorde Před 2 měsíci +1

    Awesome

  • @waltervanwoudenberg6876
    @waltervanwoudenberg6876 Před 2 měsíci +1

    Do a video about a setup with drizzle nextjs shadcn tailwind nestjs hook form and server actions in a turborepo deployed to docker containers

    • @hamedbahram
      @hamedbahram  Před 2 měsíci

      That would be a good one, thanks for the suggestion.

  • @matejbittner-e4t
    @matejbittner-e4t Před 6 dny +1

    Hello, I am a fan of your videos and I would like to ask if you are planning any videos about deploying TurboRepo to Vercel (maybe with a backend CMS and frontend Next app). TurboRepo is quite complicated for me, and I haven't found any videos about deployment and project setup with a CMS. Thanks.

    • @hamedbahram
      @hamedbahram  Před 6 dny

      Great suggestion! Did you mean a custom backend CMS?

    • @matejbittner-e4t
      @matejbittner-e4t Před 5 dny

      I think a custom CMS would be best because if I have a tutorial for it, then there shouldn't be a problem with implementing some third-party options (Keystones, Strapi, ...). However, I'm not sure if this is feasible for you, as most of your videos are shorter than 30 minutes. In that case, I would be more than happy to see at least a third-party implementation and deployment.

  • @shahryartavakkoli
    @shahryartavakkoli Před 2 měsíci +2

    Mr Bahram, did you try to share the Next Auth server side session and all the project can open and read the encrypted session? all projects are in a same site, thank you for all you efforts

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +3

      That's an interesting idea, I'll look into it.

  • @Grishopping
    @Grishopping Před měsícem +1

    Thanks for the video, that's what I was looking for....
    Now I wonder .... when uploading my projects to Vercel how to do it ? using turborepo and the additional projects to place them in subdomain ???? I don't know if you understand my question... do you have any video that talks about this topic?
    Greetings Jose Grillo from Venezuela

    • @hamedbahram
      @hamedbahram  Před měsícem +2

      When you deploy a turbo repo in Vercel it allows you to pick which one of the app/packages you want to deploy. I'll have a video coming up on this.

    • @Grishopping
      @Grishopping Před měsícem

      @@hamedbahram waooo, excellent, thank you very much... I'll be very pending... many blessings and greetings from Venezuela.

  • @samanehghaempanah128
    @samanehghaempanah128 Před 2 měsíci

    appreciate to working so hard for your colleagues by continuously producing content. 💐
    Hamed, I would be grateful if you could make a tutorial about Redux Toolkit. 🙏🏻

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +1

      Anytime! For global state management I recommend Zustand, see this video → czcams.com/video/BxohoXjbhKc/video.html

    • @samanehghaempanah128
      @samanehghaempanah128 Před 2 měsíci

      @hamedbahram
      I want a package for both of state management and fetching
      That's why Redux Toolkit was suggested to me.
      I also heard about Zustand, but I don't know if it has fetching or not!

    • @hamedbahram
      @hamedbahram  Před 2 měsíci

      @@samanehghaempanah128 redux is dead. It's not used anymore. There are better tools that do the same thing in a more efficient way with less boilerplate code. and yes zustand supports async operations such as data fetching.

    • @samanehghaempanah128
      @samanehghaempanah128 Před 2 měsíci

      @@hamedbahram
      Thank you for your explanation
      I will definitely take the time to learn zustand.
      But now I am involved in a project that uses Redux toolkit
      And I can't change the method. :(

  • @Gangbuster74
    @Gangbuster74 Před 2 měsíci +2

    can u create same for shad cn, please

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +1

      Of course, I have that coming up soon.

  • @SyedHaroon786
    @SyedHaroon786 Před 26 dny

    Great Video, would be nice if you could make with nuxt/next + prisma + supabase (local dev) :)

  • @Grishopping
    @Grishopping Před měsícem +1

    NOTE: friend if you could also referncia how to work with GIT from turborepo.... are made all the git from the main root? or each project separately is made to GIT version control?
    or give some tips here I thank you ....
    greetings from Venezuela

    • @hamedbahram
      @hamedbahram  Před měsícem +2

      Yes you can use the git from the root since it's all one repo.

    • @Grishopping
      @Grishopping Před měsícem

      @@hamedbahram Gracias...

  • @yunyang6267
    @yunyang6267 Před 2 měsíci +1

    how do you normally update all packages in the entire turborepo?

    • @hamedbahram
      @hamedbahram  Před 2 měsíci +1

      `pnpm up --latest`

    • @yunyang6267
      @yunyang6267 Před 2 měsíci

      @@hamedbahram Do you navigate to every sub directory to run this command?

  • @ermiasgetnet2283
    @ermiasgetnet2283 Před 2 měsíci +2

    How can I reach You Sir??

    • @hamedbahram
      @hamedbahram  Před 2 měsíci

      Go to the contact section of my site :)

  • @Grishopping
    @Grishopping Před měsícem

    brother I recently found out that a new version of turborepo---- 2.0 has been released.
    what is the possibility that you make a second part of this video of turborepo with prisma but with the new updates....
    Do you see it viable?

    • @hamedbahram
      @hamedbahram  Před měsícem +2

      I can create a video about how to migrate to the new version. You can migrate to the new version by running `npx @turbo/codemod migrate`. It's super straight forward.

    • @Grishopping
      @Grishopping Před měsícem

      @@hamedbahram I did NOT know that command, I will have to grab your repository where you installed prisma and see if it works for me.
      I'll tell you that I used for a new project this command
      npx create-turbo@latest --example with-prisma
      but I have NOT been able to connect with prisma, many errors come out... I don't know what I'm doing wrong after declaring the schema and the .env and the connection to export prisma as you explain in your video.... that's why my request is to see if you dare to make another video with the new version that came out recently.... thank you very much in advance