Create a Bun REST API With Elysia & Prisma

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 52

  • @gosnooky
    @gosnooky 10 หลายเดือนก่อน +11

    Suggestion for anyone creating a database, always, ALWAYS keep your timestamp fields at the start of the table's column definitions, after the ID field, e.g. id, created_at, updated_at, (deleted_at if using soft deletes). The reason for this is the data is cleaner, because if you ever add additional columns to the table, these meta fields will appear in the middle of your table, and looks quite messy whenever doing select *. ORM's can mitigate this, but it's good practice, especially when using Postgres as it does not support moving columns or specifying 'after' when creating. I guess I'm just a bit OCD, but that's a good thing in our line of work.

    • @arshiagholami7611
      @arshiagholami7611 10 หลายเดือนก่อน

      thanks, as someone who has OCD this helped me to pay attention to unnecessary details and feed my OCD and get worst overtime.

    • @RaefetOuafiqo
      @RaefetOuafiqo 10 หลายเดือนก่อน

      @@arshiagholami7611happy for you dear js developer

    • @mieszkogulinski168
      @mieszkogulinski168 10 หลายเดือนก่อน

      Good idea

    • @komarhidayat4026
      @komarhidayat4026 9 หลายเดือนก่อน

      thanks man

    • @Spyhunter107
      @Spyhunter107 4 หลายเดือนก่อน

      You can always back up the table and reinsert with the new column without having to paste timestamps in the beginning.

  • @wizulus
    @wizulus ปีที่แล้ว

    Great work @code_brew! This is what I was hoping to see from your first video :). I tried Bun very early after its release, but the ecosystem was a mess, and the lack of http routing was painful. This video gives me hope! I'm definitely gonna use this method on my next project. I especially appreciate the strong typing demonstration. Keep it up!

  • @simonemaddiona
    @simonemaddiona 3 หลายเดือนก่อน

    Bro reading my mind,
    I had questions in my head and every time one popped, this absolute chad replied a second later
    I love you

  • @MuhammadM1998
    @MuhammadM1998 ปีที่แล้ว +2

    I'm a Frontend dev but I've enjoyed this great video thanks a lot and keep up the good work 🙏. Subscribed!

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      Thanks, welcome! 🙌 I do have some frontend content on the way so stay tuned for that 😉 anything in particular youd like to see covered?

    • @MuhammadM1998
      @MuhammadM1998 ปีที่แล้ว

      @@cdbrw Great news! I'd be interested in general concepts like project structure and things like advices on where to structure business logic, data fetching, validations and error handling

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      Noted ;) I am planning on making videos on React, Remix, HTMX and other frontend technologies. Will keep those ideas in mind when I plan those videos out 🙏

  • @whatis_me
    @whatis_me 9 หลายเดือนก่อน +2

    Great tutorial with Bun with Elysia & Prisma. Props to @code_brew

  • @orbitaldesigner
    @orbitaldesigner ปีที่แล้ว +1

    its was my first touch on bun. thank you for nice tuto!

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      glad you found it useful! 😄

  • @sujjee
    @sujjee ปีที่แล้ว +1

    Hey CodeBrew, great video, man! You explained it in a very simple and easily understandable way. Why don't you create a full-stack, production-ready project using Bun and Elysia for the backend, and Next.js for the frontend? Also, could you please share the best production-ready practices we should follow for an API?

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      Oh these are some great ideas, thanks! 🙏 I do plan on releasing a video on how to deploy this soon but I'll see how I can include those points aswell

  • @jitxhere
    @jitxhere ปีที่แล้ว

    Very good video. Looking forward towards deployment process.
    Subscribe and hope this video reach many more people.

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      Thanks so much and welcome welcome 🙌

    • @cdbrw
      @cdbrw  10 หลายเดือนก่อน

      check out the video I just uploaded for the deploy process 👀
      th-cam.com/video/fZyAx97hzfw/w-d-xo.html

  • @aatifshaikh2088
    @aatifshaikh2088 6 หลายเดือนก่อน

    nicely put! curious, Which IDE you are using?

    • @cdbrw
      @cdbrw  6 หลายเดือนก่อน

      was using webstorm in this video 🫡

  • @_codesan
    @_codesan 10 หลายเดือนก่อน

    thanks for sharing, i was read and watch ur tutorial. and i try to connect with my nextjs project, its work but i dont know how to implement Eden as end to end type safe. can u make some artcile about it?

    • @cdbrw
      @cdbrw  10 หลายเดือนก่อน

      Ooou that’s a good idea 👀 I’ll take a look into it and see when I have some time to. Thanks for the support btw!

  • @megamind452
    @megamind452 ปีที่แล้ว +1

    Subscribed ✨

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      welcome welcome! 🙌

    • @megamind452
      @megamind452 ปีที่แล้ว

      @@cdbrw can you please create a video on your docker, and your docker setup. That would be so helpful.

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      for sure, was actually planning on making a video on my switch from docker desktop to orbstack and the benefits I’ve gotten out of it. I’ve already written an article on this on Medium if you’re interested in reading a bit about it before I get to the video

  • @viniciusataidedealbuquerqu2837
    @viniciusataidedealbuquerqu2837 9 หลายเดือนก่อน

    is there a way to create a middleware that translates prisma errors to json payloads?

    • @cdbrw
      @cdbrw  9 หลายเดือนก่อน

      Whats the usecase here? To catch the error and return it as a json response? How would you handle that? Would you still return an appropriate http code?

  • @mieszkogulinski168
    @mieszkogulinski168 10 หลายเดือนก่อน

    Cool tutorial, except one thing: Prisma has huge overhead and very high latency of queries, that's why I use Drizzle instead

    • @cdbrw
      @cdbrw  10 หลายเดือนก่อน

      I have a separate video where I check out Drizzle and setting it up 😉
      th-cam.com/video/Eljdg5_EgOI/w-d-xo.html

  • @ink16it03
    @ink16it03 ปีที่แล้ว

    Would you like to share your extension to make UI looks like that?

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      Which UI? My code editor?

    • @ink16it03
      @ink16it03 ปีที่แล้ว

      @@cdbrw yes yes

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      it’s called webstorm

    • @codedusting
      @codedusting ปีที่แล้ว

      What webstorm theme?

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      Neo Night

  • @YouhanaSheriff
    @YouhanaSheriff ปีที่แล้ว

    what is the ide u r using?

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      webstorm

  • @technoM4niac
    @technoM4niac ปีที่แล้ว

    Subscribed!!!

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      welcome!! 😄

  • @mohammedzeeshan8647
    @mohammedzeeshan8647 ปีที่แล้ว

    how/where do you deploy bun?

    • @cdbrw
      @cdbrw  ปีที่แล้ว +1

      hey, I will be releasing a video on this so keep an eye out for it in the coming weeks 👀

    • @mieszkogulinski168
      @mieszkogulinski168 10 หลายเดือนก่อน

      Anything that can run Docker containers can run Bun

    • @cdbrw
      @cdbrw  10 หลายเดือนก่อน

      check out the video I just uploaded for the deploy process 👀
      th-cam.com/video/fZyAx97hzfw/w-d-xo.html

  • @westernHypocricy
    @westernHypocricy ปีที่แล้ว

    another framework? Why????????????????????????????????????????????????????????????????????????????????????????????????????????????

    • @cdbrw
      @cdbrw  ปีที่แล้ว

      Bun's biggest promise is being significantly faster than the other runtimes when it comes to certain tasks. Elysia pairs really well with it as it's designed specifically for Bun

  • @viniciusataidedealbuquerqu2837
    @viniciusataidedealbuquerqu2837 9 หลายเดือนก่อน

    I got baffled that after googling it upsertMany is still a WIP in prisma jezz

    • @viniciusataidedealbuquerqu2837
      @viniciusataidedealbuquerqu2837 9 หลายเดือนก่อน

      a better way to parallelize would be Promise.allSettled at least but it's just a script lol