Setting up Flashlight on Heroku for ElasticSearch with the new Firebase involves a few steps. Let’s clarify the confusion regarding FB_NAME
and FB_TOKEN
.
-
FB_NAME
: This is the name of your Firebase project. In the new Firebase setup, the project name is typically in the formatyour-project-name-12345
, whereyour-project-name
is the name you gave to your Firebase project and12345
is a unique identifier assigned by Firebase. You can find this name in your Firebase project settings. -
FB_TOKEN
: This is the Firebase authentication token that allows Flashlight to access your Firebase data. To generate this token, you’ll need to follow these steps:- Go to your Firebase project console.
- Click on the gear icon next to “Project Overview” and select “Project settings”.
- In the “Service accounts” tab, click on “Generate new private key”.
- This will download a JSON file containing your Firebase service account credentials. Open this file, and you’ll find the
private_key
field, which is yourFB_TOKEN
.
Once you have your FB_NAME
and FB_TOKEN
, you can set them as environment variables on Heroku using the following command:
bashheroku config:set FB_NAME=your-project-name-12345 FB_TOKEN="your-firebase-token"
Replace your-project-name-12345
with your actual Firebase project name and your-firebase-token
with your Firebase authentication token.
After setting these environment variables, you can proceed with deploying Flashlight to Heroku by following the rest of the steps provided in the Flashlight documentation.
المزيد من المعلومات
الخطوات التي ذكرتها حتى الآن تمثل جزءًا من عملية إعداد Flashlight على Heroku لاستخدامها مع Elasticsearch و Firebase. إليك المزيد من المعلومات حول كيفية استكمال عملية الإعداد:
-
تحتاج إلى تثبيت أدوات Elasticsearch على Heroku. يمكنك القيام بذلك باستخدام الأمر التالي:
bashheroku addons:add bonsai
هذا الأمر سيقوم بإضافة مثيل Elasticsearch مدار على Heroku إلى تطبيقك.
-
قم بتكوين متغيرات البيئة الأخرى المطلوبة لتشغيل Flashlight. على سبيل المثال، إذا كنت تستخدم Firebase للمصادقة، فقد تحتاج أيضًا إلى تعيين متغيرات البيئة التالية:
bashheroku config:set FB_CLIENT_EMAIL="your-firebase-client-email" heroku config:set FB_PRIVATE_KEY="your-firebase-private-key"
حيث
FB_CLIENT_EMAIL
هو عنوان بريدك الإلكتروني للعميل في Firebase، وFB_PRIVATE_KEY
هو المفتاح الخاص بك الذي تم تنزيله من Firebase كملف JSON. -
بعد تكوين جميع المتغيرات البيئية، يمكنك الآن نشر التطبيق إلى Heroku باستخدام الأمر التالي:
bashgit push heroku master
هذا الأمر سيقوم برفع تطبيق Flashlight إلى Heroku وتشغيله باستخدام التكوينات التي قمت بتعيينها.
-
للتحقق من أن التطبيق يعمل بشكل صحيح، قم بفتح متصفح الويب وقم بزيارة عنوان URL الخاص بتطبيقك على Heroku.
bashheroku open
يجب أن يعرض Flashlight صفحة ويب تظهر الواجهة الرئيسية للتطبيق.
تلك هي الخطوات الأساسية لإعداد Flashlight على Heroku مع Elasticsearch و Firebase. يرجى مراجعة الوثائق الرسمية لـ Flashlight و Heroku لمزيد من التفاصيل والتعليمات الخاصة بكل منهما.