Build Modern Next 14 Server Side App with Server Actions, Infinite Scroll & Framer Motion Animations

Поділитися
Вставка
  • Опубліковано 21 тра 2024
  • Are you curious about Server Actions in Next.js 14? What about infinite scrolling and Framer Motion animations with Next 14? This video will demystify these concepts while building a server-side Next 14 App
    🌟 Become a top 1% Next.js 14 developer in only one course: jsmastery.pro/next14
    📚 Materials/References:
    GitHub Code (give it a star ⭐): github.com/adrianhajdin/anime...
    Anime API: shikimori.one/api/doc/1.0/ani...
    💻 Join our Discord Community - / discord
    🐦 Follow us on Twitter: / jsmasterypro
    🖼️ Follow us on Instagram: / javascriptmastery
    💼 Business Inquiries: contact@jsmastery.pro
    Time Stamps 👇
    00:00:00 - Server Actions Crash Course
    00:09:32 - Implement Server Actions
    00:20:40 - Infinite Scroll in Next 14
    00:29:10 - Framer Motion with Next 14
    00:38:10 - Summary & Recap

КОМЕНТАРІ • 308

  • @javascriptmastery
    @javascriptmastery  5 місяців тому +4

    🌟 Become a top 1% Next.js 14 developer in only one course: jsmastery.pro/next14

  • @aayushjajoo332
    @aayushjajoo332 5 місяців тому +13

    This is the kind of video that sorts all of the issues and explains properly. Awesome Project!

  • @rohankaushik7849
    @rohankaushik7849 5 місяців тому +50

    00:03 Server actions are functions that run on the server and can be called like any other JavaScript functions.
    02:44 Server actions in Next.js abstract the process of making API calls from client to server.
    07:43 Server actions allow you to do mutations and perform create, update, and delete actions on top of the typical read operations.
    10:07 Learn about infinite scrolling and server actions
    15:05 Fetch data from the Shikimori API
    17:28 Creating a parameter template string with page, limit, and order
    21:54 Install and use react-intersection-observer package for tracking element visibility
    24:09 Implementing server actions and infinite scroll for loading more data
    28:30 Implement animations using framer motion in a Next.js app
    30:45 Create a motion div component for client-side rendering using Framer Motion.
    35:11 Optimize loading time of items when scrolling far down
    37:15 Using server actions to fetch and return data for animations
    41:36 Learn how to use Next.js like a pro with server actions and deep dive lectures

  • @Tapadar.Monsur
    @Tapadar.Monsur 5 місяців тому +18

    I'm thoroughly enjoying these concise crash courses that delve into specific topics. Thank you for creating these informative videos. I look forward to more content in the future, and I would particularly appreciate a short tutorial on React Query. Keep up the great work!

  • @GreenPear-mz4dl
    @GreenPear-mz4dl 5 місяців тому +7

    Hi Adrian, know you is a blessing, I am really grateful that you make the NEXTJS14 course on sale again so I could be able to buy it yesterday. I love all of your Video contents, they are free but beyond quality. Thank you again. 💯💯💯

  • @taveirasemlimites4496
    @taveirasemlimites4496 5 місяців тому +11

    Awesome Project Adrian! I'm 20, Brazilian and starting my career with nextjs on this month, I don't have money for the entire curse yet but I really love to make all this projects with you, I wish I will start my own projects soon, thank you for all! God bless you!

  • @Stefoux
    @Stefoux 5 місяців тому +3

    Excellent little project with explanation of concepts! I would like to have more content like this to improve frontend concepts ! Thank you Adrian & JSM

  • @seventyMinus1
    @seventyMinus1 5 місяців тому +3

    The way you explained things is Just Amazing. This video is really a piece of work

  • @jooncco
    @jooncco 5 місяців тому

    The concept of Server Action became clear thanks to this video. Thanks Adrian 👏🏼👏🏼

  • @2pacrapempire866
    @2pacrapempire866 4 місяці тому

    Thank you so much, need more of this. You explain the concepts in an easy way. Thanks

  • @syndg
    @syndg 5 місяців тому +1

    Amazingggg! Was literally waiting for you to upload a video where you use framer motion!

  • @MohammedMaaz-un2gp
    @MohammedMaaz-un2gp 5 місяців тому +2

    Finally I have something to do for the next two weeks! Thanks JSM.

  • @sandrogtz
    @sandrogtz 5 місяців тому

    perfect video length packed with valuable knowledge thanks

  • @sobanmustafa4457
    @sobanmustafa4457 5 місяців тому +3

    Awesome video. Yes Please make more content of this type which focuses on a single specific feature. it helps to get more in-depth knowledge of that topic. Thank you so much

  • @vaniad555
    @vaniad555 4 місяці тому

    What a great short project, it works like magik. Hope to see much more.

  • @aleksandrgolyk3787
    @aleksandrgolyk3787 5 місяців тому +2

    this is great, simply and very useful class. Very required format nowadays) Show must go on!!! Thank you so much!!

  • @online_sourcecode1613
    @online_sourcecode1613 5 місяців тому +2

    really helpful, i was struggling with infinite scroll functionality

  • @nabeelmirza8801
    @nabeelmirza8801 5 місяців тому +2

    Wow, I'm so impressed of your websites!

  • @eliasoliveira292
    @eliasoliveira292 2 місяці тому +1

    I was skeptical about the components being on server side after aplying the but they are really in server side, thank you for this tutorial.

    • @Hirijinitus
      @Hirijinitus 24 дні тому +1

      Me too. I thought use client would be inherited by the children.

  • @tryingtobeproductive
    @tryingtobeproductive 5 місяців тому +2

    nobody makes me feel motivated to code than this guy on the leadup to the coding, well done

  • @irfansaeedkhan7242
    @irfansaeedkhan7242 5 місяців тому

    very helpful , thank you for in detail knowledge

  • @codecure4009
    @codecure4009 4 місяці тому

    Love your way of Explaining

  • @apo__tato__sal__ad
    @apo__tato__sal__ad 2 місяці тому

    This was amazing!!

  • @edihasrin7290
    @edihasrin7290 5 місяців тому +3

    prefer like this, under 1 hours, easy to understand, love it ❤❤❤❤

  • @alexanderchepkiyeng4853
    @alexanderchepkiyeng4853 5 місяців тому +22

    2 years later, I am still Here loving the content 🎉❤

    • @javascriptmastery
      @javascriptmastery  5 місяців тому +1

      Thank you so much! ❤️

    • @serxeoworld5773
      @serxeoworld5773 5 місяців тому

      Did you get hired?

    • @alexanderchepkiyeng4853
      @alexanderchepkiyeng4853 5 місяців тому

      @@serxeoworld5773 Not yet. Been working on getting the capital I Join the Masterclass, passed the interview with flying colours. JSM, Adrian articulates core concepts in a simple clear manner. Provided you have the innate will to learn consistently through practice. Understand, Rinse then Repeat 🔁

    • @franukito
      @franukito 5 місяців тому +1

      sir do you live in year 2025?
      salutations from year 2023

    • @AkashhGuptaa
      @AkashhGuptaa 5 місяців тому

      ​@@franukitohe means he's a old sub and still watches the content frankfurt dickson

  • @pep3marquez46
    @pep3marquez46 5 місяців тому +1

    I love it. Thanks, a lot!

  • @ProjectsMastery82
    @ProjectsMastery82 5 місяців тому +1

    Great video 🎉

  • @mahmudulislamrudra5659
    @mahmudulislamrudra5659 5 місяців тому +2

    Thanks man. Thanks a lot. This type of video is very helpful to explain concepts and facts. So, if its possible, then keep making this type of videos and contents...

  • @zhiven7484
    @zhiven7484 5 місяців тому +1

    Very good video!! Looking for more!

  • @mohammadharish8740
    @mohammadharish8740 5 місяців тому +1

    Love you adrian for putting my suggestion to the video itself 😭😭😭😭❣️

  • @asrafulislam8948
    @asrafulislam8948 5 місяців тому +1

    Great video as always.

  • @himel_islam
    @himel_islam 5 місяців тому +1

    really helpful!! please do make this types of videos

  • @mamitianasolofo723
    @mamitianasolofo723 5 місяців тому +1

    Your videos are amazing

  • @MuhammadHussain-codr
    @MuhammadHussain-codr 5 місяців тому +1

    Great! Please more of this type of videos. Thank You

  • @zyncc
    @zyncc 5 місяців тому +1

    Its an amazing day when JSM uploads a video 😉

  • @patryk_rogala
    @patryk_rogala 5 місяців тому +1

    Thank you for another tutorial!

  • @duduzincp
    @duduzincp 5 місяців тому +1

    Nice bro, Brazil thanks you

  • @alexkarpen
    @alexkarpen 5 місяців тому +1

    For animation delay use the current page too, it will get smoother. Because the last from the first page is visible after the first of the second. Anyway awesome content thank you once more!

  • @DigitalCreator5
    @DigitalCreator5 5 місяців тому +1

    Thanks a lot 🎉 Adrian

  • @manomangaldas
    @manomangaldas 5 місяців тому +1

    Crash courses are awesome.. please do more of these concept based videos

  • @syncosota
    @syncosota 4 місяці тому

    thank you master ❤

  • @b166er4
    @b166er4 5 місяців тому

    thx for this great tuto,
    i think,
    delay: (index % 8) * 0.1
    can be a good way to handle the stagger(based on limit=8)

  • @razeft
    @razeft 5 місяців тому +1

    Really good project for explain the concept! I suggest everyone to use something to take note when watch this kind of video, it's nice to do the project, but it's really important to take note when he explain the concept.

  • @marvikfr
    @marvikfr 5 місяців тому

    Delicious ^^
    Merci !

  • @user-zj5sd5mc7z
    @user-zj5sd5mc7z 4 місяці тому

    thank you so muxh ❤

  • @waggadash
    @waggadash 5 місяців тому

    Well done!

  • @albarsalan4173
    @albarsalan4173 4 місяці тому

    Thank you!

  • @frontend_ko
    @frontend_ko 2 місяці тому

    thanks for nice video!

  • @Omarwaqar-pt7wf
    @Omarwaqar-pt7wf 5 місяців тому +1

    Yes , pls do more of these videos

  • @OPGAMER.
    @OPGAMER. 5 місяців тому +2

    As a anime lover, really excited to built this project.

  • @deviskalo
    @deviskalo 5 місяців тому +1

    Wow, amazing! Thanks for this @adrian

  • @sportsmanship2024
    @sportsmanship2024 5 місяців тому +1

    Wow! This is a great content. I wish to join the ultimate class. Thank you for the insight Mr.Andrian. We will like to get more insights and contents from you

  • @aroundtheworld560
    @aroundtheworld560 5 місяців тому +1

    Boss! Love You.❤

  • @wilsonmela6343
    @wilsonmela6343 5 місяців тому +1

    Thank you so much.

  • @Kokouvi_el_mejor
    @Kokouvi_el_mejor 5 місяців тому +1

    Thanks ADRIAN

  • @suryakantasinha
    @suryakantasinha 5 місяців тому +1

    Finally😆small project but great🤩

  • @Nanashi-rq7lk
    @Nanashi-rq7lk 4 місяці тому

    Perfect Tutorial

  • @dev-akeel
    @dev-akeel 5 місяців тому +3

    33:43 Yes but some of the components are rendered client side even without directive.
    So see that it is client side rendered move to the sources tab and see that browser has that AnimeCard component.
    Thanks a lot sir, still great efforts 👌

    • @dev-akeel
      @dev-akeel 5 місяців тому

      Sir can you please mark the AnimeCard component with "use server" directive and reply here with what you have, everything working fine or error..?

    • @javascriptmastery
      @javascriptmastery  5 місяців тому +1

      That's a great observation

  • @vOnez212
    @vOnez212 5 місяців тому +1

    Good stuff. Much appreciated! Anything on Payload CMS planned?

  • @DigitalCreator5
    @DigitalCreator5 5 місяців тому +2

    Thanks 🎉

  • @sarhan_104
    @sarhan_104 5 місяців тому

    yes i want that simple apps with more focused on learning

  • @magnusbrzenk447
    @magnusbrzenk447 3 місяці тому +1

    “nextJs becoming php” is the perfect summary of my concerns with all the new jazz

    • @academai11
      @academai11 3 місяці тому

      'use php';
      coming soon...

  • @mahtabvariyani
    @mahtabvariyani 5 місяців тому +1

    perfect as always....

  • @SamarHayatOfficial
    @SamarHayatOfficial 5 місяців тому +1

    I'm just waiting for your tutorial 😊

  • @Deus-lo-Vuilt
    @Deus-lo-Vuilt 5 місяців тому +2

    Wow
    Next 14 with framer motion ❤

  • @alrazy12
    @alrazy12 5 місяців тому +1

    yes do more tutorials like this one

  • @BillaSaheb786
    @BillaSaheb786 5 місяців тому +1

    great excellent plz make more project on server action

  • @aadarshgurug
    @aadarshgurug 5 місяців тому +1

    it's amazing, need more videos like this ?

  • @lukaszsl
    @lukaszsl 5 місяців тому

    Hi Thanks for the video !
    Info for motion:
    To have a server component inside the client component you need to use children props. Something like that:
    "use client";
    import React from "react";
    import { motion } from "framer-motion";
    type Props = {
    children: React.ReactNode;
    className?: string;
    };
    const variants = {
    hidden: { opacity: 0, y: -50 },
    visible: {
    opacity: 1,
    y: 0
    },
    };
    export const MotionDiv = ({ children, className }: Props) => {
    return (

    {children}

    );
    };
    export default MotionDiv;
    //export const MotionDiv = motion.div;

  • @salihbozkaya8465
    @salihbozkaya8465 5 місяців тому +1

    Next.js is just awesome❤

  • @Omi-rn4cg
    @Omi-rn4cg 5 місяців тому +2

    G.O.A.T , one love from Nigeria.

  • @abhinavchauhan6665
    @abhinavchauhan6665 5 місяців тому +1

    Big fan sir ❤

  • @ahmed01053
    @ahmed01053 5 місяців тому +3

    Your content is very nice , interesting And I love it very much❤️❤️
    I would like it if you could create courses in Angular or projects using it🙏❤️

  • @sanketchauhan901
    @sanketchauhan901 4 дні тому

    Bro casually showed us how to render server side components inside a client side component!

  • @pranavanilkumar1246
    @pranavanilkumar1246 5 місяців тому +1

    Top Class

  • @user-he5uv6ij7e
    @user-he5uv6ij7e 5 місяців тому

    Many thanks for your tutorials 👍
    Is it correct to say that:
    - the fetch on the home page server-component is done at built-time ?
    - and then all subsequent fetch from LoadMore client-side component are made at run-time, but not from the client as would do a "traditional" fetch in a React component, but rather on the server, thanks to the "use server" directive in the fetchAnime ("action") file ?

    • @FrancescoArosio
      @FrancescoArosio 5 місяців тому

      As a newbie, I got to the same your conclusions.
      If I npm run build it, the first results from homepage are statically hardened into html static files. Maybe removing it from homepage should "abuse" immediately of the LoadMore 'trigger' to dynamically ask server to fetch new data as page 1 too (also changing the prop page to init val 1 in LoadMore).
      As per subsequent calls by LoadMore, yes - the fetch is run by the server, but the client is still POST-ing a request to the server, instead of fetching data directly from API server. This is useful if you have "private" keys to query target APIs or some internal backend/datasource you don't want to make publicly accessible, or you don't want to write different APIs from scratch.

  • @MiladJoodi
    @MiladJoodi 3 місяці тому

    perfect

  • @okbizenasni3881
    @okbizenasni3881 5 місяців тому

    Howdy,
    What tools do you use to create your animated presentations?

  • @wildanmaulana1882
    @wildanmaulana1882 5 місяців тому +7

    here is the simple code for framer motion,
    just add this in your map
    const adjustedIndex = index % 20;
    - the number 20 is limit data perpage
    so you dont need to move the map into actions file
    for example, in loadmore component
    data.map((series: SeriesCard, index) => {
    const adjustedIndex = index % 20;
    return (



    );
    })
    sorry my english is bad

  • @souravmajumder4630
    @souravmajumder4630 5 місяців тому

    One point. If you setData and use data as useEffecct dependency, then it will call infinite time, 'cause each time it is setting setData and each time it will call. Please tell me if I'm wrong.

  • @lCebolitosl
    @lCebolitosl 5 місяців тому +1

    I want the JSM course so bad but I'm broke and unemployed right now. Finished Odin Project and some JSM projects and trying to land a first job so I can invest into this course!

  • @R0VERKAI
    @R0VERKAI 5 місяців тому

    Thank you so much for your amazing tutorials. May I have a request?! I want to code an admin interface for my Next.js app with Tailwind css and Typescript. However I don't know how to do it. I know you are busy, but can you consider making a tutorial for it in the future? Thank you in advance❤

  • @Zkyyarpan
    @Zkyyarpan 5 місяців тому +3

    Great video! I really enjoyed the content. Your VS Code setup looks fantastic! Could you please share the font and theme you're using? I'm looking to improve my coding environment, and your setup caught my eye. Thanks in advance, and keep up the excellent work !

  • @anujkashyap999
    @anujkashyap999 5 місяців тому +2

    My mentor, ❤ hey there!

  • @valentinkrajzelman4649
    @valentinkrajzelman4649 5 місяців тому +2

    omg next 14 already jesus

  • @sanjay261982
    @sanjay261982 5 місяців тому +1

    You started with server action but showed react server component (RSC) functionality. Data fetch on server side is based on RSC. Server Actions is completely different and is used for data mutations on server. Try to show a client side component with use client directive directly mutating the DB using a inline function that has a use server directive inside that functions boundary. That will be a good example of react server action.

    • @sujatagunale7079
      @sujatagunale7079 5 місяців тому

      Project shows both the ways of using server action from the client (check LoadMore component) and server components. And in the beginning, it does talk about mutations and stuff through code snippets 👍

    • @javascriptmastery
      @javascriptmastery  5 місяців тому

      Yes! 😊

    • @dev-akeel
      @dev-akeel 5 місяців тому

      @@sujatagunale7079 really🤔
      I think you couldn't understand that comment.
      The data is normally fetched from the server it is not server action.
      *But still a great video.* 💖💖

    • @sanjay261982
      @sanjay261982 5 місяців тому +1

      ​@@dev-akeelthankyou

  • @BappyTechTips
    @BappyTechTips 3 місяці тому

    Instead of returning the AnimeCard from the server action, a better approach would be to adjust the delay. We can simply do it using the remainder operator like this. delay: (index % 8 ) * 0.25,

  • @bekizodcancer3657
    @bekizodcancer3657 5 місяців тому +1

    You are out of human species...Thanks man

  • @NhanNguyen-yu3gs
    @NhanNguyen-yu3gs 5 місяців тому

    to be honest, i would like you release another video like that to explain more power Next.js features rather than the series which fully practices nextjs project. But btw, i always grant what you did.

  • @coderpython4322
    @coderpython4322 3 місяці тому

    Which extension did you use for code suggest

  • @user-lq2ip9si7y
    @user-lq2ip9si7y 5 місяців тому

    Sir, can you please make a course on how to use preact signals with next js?

  • @raijinhasarrived
    @raijinhasarrived 4 місяці тому

    yo, what vscode extension u r using for icons?

  • @elhaambasheerch7058
    @elhaambasheerch7058 5 місяців тому +1

    These kind of videos are generally more useful

  • @HavoJavo
    @HavoJavo 5 місяців тому

    Awesome course as always, thanks. Any chance the blockchain/nft course can be updated ? It is a really good time to learn blockchain programming and its a shame ur course is outdated.

    • @javascriptmastery
      @javascriptmastery  5 місяців тому

      Unfortunately, no.

    • @dev-akeel
      @dev-akeel 5 місяців тому

      Sir is always up to date he knows which course is best 💖
      He does research before creating content. And you say what you like.

  • @yugal8627
    @yugal8627 5 місяців тому +1

    Amazing conten as always..🙂.
    Can someone tell me which file icons and themes Adrian is using.

  • @gyanganga8441
    @gyanganga8441 5 місяців тому

    I'm following this channel for a year but never completed any single project as mostly get stuck.
    but this project completing after Next js also did in react js .

  • @walinkeio
    @walinkeio 2 місяці тому

    How do you make so smooth animations ? :D

  • @peterspianojourney
    @peterspianojourney 4 місяці тому

    what plugin are u using for the autofill?

  • @abdullahisalihu8107
    @abdullahisalihu8107 5 місяців тому

    Slick
    I’m curious, what do you use for your scrolling?

    • @dev-akeel
      @dev-akeel 5 місяців тому +1

      It is vanilla Js feature called intersection observer.

    • @abdullahisalihu8107
      @abdullahisalihu8107 5 місяців тому +1

      @@dev-akeel I meant, when he scrolls down, his cursor changes

    • @dev-akeel
      @dev-akeel 5 місяців тому

      @@abdullahisalihu8107 that's so easy
      Click mouse wheal and drag down. The more you drag the more is the scroll speed.
      It will work on any website.

    • @javascriptmastery
      @javascriptmastery  5 місяців тому

      Yes, he's right!

  • @bullyversal5313
    @bullyversal5313 5 місяців тому +1

    Can you make a 100% full stack app with everything integrated for a functional web app.. like an e-commerce app or something