Fastify Crash Course | Node.js Framework

Поделиться
HTML-код
  • Опубликовано: 25 июл 2024
  • Fastify is a "fast" Node.js framework. In this video, we will build a REST API with validation schemas and swagger documentation
    Code:
    github.com/bradtraversy/fasti...
    Website & Docs:
    www.fastify.io/
    Article: Fastify vs. Express
    / express-vs-fastify-per...
    Latest Udemy Courses:
    traversymedia.com​
    💖 Support The Channel!
    / traversymedia
    Timestamps:
    0:00 - Intro
    2:26 - Install & Setup
    3:42 - Basic Server
    5:30 - Create a Basic Route
    6:33 - VSCode REST Client
    7:50 - Data File
    11:03 - Separate Routes File
    13:30 - Options, Validation Schemas & Handlers
    20:25 - Creating a Controller
    22:37 - Fastify Swagger API Documentation
    24:47 - Add Item POST
    30:22 - Body Validation
    31:59 - Remove Item DELETE
    35:20 - Update Item PUT
  • НаукаНаука

Комментарии • 298

  • @TraversyMedia
    @TraversyMedia  3 года назад +97

    I would love to add on to this. If you followed along, take a look at the list of plugins - www.fastify.io/ecosystem/
    and reply with what you would want to see implemented. Auth, mongo/postgres/redis, cors, etc
    Maybe we could add a frontend as well

    • @gadgetkh9408
      @gadgetkh9408 3 года назад +15

      Please make videos on Auth Passport JWT and some other security related core plugins. Thank you!

    • @rvndnishad
      @rvndnishad 3 года назад +6

      Yes would love to see auth with backend action and frontend as well if it's not much to ask 👍👍👍👍

    • @pmig81
      @pmig81 3 года назад +5

      Well, if i can add one more idea. Adding an authentication layer using Single Sign-On(SSO) using Auth0 :) We could even have some roles

    • @danieljie4721
      @danieljie4721 3 года назад +4

      Would like to see Fastify with mecurius (GraphQL) or Fastify with mecurius & Prisma v2

    • @user-bl4dn8ie6q
      @user-bl4dn8ie6q 3 года назад +3

      Yes, if possible please add authentication with mongodb.

  • @ChadThieleChaddeus
    @ChadThieleChaddeus 2 года назад +25

    Would LOVE to see you take Fastify further - proper, secure auth, JWT, setting up Stripe, accepting payment/subscriptions, sending transactional email, and MongoDB.
    😊

  • @godfreyndiritu9062
    @godfreyndiritu9062 3 года назад +10

    Thank you so much for this one Brad. I can't imagine how hard you work just to keep you audience ahead.

  • @mesutkacmaz
    @mesutkacmaz 3 года назад +74

    Web programming world, you're so fast and there's a lot to learn...

    • @DeViLTh0rn
      @DeViLTh0rn 3 года назад +1

      agree, but I only get to know what they offers not immediately use them.. unless org/company ask me to do or client want specifically want it then I will use them.. quite exhausted if you want to catch them all especially JS framework that keep expand.. since Fastify not so much different with Express i still can catch them up..

    • @DeViLTh0rn
      @DeViLTh0rn 3 года назад

      -A3n5N8XwpQ (youtube not allowed us to share a link here, so here is unique youtube id you can replace at the end of youtube url after watch equal sign) great advise from Ben Awad.. :)

    • @Hasnain1F
      @Hasnain1F 3 года назад +11

      Stop chasing/learning tools. Keeping up to date with every new framework or library is a waste of time.

    • @kuldeepkumar_
      @kuldeepkumar_ 3 года назад

      Yup there is a ocean of js frameworks now days

    • @bswill5077
      @bswill5077 3 года назад +1

      Learn what you need and necessary. Dont learn it all. If you want a slow phase framework try .net or java. im pretty sure you will get stuck on editing bugs legacy apps for a long time lol

  • @jatmikoherjati6348
    @jatmikoherjati6348 3 года назад +14

    Finally, fastify gets some love, it deserves more popularity. My company uses it as standard nodejs framework, replacing express totally, for about one a half year.

    • @AlexanderSuraphel
      @AlexanderSuraphel 2 года назад +2

      How is your experience one year later. Just coming to the node ecosystem and Fastify seems really great and very similar to FastAPI which I love.

  • @mahmoudabusaqer4585
    @mahmoudabusaqer4585 2 года назад +3

    Great job, keep going, please do more with Fastify this is the 6th course that I took with you and now I am doing an internship as a node.js developer, I learned a lot from you man. I am looking to learn more from you. Thank you so much.

  • @gadgetkh9408
    @gadgetkh9408 3 года назад +2

    Thank you. I've been searching for fastify videos for quite sometime!

  • @liorocker1
    @liorocker1 3 года назад

    I saw an intro to Fastify from one of the creators, but this crash course really made me take a look at this framework and get started my new nodejs projects using it. Thank you so much.

  • @aarambhverma1550
    @aarambhverma1550 3 года назад +4

    Thank you Brad for this course. You're a life saver! Loads of respect for you man :)

  • @datajames
    @datajames 3 года назад +2

    Hi Brad. I would def want to see more on Fastify, you could always add on 1 or 2 apis to show case some more advanced features of Fastify.
    Turn it into a speed guessing game if there is an api that generates random questions 🤪
    If a front end were to be added, make it very basic as to concentrate on Fastify and maybe other packages you'd like to add that works well along side Fastify.
    Data persistence you could write to the file system.

  • @hpn1427
    @hpn1427 3 года назад +1

    I just want to say that we all appreciate your hard work, millions of people will stand by my side when I say this, you made us into better programmers and better people

  • @rauldeandrade
    @rauldeandrade 3 года назад +1

    Looks really cool. I hope you will explore it further with a small MFRN? project... or even just a backend focusing on CRUD and what are the cooler features of Fastify.
    I hope your health is improving. All the best to you and your kids. You're the best Brad!

  • @DonkBadonka
    @DonkBadonka 2 года назад

    Oh man, I have watched only the first two minutes of the video and I already know I'm gonna learn a ton!! I watched your last React video and now I found this one and I'm so f happy!

  • @k.jflacko5720
    @k.jflacko5720 3 года назад +6

    would love for part 2 where you implement a database. Thank You, this was a great tutorial!

  • @Elon40k
    @Elon40k 3 года назад

    what an amazing tutorial. thank you so much brad for your shared wisdom. fastify is really cool! the swagger documentation pluigin is mindblowing.

  • @IfyDon
    @IfyDon 3 года назад

    Thank you Brad, This was very helpful, looking forward to you doing Authentication and Data persistence with mysql. Also throw a few more light on Fastify decorators. Great work again!

  • @rvndnishad
    @rvndnishad 3 года назад +3

    Really nice tutorial, it will really help me getting started with fastify, please continue on this adding authentication and postgress or Mongo db

  • @amani_art
    @amani_art 3 года назад

    As always great tutorial Brad!
    I'm watching this and thinking to myself- Nothing beats rails.
    There are just way too much setup that I don't like.

  • @kedarkm457
    @kedarkm457 3 года назад +1

    Thank you so much for the tutorial Brad :) most awaited one. Can you please make video on postgre sql with fastify

  • @PlotTwists
    @PlotTwists 3 года назад +2

    I watch this as entertainment lol .. thanks Brad, high quality content as always

  • @shloimiminkowicz4188
    @shloimiminkowicz4188 3 года назад +1

    Hey Brad, thanks so much for making this awesome video. You made my day :) Also, it would be very cool to do a MERN stack course with justify . Thought it'll be really cool

  • @jesseanderson7502
    @jesseanderson7502 2 года назад +1

    Great tutorial. That HTTP extension is amazing.

  • @jasonreviews
    @jasonreviews 3 года назад

    i was looking at fastly. thanks again brad for this free tutorial

  • @iqbalwahyudi5645
    @iqbalwahyudi5645 3 года назад +1

    Great video as always from this channel, would love to see fastify with postgres and jwt auth ❤️

  • @0xfsec
    @0xfsec 3 года назад

    Awesome tutorial! Love more fastify tutorials, like building simple project with it..

  • @user-cm2qm2yg4w
    @user-cm2qm2yg4w Год назад

    Thanks for this awesome crash course. Auth and Databases such as Postgress would be great to see on your next video

  • @hasanfares5774
    @hasanfares5774 3 года назад

    Really enjoying your content, I will be waiting for lesson 2 and up. Thanks.

  • @NeilTruick
    @NeilTruick 3 года назад

    Excellent video! Thank you for putting things in such clear context...

  • @novailoveyou
    @novailoveyou 3 года назад

    Fastify is great! I like it a lot, actually planning on building my next project with Fastify on the backend

  • @r-i-ch
    @r-i-ch 3 года назад +1

    Bring on the full-stack! Mongo + Auth!! Great tut as always...

  • @AnthonyJackman
    @AnthonyJackman 2 года назад

    I have never seen anyone use the spread operator in any 'live' video tutorial. Watching that specific segment should assist anyone still not solid in its use (or use case) come away with a better understanding of it. Thank you!

  • @renu3463
    @renu3463 3 года назад +15

    I feel like it's a crime to watch this for free 😭. Thank you VERY much

    • @mthaha2735
      @mthaha2735 3 года назад +1

      Don't skip the ad.

    • @__sarik
      @__sarik 3 года назад

      hehe, you virgin boi, i watch his courses on udemy by downloading them using torrent.

    • @gtmgtm8888
      @gtmgtm8888 3 года назад

      Don't worry he gave patreon link in description

  • @pedropalma3748
    @pedropalma3748 3 года назад +11

    Thanks so much for the tutorial. I would like to see, as you suggested, adding a db to it, postgres would be great. Another idea for an expansion could be adding a frontend, using for example react-admin to manage these resources. I really liked your tutorial about react-admin as well. Thanks again, Brad

    • @TraversyMedia
      @TraversyMedia  3 года назад

      No problem and thanks for the suggestions

  • @MrTechhack
    @MrTechhack 3 года назад +1

    Been waiting for this since i saw your tweet

  • @rahulprajapati8052
    @rahulprajapati8052 3 года назад +1

    Thanks for making this useful tutorial. I really appreciate it. Please create one tutorial with redis and SQL database.
    I think you forgot to add schema for update items to accept name from swagger.

  • @VenkateshMogili
    @VenkateshMogili 3 года назад

    One more crash course 😍😍😍 Thank you Brad❤❤❤ you are my greatest inspiration❤

  • @canada_calling
    @canada_calling Год назад

    Love Brad's videos. I am a bit late coming to this so there were some issues with using Swagger etc. with some updates since this was originally created. Not too difficult to make the necessary changes though. All in all a great resource. Thanks again.

    • @yesimhere7285
      @yesimhere7285 Год назад

      Any hints of what you changed would be greatly appreciated. I can't seem to figure out what should be changed given the docs I've found. Thanks!

  • @muzafferhassan
    @muzafferhassan 3 года назад

    Awesome video as always. Thanks for putting so much efforts to make it simple to understand. Please create it a bit more complex and attach it with some DB and authentication.

  • @samfreshly5331
    @samfreshly5331 3 года назад +1

    I’d love to see a fastify tutorial using typescript! I’m trying to learn them together for a job right now along with sequelize and Postgres

  • @mrashad_com
    @mrashad_com 2 года назад

    Great tutorial As usual, thank you very much for making me love Fastify

  • @sergiocano9658
    @sergiocano9658 2 года назад

    this crash course is awesome. I learned a lot. Thanks!

  • @keshavpriyadarshi5044
    @keshavpriyadarshi5044 3 года назад +3

    I want to thank you for what you taught us till now.

    • @TraversyMedia
      @TraversyMedia  3 года назад

      No problem bud. Thanks for watching!

    • @divyangbargali1554
      @divyangbargali1554 3 года назад

      @@TraversyMedia can u tell me how u learn things so fast. I can't learn things. They took years. Plz Brad help people.

  • @roodborstkalf9664
    @roodborstkalf9664 3 года назад

    Excellent. please continue and create one or more additional Fastify videos.

  • @neo-the-one
    @neo-the-one 3 года назад

    Great job as always. This channel is truly a gem 💎

  • @conservativ724
    @conservativ724 Год назад

    You explained very well how it works. Hello from Belarus :)

  • @edenr1988
    @edenr1988 3 года назад

    Thanks for sharing this awesome framework! Great tutorial 👌

  • @hustinjeffers1070
    @hustinjeffers1070 3 года назад +1

    Thank you Brad, would love to see auth, postgres and mongo

  • @user-bl4dn8ie6q
    @user-bl4dn8ie6q 3 года назад

    This is really helpful and nicely explained, thanks Brad. 👍

  • @cauebooks1383
    @cauebooks1383 3 года назад +1

    Please continue this series!!

  • @ruirodrigues3725
    @ruirodrigues3725 3 года назад

    Thank you for your well paced tutorial.
    I think you've missed some of the schema options in order to have a fully functioning Swagger. When you have a parameter you must add something like:
    params: {
    type: 'object',
    properties: {
    id: {
    type: 'string',
    description: 'item id'
    }
    }
    },
    In the update option the body is also missing.
    Regards.

  • @reeeeeeee8392
    @reeeeeeee8392 3 года назад +4

    Please do more fastify, i really do prefer it to express!

  • @benzigarjs8607
    @benzigarjs8607 3 года назад +2

    We need more videos on Fastify 😍

  • @myhanhnguyen5198
    @myhanhnguyen5198 Год назад

    thank you a lot. your video helps me to understand about fastify. Please make videos on Auth Passport JWT and some other security related core plugins.

  • @huxnwebdev
    @huxnwebdev 3 года назад +4

    Huge Respect From A Small RUclipsr Sir 💖
    Love Your Content 🖤

  • @FawzyTat
    @FawzyTat 2 года назад

    Hey man thanks again for your awesome tuts! got a small note though, using "Item" as model and route examples was a bad idea since I got confused it with the schema array items, not a big deal but confused me for few mins,

  • @Middollo
    @Middollo Год назад

    I got tired reading the docs, this worked great instead :) Thanks

  • @richardkirigaya8254
    @richardkirigaya8254 3 года назад +1

    A good alternative to REST client is Thunder Client. Every since i discovered this, i barely use PM unless am working in a large team with a lotta API endpoints. If am just testing an API to see the result, or post some data, i use Thunder client :)

    • @TraversyMedia
      @TraversyMedia  3 года назад

      I just haven't had time to look more into it. I will though. I hear great things

  • @lupanama1960
    @lupanama1960 2 года назад +1

    I like this, can you make it with typescript too for next video? I wonder the best project structure it would be for fastify when it comes with additional syntax

  • @AdityaPrakarsa
    @AdityaPrakarsa 3 года назад

    Great lesson as always Brad. Please do some auth with some database with Fastify. Thanks.

  • @sachin_dev
    @sachin_dev Год назад

    Loved this framework please make full fledge backend.

  • @sajjadhosenprovel2702
    @sajjadhosenprovel2702 3 года назад

    well you can use thunder client vscode extension for the requests. it's like you've integrated postman into vscode. ui and functionality is almost the same.

  • @PabloGnesutta
    @PabloGnesutta 3 года назад

    Hey Brad, thanks a lot. Didn't know this framework and seems promising.
    I would really love to see Middleware implementation, and maybe some authentication/authorization.
    Blessings from Argentina.

  • @danielkimani5431
    @danielkimani5431 3 года назад +1

    Fastify is amazing, it's decorator and plugin API is just underrated

    • @consoledoterror971
      @consoledoterror971 3 года назад

      Have you worked with fastify-autoload for route handling?.

  • @simonhall8421
    @simonhall8421 2 года назад

    Really enjoyed this! Perhaps a full stack PFRN (PostgreSQL Fastify React Node) full-stack app tutorial at some point?

  • @manoellopes
    @manoellopes 3 года назад +1

    Amazing video, bring more fastfy content please :)

  • @weiyangxumo5671
    @weiyangxumo5671 Год назад

    Very clear and useful! Thanks a lot!

  • @easyas-is
    @easyas-is 3 года назад +30

    Wish that there will be nodejs+graphql crash course including authentication and pagination ya.

    • @mthaha2735
      @mthaha2735 3 года назад +1

      See maxmillian. He has a great video on that

    • @easyas-is
      @easyas-is 3 года назад

      @@mthaha2735 Really? Where can I check on his videos? Appreciate that

    • @johncarlobartolome754
      @johncarlobartolome754 3 года назад

      @@easyas-is udemy and academind yt channel

    • @consoledoterror971
      @consoledoterror971 3 года назад

      Ben Awad 14 hours YT course.

  • @troymitchel4790
    @troymitchel4790 3 года назад +1

    Hey Brad, could you create a video discussing the new VSCode update "Do you trust the authors..." prompt and the best/proper way to handle this?

  • @danieltkach2330
    @danieltkach2330 2 года назад

    Beautiful. I'm going to check if you did more on Fastify. Nevertheless, please keep working on Fastify lessons, this looks really promising. I also watched bechmark videos and indeed Fastify is what I need for the volume of data my apps handle. Express is just too slow for my use-case. Thanks.

  • @muhammadalirashed7330
    @muhammadalirashed7330 3 года назад +1

    I'm a simple guy. I see brad's video, I hit a like

  • @MrDarkogaucho
    @MrDarkogaucho 3 года назад

    Thank you very much, Master teacher of Web Development

  • @mal3k395
    @mal3k395 3 года назад +1

    More of Fastify 💙💙💙

  • @maelstrom57
    @maelstrom57 3 года назад

    I'm definitely down for a follow-up!

  • @user-pi1mn3wb6r
    @user-pi1mn3wb6r 10 месяцев назад

    very clear course, thanks!!

  • @mamdouhwaleed9514
    @mamdouhwaleed9514 3 года назад

    I'd like to see mongodb used with this, and I wonder if I can use the same schema for both the handler and mongodb as to not have to change it twice in 2 different areas.

  • @shahinbayat
    @shahinbayat 3 года назад

    Looking forward for a more advanced and practical fastify course with database connection.

  • @tobiasq.8852
    @tobiasq.8852 3 года назад

    Pretty cool how I've read about fastify this morning and there's already a 1-month-old video on traversy media ...
    I'd love to see how one could migrate some basic express app to fastify. not just the routing stuff, but also some (auth) middleware and knex model files. I'm pretty sure there's the one or another pitfall to stumble into.
    What would be cool in general: A video on openapi / swagger. I have the feeling it's a generally trending topic and I think there's no video on your channel about it yet.
    On a side note: Perhaps I didn't follow along properly, but this project's documentation does not accept path params for me. Can I define these in the opts as well? any help is appreciated

  • @taless1981
    @taless1981 2 года назад

    Hey Brad, love your channel, keep up the good work 👍. Can you do a video on Hasura Graphql server for postgres. Thank you. Takecare

  • @MarkFreedmanNY
    @MarkFreedmanNY 3 года назад

    Thanks, Brad. This was great.

  • @soniablanche5672
    @soniablanche5672 3 года назад +1

    It would be interesting to see how you can do authentication with this library

  • @marciobarroso
    @marciobarroso 3 года назад +1

    I would love to see the implementation of security with jwt using typescript 😀

  • @ahmedestong
    @ahmedestong 3 года назад

    It's look like very nice. I'm going to give it a try!

  • @jasonshen
    @jasonshen 3 года назад

    Nice tut as usual, cheers for it👍

  • @salmaelbarmaki3257
    @salmaelbarmaki3257 3 года назад

    Hey Brad! I was wondering if you're gonna do a Styled components crash course any time soon.

  • @niahi
    @niahi 3 года назад +3

    Just here to say I would love to watch the mongoose version you mention at 8:05

  • @consoledoterror971
    @consoledoterror971 3 года назад +2

    For those who want autocompletion.
    const fastify = require('fastify').default;
    const app = fastify({ logger: true });
    app.* => You will get autocompletion now

    • @AlexanderSuraphel
      @AlexanderSuraphel 2 года назад +1

      Not all heroes wear caps! I kept reloading VSCode for a full minute. 😅

  • @haraldndb.1250
    @haraldndb.1250 3 года назад

    Yeah - fastify is great! Keep up the good work Brad!

  • @nishantverma1649
    @nishantverma1649 2 года назад

    Hi Brad, great job. Love from india🇮🇳

  • @darkmift
    @darkmift 3 года назад

    I'd love to see you take on something like storybook sometime 😃

  • @arsalanhussain6499
    @arsalanhussain6499 3 года назад

    The videos awesome simple to understand and learn
    I would really like to see fullstack app with fastify using react with Authentication

  • @zacharymeyer991
    @zacharymeyer991 3 года назад

    Nice I love fastify! You should do a course/tutorial series on Kubernetes / Helm, maybe using keycloak as your authentication service?

  • @utubeshiv
    @utubeshiv 3 года назад

    thanks. I would like to see authentication with role (RBAC) example, if possible please

  • @bacon37460
    @bacon37460 3 года назад

    Thanks Brad for this one.

  • @MoawiaAlmardoud
    @MoawiaAlmardoud 3 года назад +1

    Would please make another video with fastify-mongodb based on routes, controllers, and mode?

  • @stayhappygaming
    @stayhappygaming 3 года назад

    hi brad, what software are you using to make this video? i realize the file size of this video are quite small

  • @furkanstbs
    @furkanstbs 3 года назад

    So, can we think about the fastify.register() method as an equivalent to app.use() method of Express, which we can use to provide middlewares?

  • @innoventstack
    @innoventstack 3 года назад

    Hey brad can you elaborate about express vs fastify which is better for micro service api

  • @Gobillion160
    @Gobillion160 3 года назад

    great vid! im gonna try using fastify

  • @sheriffibrahim1065
    @sheriffibrahim1065 3 года назад

    great content here!!.
    please I would love it if you could do a video of authentication using a DB like mongoDB
    thanks travy

  • @haans8
    @haans8 3 года назад +1

    i think it would be complete if you add jwt or redis session for auth, and any sql for db