4. Setting up the Admin Site

To manage (create, edit, delete, sort..) country, cities, categories, places, banner ad, users…you need to deploy the Admin Site Code on Trid package to Firebase Hosting that you're created in Step 1.

Setting up the Admin Site

Before you can install the Firebase CLI, you will need to install Node.js on your machine. Once you've installed Node.js, you can install the Firebase CLI using npm (the Node Package Manager).

Install Firebase CLI https://firebase.google.com/docs/cli/

  1. Open Terminal (MacOS, Linux) or Command line (windows). Enter bellow command:

$ npm install -g firebase-tools

2. You should now have a globally available firebase command available from any terminal window on your machine. Once you've installed the Firebase CLI, sign in using your Google account:

$ firebase login

3. After purchase and download Trip package. You can Rename and Unzip it everywhere on your computer. cd to Admin Site folder in Trid Package Folder.

4. Init Admin Site.

firebase init

The firebase init command creates a firebase.json configuration file in the root of your project directory.

5. Use "Arrow down" and "Space" key to choose Hosting. Then "Enter".

6. Use "Arrow down" to select Your Project that created in Firebase

7. Enter > Enter > Enter

A file firebase.json created in Admin Site folder

8. Now. Open terminal and cd to Admin folder in Admin Site folder and "npm install"

9. Come back Firebase console: https://console.firebase.google.com

Click + Add App button

10. Choose "Add Firebase to your web app"

11. Copy this statement

Importion: Don't need copy <script src="https://www.gstatic.com/firebasejs/5.6.0/firesbase.js></script>The Trid Admin Site still using firebase version 3.3.0. We will update it soon.

12. Open Admin site/public/admin/index.html

12. Select statement and paste

13. Ok. The last step. DEPLOY

cd to Admin Site folder. Write into command line: firebase deploy --only hosting

And waiting......

DONE. You deploy complete!

Go to hosting Url + /admin in the browser.

Ex: https://name-firebase-project.firebaseapp.com/admin/

You can see Login admin site:

Important: To login to Admin Site. You need create an admin account.

Create an admin account

  1. Run your iOS or Android app that you was setting in Step 1 or Step 2

  2. In the App. Go to Sign Up and create an account here:

3. After create an account. Go to the Firebase Console ---> Database ---> Realtime Database

4. Open Users Table, you can see the account created in here.

5. In row isAdmin, set is True

Now, you can open the admin site and login with this admin account.

Done. Good luck :)

Last updated