For developers who primarily (or just prefer to) work on the front-end, completing all of that back-end functionality for your application can be a bit of a chore. Especially in situations where you’re just working on a small side-project, or maybe even a small-scale group project, and you just need to add a bit of the usual stuff to round out your app. After all, who really wants to deal with writing out a bunch of Express routes, planning out and structuring a complicated SQL database, as well as a bunch of other stuff, just for your little portfolio app?
What if I told you that there was one service that can handle all of those things like user authentication, the database, file storage, and even hosting?
Well, this really isn’t that crazy. There are several services that have popped up in the last few years that can do stuff like this. Nevertheless, in my opinion, there is one that really stands out: Firebase by Google (note, I think Firebase started out as an independent company, but Google acquired it a number of years ago and currently operates it; but that’s all a story for another time).
Recently, I was working on a group project that included a mobile app portion, which we were coding using React Native. I was tasked with looking into our options for the database and other back-end-y stuff.
I read that the Firebase database was common to use with React Native (and honestly, I wanted to get more experience with a NoSQL database), so I convinced my team that Firebase would be a good option for our app. Moreover, our overall project included a website portion, so Firebase seemed like a convenient way to glue the web app to the mobile app. (Another side-note here — Firebase currently has two database options, the Realtime Database and the Firestore; but alas, once again, this is a topic for another time. For this project, we used the Firestore).
So, great, we had our database figured out. A little later, the team developed a feature where the user had an option to upload an image. Therefore, we needed a convenient and easy-to-implement (and most of all, cheap) solution for this. Again, there are many services out there that can handle this (looking at you, AWS), but eventually I once again settled on Firebase. Firebase Storage was simple to set up and use, and easy to implement the necessary code into our codebase.
Database: check, Storage: check. What about user authentication? I’m probably not alone in this, but I think authentication is a bit of a pain. For features that are so common (creating an account/logging on/logging off), they can take a while to code and set up properly.
There’s got to be a better way! Well, with Firebase, there is. With just a few button clicks on the Firebase website, and a few lines of code, authentication is easily implemented into your project.
Ah, deployment and hosting — words that are bittersweet. It’s finally time for your completed app to become an adult and be sent off into the world. Now, there are many options for hosting, but hey, wouldn’t it be crazy if Firebase could handle this too? Well, it can! Technically, Firebase can only host static apps (think Github pages, and not Heroku, which is still undoubtedly the best option for full-stack applications). However, this is where some word parsing comes into play. In reality, the apps that you would be building with Firebase are only static, front-end apps. The codebase includes calls to Firebase, which functions as a complete back-end as a service. Therefore, you aren’t deploying your own server; you’re really just spinning up your front-end code. Because of this, Firebase hosting works as a great option!
So there you have it. If you’ve learned anything from this article, it’s that I am now a fully-fledged Firebase fanboi. Nevertheless, it is not without reason. As you can see, Firebase can handle so many parts of the back-end of your app; and ultimately, the true value is that all of this can happen using just one service, adding to convenience, peace of mind, and developer happiness.