Firebase Functions Tutorial #1 - Introduction

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right then gang and welcome to your very first firebase cloud functions tutorial now just really quickly before we start the tutorial for those of you who want to support the channel and join the gang officially you can do by clicking that join button right here is just in 99 cents or pence per month and you get these cool little ninja loyalty badges next to your name in the comments down below when you leave a comment you can also join by clicking the button right beneath the video if you're watching one now which I'm guessing you are it does exactly the same thing alright so now that's at the way let's get on with the tutorial so then for those of you who've been watching my channel for any length of time you'll already know that I'm a fan of firebase and I've done a lot of firebase tutorials over the last couple of years now you might already know what firebase is but for those of you who don't basically firebase is a back-end as a service now what do I mean by that well I mean it allows us to do something called server love computing and that means we don't have to set up our own server to build apps or websites and we can use a firebase service and services to do that instead and we can use services like the database or authentication our hosting or cloud storage and we only need to use the bits that we need our apps or sites so we can use all of these different firebase reaches and more for our sites and apps and we don't have to setup our own server to manage all of this now even though that's great sometimes you want to write your own server-side code to maybe add roles to users or to validate data or to react to changes in your database basically to run any kind of code that you don't want to run on the front end now that's kind of hard to do if we're using a syphilis approach because we don't have a server to do that on so firebase made cloud functions to allow us to do this and that basically means that we can write code that runs server-side on firebase servers and that code can interact with other firebase services like the database or authentication or storage etc and each bit of code that we write is packaged or into a function and deployed to firebase now each function can do something different so for example we could have a new user that signs up to our app or website using the firebase authentication now you might want to create a record in the database of for that user but sometimes you don't want to allow database write access from the front-end over here you want to do that from the server so what you could do is write and deploy a cloud function to do that instead so the function would listen for new user signups and trigger whenever that event happens to create a database record for that user now there's many different use cases for cloud functions and we're going to see a few different ones in this series now just quickly firebase cloud functions run in a node.js environment on firebase service and that means that we can write our functions in JavaScript or typescript now I'm going to be using JavaScript for this course however all the same theory and procedures will apply for typescript as well okay and so I'm just going to give you a quick demo of the project that we're going to create throughout this course while we learn about firebase functions so first of all I'm going to register as a new user and to do that I'll say toad at the net ninja code at UK and by the way toad is a Mario character the password I'll just say test one two three and I'm going to register once I've registered I can see that we have a list of tutorial requests that different registered people can make and each one has the number of up votes so I can upvote things like so and it's going to take a second to do that at first because when you first invoke a firebase function it does take a minute to do but you can see eventually it goes to three and it goes to the top so the most up voted tutorials go to the top and the least voted go down below now like I said that took a little while to do but when you start to use your functions more the more a function is used it becomes quicker so for example if I up vote this one it's going to be a little bit quicker now you'll see that got to pretty much straight away so we can do that and add new requests so I'm going to click on add request and any to think of something that we're gonna add now so let's just say view and laravel and submit request and then we see that one at the bottom as well has zero votes to begin with but if I try and vote it I can do and it's going to go to one now each user can only vote something once so if I try to vote this again it's not gonna let me do that and I get a little notification saying that so that's cloud functions in action and we'll see all of that later on so this is what we're going to be building as we go forward but before you start I would recommend that you already understand about firebase authentication because this uses firebase authentication and I'm not going to go into great detail about how that works I would expect you to know the basics already so if you want to learn more about that I've got a whole playlist all about firebase authentication right here on this channel the links of that is going to be down below so definitely check out that first of all also to store all the data we're going to be using firebase fire stored databases and again you should already know about that because I'm not going to go into great depth about the intricacies so if you want to learn that first of all which I do recommend check out this playlist that's firebase fire store tutorial complete tutorial from beginning to end that is on this channel as well I'll leave the link down below the final is kind of a given but I would expect you to know a little bit about JavaScript as well asynchronous code functions all that jazz if you want to learn JavaScript I've got a great introduction to it here modern JavaScript tutorial and I'll leave the links of that down below as well finally you do need node J s installed on your computer to work with firebase we're going to be using the firebase CLI later and to use that we need node and the node package manager installed so if you've not already go to no js2 org and download it right here and finally all of the course files for this series are going to be right here on github this repo firebase functions this link is going to be right down below as well and each lesson in this series has different codes so each lesson has its own branch on this Gilberry so if you want to see the code for lesson 8 for example go to the branch drop-down and go to lesson 8 and you're going to see all of the code right here ok so there we go my friends that is your introduction to firebase functions so I really really hope you enjoy this series if you do don't forget to share subscribe and like that really means a lot and if you really want to support the cars you can do by joining the channel or right here just click on this join button and you can join for 99 pence or cents for month depending on where you live and you get a nice little budget next to your name in the comments as well but anyway I'll see you in the very next tutorial where we're going to setup firebase in our project [Music]
Info
Channel: The Net Ninja
Views: 134,631
Rating: undefined out of 5
Keywords: firebase functions, firebase, functions, cloud functions, firebase cloud functions, serverless, serverless computing, cloud computing, firestore, firebase auth, firebase functions tutorial, cloud functions tutorial, firebase tutorial, tutorial, functions tutorial
Id: udHm7I_OvJs
Channel Id: undefined
Length: 7min 33sec (453 seconds)
Published: Mon Mar 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.