# 6. Admin Credentials Steup

1. From your Firebase Console > Your App, go to the **Build > Authentication > Sign-in method** tab and Enable **Email/Password** and Save it.

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FYiULiy0DAcZ3nqwqs65L%2FScreenshot%202023-05-15%20at%2010.39.35%20PM.png?alt=media&#x26;token=453784b2-b255-493b-afb4-393bf2f1fcea" alt=""><figcaption></figcaption></figure>

2. Now go to the **Users** tab and click on the **Add User** button and create a new account by providing your email and password.

{% hint style="info" %}
The username and password will be the admin email and password.
{% endhint %}

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FJ0Il2lb1peBJTPhDwMIH%2FScreenshot%202023-05-15%20at%2010.45.13%20PM.png?alt=media&#x26;token=5626cad8-b653-447d-9fb5-aa395fb246d2" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2F00s6fbu18QHkEkRqS3Ie%2FScreenshot%202023-05-15%20at%2010.44.01%20PM.png?alt=media&#x26;token=823bbc08-d834-464f-9b39-3be1880213d3" alt=""><figcaption></figcaption></figure>

3. Copy The **User UID** which is required for the next step. Now you have to create a record of the account you have created in the database.
4. Go to the **Build > Firestore Database** and create a collection named **users** by clicking on the **Start Collection** button.

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FjjBxWlfRchoDjrJsxSI0%2FScreenshot%202023-05-15%20at%2011.01.09%20PM.png?alt=media&#x26;token=0308cd96-5bd4-43a9-833e-7fdd5382f66d" alt=""><figcaption></figcaption></figure>

5. After clicking Next, you will get a new document form.
6. Use the **user Id** that you have copied as **Document ID**. Create a field named **id** and use the **user id** as value (same as Document ID). Create another field named **email** and use your admin **email** as value. Create another field named **name** and enter **your name** as value. Create another field named **created\_at** and the type must be **timestamp** and select **a date and time** as value. Create another filed named **role** and the type must be an **array** and write **admin** as the first value of that array.

{% hint style="info" %}
The fields and types should be exactly the same as shown in the picture below.
{% endhint %}

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2F1d8WDc6t0AV2cFHvHzI8%2FScreenshot%202023-05-15%20at%2011.15.00%20PM.png?alt=media&#x26;token=1de99929-22b2-494f-b808-59bafabe3912" alt=""><figcaption></figcaption></figure>

7. Save it and after creating the user collection and document, your document details will look like this:

<figure><img src="https://3767936052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fcv8FlmekAQLXUn7f8PbK%2Fuploads%2FpZSefcAoZuiEHx65TLVp%2FScreenshot%202023-05-15%20at%2011.05.30%20PM.png?alt=media&#x26;token=a9141b64-a123-4e68-8109-8ed794909bce" alt=""><figcaption></figcaption></figure>

That's it. Your admin account has been created. You can now login into your admin panel using the email and password you have created now.

{% hint style="info" %}
After, login into your admin account, if you see a validation form, just enter your purchase code and validate your account.
{% endhint %}
