Next.js Server Actions || Learn Patterns & Project Building

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

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

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

    Thankfully I found this channel at early stage of learning next js otherwise it's even horrible to think that I am developing complex application using next js without fundamental understanding. This is BENCHMARK among next js tutorials. Thank you very much sir for valuable content and to contributing your time on us😊

    • @tapasadhikary
      @tapasadhikary  2 หลายเดือนก่อน

      My absolute pleasure… keep growing ❤️

  • @soumyajeetdas5339
    @soumyajeetdas5339 2 หลายเดือนก่อน +1

    You are just doing an awesome work. You literally spoke about some extremely imp things, that's very imp to note

    • @tapasadhikary
      @tapasadhikary  2 หลายเดือนก่อน

      @@soumyajeetdas5339 Thanks a lot ❤️

  • @Aleks-fp1kq
    @Aleks-fp1kq 5 หลายเดือนก่อน +1

    Thank you. Got a bit of mixed feelings as server actions seems to be mixing concerns. They were imagined to replace API endpoints - data mutation, but now we also do revalidation and this adds a layer of magic because what actually a call to server action returns is not just what we explicitly return from it.

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      I second that opinion 👍

  • @digitalsahara6670
    @digitalsahara6670 11 วันที่ผ่านมา

    wow this is amazing just found your channel and subscribed immediately, are you considering doing a course deep dives, these are amazing!

    • @tapasadhikary
      @tapasadhikary  11 วันที่ผ่านมา

      @@digitalsahara6670 super. 👍. This series is in-drpth. Give it a try. Thank you very much.

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

    Thank you very much sir you are very good teacher

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

      🙏🙏🙏❤️

  • @i_m_phoenix87
    @i_m_phoenix87 5 หลายเดือนก่อน

    Nice Explanation Sir . I also feel , it is more of an intuitive approach than a practical one to add server actions in Next JS but once you get used to it , it makes it way easier to handle api calls and manage the integration stuffs. Loved this video and I must say , i am enjoying this journey of Next JS with you. Thanks and Keep going Sir.

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      Thanks for adding to it. Yep, I'm also enjoying making it a lot 😀

  • @angelaparga8398
    @angelaparga8398 4 หลายเดือนก่อน +1

    Thanks again Tapas for this information. I have a question, if I want to use a dedicated express server for my backend and I use 'server actions' to make the API calls to maintain these calls on the server, is it really consuming? Am I wrong doing this?

    • @tapasadhikary
      @tapasadhikary  4 หลายเดือนก่อน +1

      Thank you!
      If you have a dedicated server self-managed, it's not an issue. The problem comes when we have a cloud hosted server that charges on execution based on bandwith and time.

  • @mdsumonh.shohan9159
    @mdsumonh.shohan9159 2 หลายเดือนก่อน

    Great great I love it i wached it very carefully and very being fosued. thank you vai I learnt so much

    • @tapasadhikary
      @tapasadhikary  2 หลายเดือนก่อน

      @@mdsumonh.shohan9159 Thank you very much ❤️

  • @wasiuddinmansoori3385
    @wasiuddinmansoori3385 5 หลายเดือนก่อน

    Great Informative Video Brother. One Doubt is why we not used timestamps and used createdAt instead in the video ?

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน +1

      Thanks brother ❤️, yes! We can do timestamp: true as well to add createdAt, modifiedAt. Please feel free to use that too 👍

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

      @@tapasadhikary Thankyou So Much

  • @lonewolfdays
    @lonewolfdays 4 หลายเดือนก่อน +1

    Thanks for this amazing explanation. I have a confusion. When to use fetch/axios and when to use actions? Or they can be used together? For example, if i consider jsonplaceholders APIs as API points which approch should be followed in the nextjs api for data fetching? I'm some what confused between these. You can correct me if my question is wrong. Thank you.

    • @tapasadhikary
      @tapasadhikary  4 หลายเดือนก่อน +1

      @@lonewolfdays when you have an external API to call, you will not use server actions. That time you will have two approaches:
      1. From the Server component you can fetch the data directly from API using the fetch() and use.
      3. If from the client component then you can use the useEffect() hook to handle API calls and responses.
      On the contrary, server actions are simple functions that are asynchronously executed on the server and you can call them with the 5 patterns I mentioned in the video.
      I hope the diff is clear to you now.

  • @MdMuzahid-p9t
    @MdMuzahid-p9t 5 หลายเดือนก่อน +1

    Informative video, Thanks for sharing with us.❤

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      You are most welcome ❤️

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

    Super Helpful video Dada, Thanks ❤

    • @tapasadhikary
      @tapasadhikary  3 หลายเดือนก่อน +1

      Thanks vai.. somehow your message was blocked by YT, donno the reason.

  • @tharunkumarreddy1224
    @tharunkumarreddy1224 4 หลายเดือนก่อน +1

    Thank you so much sir😊

  • @JJMV-sl1ib
    @JJMV-sl1ib 5 หลายเดือนก่อน

    Great video as always, very informative and motivational!

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      Thanks a lot… hard work pays off when you love it ❤️❤️

  • @suvasispatra6389
    @suvasispatra6389 5 หลายเดือนก่อน +2

    loving your contents!

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      Thanks a lot ❤️

  • @aminulislamshykat
    @aminulislamshykat 5 หลายเดือนก่อน

    Very helpful tutorial sir.

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      Thank you ❤️❤️

  • @abdullahalmuzahid2473
    @abdullahalmuzahid2473 5 หลายเดือนก่อน +1

    Informative tutorial.. ❤❤❤

  • @PhillipJacowski-er1ch
    @PhillipJacowski-er1ch 3 หลายเดือนก่อน +1

    When you use a server action will the call towards the node server be shown in the web inspector's network tab? I swear I am doing everything correctly but I get that the JSON isn't serializable - I've even reduced it down to just a string I'm passing. Also, how come you aren't using the .bind() approach mentioned in the next.js docs? It's like you are skipping some of their patterns

    • @tapasadhikary
      @tapasadhikary  3 หลายเดือนก่อน +1

      Hey Man, I hope your problem is solved by now. No we can not trace them like regular http/network calls in DevTools. One way to inspect them is if you have a middleware there you can check out the values being passed. If it is just string, I do not see a problem at all... as a double check, please re-look how are you extracting the form data or adding anything additional to the server action apart from the form data.
      About the .bind(), it is not necessarily a server action thing, that's plain old JavaScript. However, I agree with you that it will be good to capture it, I shall make a smaller video on it soon. Thanks!

    • @PhillipJacowski-er1ch
      @PhillipJacowski-er1ch 2 หลายเดือนก่อน +1

      @@tapasadhikary Thanks for reaching out, it was actually that I had the content-type of the request on the wrong level either in or outside the headers.... i was going crazy haha thanks!

  • @steffenjusmann6276
    @steffenjusmann6276 5 หลายเดือนก่อน +1

    Great video once again!

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน

      Thanks a lot ❤️

  • @harshkhasgiwale2709
    @harshkhasgiwale2709 5 หลายเดือนก่อน +1

    Thank You Sir

  • @Pushkarcdn
    @Pushkarcdn 4 หลายเดือนก่อน +1

    sir, I'm facing an issue related to api in next js.
    I have made api under src/app/api... that api is getting data from mongo db atlas... and fetching that api on /home route.
    Running locally is everything good.
    But when deployed to vercel or heroku, and then I fetch that api, it always gives the old data that was in the db while the time of deployment...
    Even if the data is updated on the db, still it gives the old data.
    How should I fix it?
    Or these platform does not support giving dynamic data.?

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

      @@Pushkarcdn fetch is memoized in production. Make sure to use a cache revalidation strategy or cache no store strategy.

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

      @@tapasadhikary I've already used this:
      const response = await fetch('/api/messages',
      {
      method: 'GET',
      headers: {
      'Content-Type': 'application/json',
      'Cache-Control': 'no-store',
      },
      })

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

      @@Pushkarcdn Are you also using unstable_noStore?

    • @Pushkarcdn
      @Pushkarcdn 4 หลายเดือนก่อน +1

      @@tapasadhikary Sir the issue is solved. I just used the req object inside the api route - let a = request.url... However the a variable is not used anywhere.

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

    upto 32:06 and wake me up!

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

      What does it mean? 😃

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

      @@tapasadhikary Hehe I know I will be busy on my college project. So somebody has to inform me to finish this tutorial. That's why

  • @morsheddld
    @morsheddld 4 หลายเดือนก่อน +1

    it's a great content

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

      Thank you ❤️

  • @AvikNayak_
    @AvikNayak_ 4 หลายเดือนก่อน +1

    Has this course ended or ongoing?

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

      I am making an end to end app where a Node.js and Express Service will create the auth token and refresh token.. and at the Next.js end the next-auth will be regulating the tokens and all other API services will go through that. There will be multiple videos for that app.. and some of them will available to view as I progress.. some part may be member-only too as it takes a lot of efforts to cover everything, hope you understand. Rest all are covered here.

  • @rifatrahman1417
    @rifatrahman1417 4 หลายเดือนก่อน +1

    make some video also in Bangla so we can understand better

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

      yep, sure. Please watch out @tapascript-bangla for Bangla videos. Thanks!

  • @whysumancode
    @whysumancode 5 หลายเดือนก่อน

    Tomorrow is my exam why i can't skip this tutorials❤‍🩹

    • @tapasadhikary
      @tapasadhikary  5 หลายเดือนก่อน +1

      Exam first 😊😉

    • @whysumancode
      @whysumancode 4 หลายเดือนก่อน +1

      @@tapasadhikary will be back for sure dai💯!