[Nodejs] Setup Firebase in 4 step

Written by peterchang_82818 | Published 2018/04/06
Tech Story Tags: firebase | javascript | nodejs

TLDRvia the TL;DR App

Firebase provides a realtime database and backend as a service.

Sound like a good plan to me, a lazy coder

The service provides application developers an API that allows application data to be synchronized across clients and stored on Firebase’s cloud.

1- Creating an Firebase application

Creating an Firebase application by a click on https://console.firebase.google.com/

2- Get service account key

After you click the Generate New Private Key button, a JSON file containing your service account’s credentials will be downloaded. You’ll need this to initialize the SDK in the next step.

To read more: https://firebase.google.com/docs/admin/setup

3- Setup Node.js project

Setting up Node.js application for Firebase project is easy, just install firebase-admin and putting the service key .json on the right path, done.

Github Example: https://github.com/wahengchang/nodejs-firebase-example

Readmore : https://firebase.google.com/docs/admin/setup

Extra: creating a new data for the project

First, create a database reference to your user data. Then use set() / setValue() to save a user object to the database with the user’s username, full name, and birthday.

Readmore: https://firebase.google.com/docs/database/admin/save-data

$ node app.js

Reference:

https://github.com/wahengchang/nodejs-firebase-example

— https://firebase.google.com/docs/admin/setup

https://firebase.google.com/docs/database/admin/save-data


Published by HackerNoon on 2018/04/06