# Firebase Integration Into User App

{% embed url="<https://www.youtube.com/watch?v=nHUMjzW9tZc&t=48s>" %}

1. [**Editing environment files in project**](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md#1-editing-environment-files-in-project)
2. [**Creating database in Firebase**](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md#2-creating-database-in-firebase)
3. [**Enable Sign In Provider**](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md#3-enable-sign-in-provider)
4. [**Sign in using demo email ID**](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md#4-sign-in-using-our-email-id)
5. [**Test the user app**](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md#5-test-the-user-app)

### &#x20;1. Editing environment files in project

Open the project in your code editor and navigate as follows:-

Src -> Environments -> “environments.ts”

The code to be replaced is shown and highlighted below. Replace the highlighted code below with the code you copied to text editor from firebase in previous step.

![](/files/-M57z8HXQHljfJEosXzB)

\
Now open **environments.prod.ts** file from **Environments** folder.

The code to be replaced is shown and highlighted below. Cut the highlighted code shown below. Paste the code you copied to text editor from firebase in previous step here.

![](/files/-M57zQRZ0hxt6KW0uXQh)

###

### 2. Creating database in Firebase

The image shown below is the same screen we saw after competing all the steps of [New Firebase Project Setup](/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-project-setup.md) section in firebase console. Click on “Continue to console” button.

![](/files/-M57zbQirxeKXETjiwVa)

You should see the following screen where your app will be added to firebase.

![](/files/-M57zi7M-lbrz_xpubP8)

\
Click on “database”  shown under the "Develop" section.It should show you the following screen and click on “Create database”&#x20;

![](/files/-M57zyAXi7TTePdmnZhf)

Select “Start in test mode” and click “Next” as shown below.&#x20;

![](/files/-M58-I8k_BQQ6bIqrSlp)

Click on “Done”. It should show you the following screen.

![](/files/-M58-WlIZmgL6nszLwvS)

Open your app running on localhost as shown below and refresh it.

![](/files/-M58-hMzMmdnLctuaaQ8)

Click on “register” and it should show you the following screen. Fill your details to sign up as a user for the app and click “Next”.

![](/files/-M580-45jxl3uBT3HLKL)

As you can see below the sign in provider is disabled for this firebase project. Click on "Done"

![](/files/-M5B8gHlaMcsgghy0cqY)

###

### 3. Enable Sign In Provider

Let us go to Firebase console to enable "sign in". Click on “Authentication” shown under the "Develop" section. It should show you the following screen.&#x20;

![](/files/-M580Ni1NtEhp9vBephY)

Click on "Sign in method". It should show you the following screen.

![](/files/-M580bfUNPhnW-D5I4rk)

Select the "Email/Password" at the top of this list of "Provider" (which is disabled currently). It should show you the following screen. "Enable" the first option and make sure that second one is "diasbled" and click “Save”.

![](/files/-M5819g4DaPF_PLdWJ1_)

###

### 4. Sign in using our email id

Let us go back to our app running on localhost as shown below and click “Next”.

![](/files/-M581O_8A7BotVsVfqkV)

You should be able to login now. Screen showing your current location on the map should appear now, as shown below.

![](/files/-M581_LnX_EV43QKI-dE)

###

### 5. Test the user app

Add a "Pick up location" and a "Destination location". Book a ride and you should be able to see the following screen after waiting for a while.

![](/files/-M5BT4Jb88IgYOPdkZJg)

###

### Taxi driver App&#x20;

Now we have successfully completed running the Taxi user App. Let us run the taxi driver app so that we can test our Taxi app completely.&#x20;

Go to [Driver App Setup](/ionic-taxi-booking-app-starter/how-to-use-this-starter/setting-up-and-running-taxi-driver-app.md) section to see how to do it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enappd.gitbook.io/ionic-taxi-booking-app-starter/firebase-setup-and-integration/firebase-+-our-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
