Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting up Flashlight on Heroku for ElasticSearch with new Firebase

My goal is to connect Firebase with ElasticSearch for indexing so that I can implement "like" queries when searching usernames in my iOS app. From what I've read this is the best solution, and I want to tackle it this way early in order to be scalable instead of brute-forcing it.

To achieve this, I'm trying to deploy the flashlight app that Firebase developers have provided for us onto a Heroku, but I'm confused on how to go about doing it. Please correct me where I'm wrong, I'm fairly new to the Heroku ecosystem, ElasticSearch, and nodejs.

I currently have a Heroku account, and have the toolbelt and nodejs/npm installed on my computer (Mac). I've run the following commands:

git clone https://github.com/firebase/flashlight
cd flashlight
heroku login
heroku create
heroku addons:add bonsai
heroku config

(I was able to get my bonsai url successfully with the heroku config command)

The next step is

heroku config:set FB_NAME=<instance> FB_TOKEN="<token>"

But I don't really understand what FB_NAME (my guess is Firebase app name, but is that the name of my app? or with the letters/numbers following it due to the new Firebase setup where it's no longer app_name.firebaseio.com but app_name-abc123.firebaseio.com) and what is FB_TOKEN? (is it a key or something in my plist I download?)

like image 726
Hellojeffy Avatar asked Jul 08 '16 22:07

Hellojeffy


1 Answers

To get your FB_NAME (it's basically your Firebase project's ID):

  1. Go to Project Settings
  2. Go to General tab
  3. Copy your Project ID

enter image description here

To get your FB_TOKEN:

  1. Go to your Google Developer Console
  2. Select the project that is associated with your Firebase project
  3. Go to Credentials page
  4. Create a new API Key or choose if you have an appropriate one already

Note: You can also set (and see) those variables in you Heroku project (if you don't want to set it from the terminal). To do that:

  1. Go to your Heroku project's Settings page
  2. Click on the Reveal Config Variables button

Good luck.

like image 56
Mustafa Berkay Mutlu Avatar answered Nov 12 '22 03:11

Mustafa Berkay Mutlu