Building an API with Firebase

Building an API with Firebase

In this post I will be building out an API with Google’s Firebase. I will be building out the back-end with Firebase Cloud Functions and ExpressJS.

In this post I will be building out an API with Google’s Firebase. I will be building out the back-end with Firebase Cloud Functions and ExpressJS.

Before I begin, I recommend you have the following setup:

  1. A terminal setup on either a Windows, Linux, or Mac (OSX) computer
  2. Node 10.10 installed
  3. NVM installed with the instructions here
  4. A Google Account
  5. Postman installed
  6. Firebase CLI installed with a run of the terminal command npm install -g firebase-tools

I’m going to be referring to the code available at this GitHub repo. The GitHub repo also contains a Postman Collection — I recommend importing that collection and using that to test your project. Please note that the app id in the URL paths is specific to my deployed project. You'll need to change the app id to match a project you'll be creating in the Firebase Console. If you don't understand that yet, it's okay - I'll be discussing this more after the initial project is setup.

The Basics

To start, I wanted to go over some basic concepts about what APIs are and how the technologies work. This is completely introductory, so feel free to skip this section if you are already familiar.

API stands for Application Programming Interface and refers to the method that computer systems use to communicate with one another. If you Google it, Google defines APIs as:

a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service.

Basically, you build out an API so that your system can communicate with whatever you’re building. API’s can include basic REST endpoints for a website, or even the methods that define a software library you’ve built. Which brings up the next important thing, RESTful Services.

RESTful services refer to Representational State Transfer, and take advantage of the HTTP protocol to pass data (via an API). The HTTP protocol is what we use everyday in websites and internet applications. RESTful services use different HTTP verbs (or methods) to pass data between different systems. Typical HTTP verbs that you will use include the following:

  • GET = retrieving data
  • POST = creating or updating data
  • PUT = updating data
  • DELETE = deleting data

I also mentioned “endpoints” earlier, that is just what I’ll be referring to when I mention a website or service I need to hit. An endpoint is just a fancy way to describe an address that my system will be hitting with an HTTP request. For more on the ins and outs of HTTP requests, please refer to the wikipedia page.

firebase

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

What is firebase,firebase bangla tutorial.

LIKE | COMMENT | SHARE | SUBSCRIBE The Firebase Realtime Database is a cloud-hosted NoSQL database that lets you store and sync data between your users in re...

Firebase Introduction with C#

LIKE | COMMENT | SHARE | SUBSCRIBE Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google...

Create database into firebase

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, I will show you how to Create database into #firebase console. Subscribe & Stay Connected! Thank You! ♥ #Fi...

Save Employee into firebase

LIKE | COMMENT | SHARE | SUBSCRIBE In this video, I will show you how to save employee information into firebase database. Subscribe & Stay Connected! Thank ...

Install firesharp library from nuget

LIKE | COMMENT | SHARE | SUBSCRIBE The Firebase C# Library FireSharp contains development information for the Firebase API, written in C#. This library provi...