> For the complete documentation index, see [llms.txt](https://firepress.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://firepress.gitbook.io/documentation/get-started/create-firebase-project.md).

# Create a Firebase Project

You can read all about Firebase and its features at <https://firebase.google.com/>

{% hint style="info" %}
The following documentation is based on the official Firebase documentation (<https://firebase.google.com/docs/web/setup>), but adjusted where appropriate to work with Firepress.
{% endhint %}

### Before you begin <a href="#before_you_begin" id="before_you_begin"></a>

* [Sign into Firebase](https://console.firebase.google.com/) using your Google account.

### &#x20;<a href="#create-project" id="create-project"></a>

### **Step 1**: Create a Firebase project <a href="#create-project" id="create-project"></a>

1. In the [Firebase console](https://console.firebase.google.com/), click **Add project**, then select or enter a **Project name**.
2. *(Optional)* If you created a new project, you can edit the **Project ID**.

   Firebase automatically assigns a unique ID to your Firebase project. Visit [Understand Firebase Projects](https://firebase.google.com/docs/projects/learn-more#project-id) to learn about how Firebase uses the project ID.**After Firebase provisions resources for your Firebase project, you cannot change your project ID.** \
   To use a specific identifier, you must edit your project ID during this setup step.
3. Click **Continue**.
4. *(Optional)* Set up Google Analytics for your project.
5. Click **Create project**.

Firebase automatically provisions resources for your Firebase project. When the process completes, you'll be taken to the overview page for your Firebase project in the Firebase console.

### &#x20;<a href="#register-app" id="register-app"></a>

### **Step 2**: Register your app <a href="#register-app" id="register-app"></a>

After you have a Firebase project, you can add your web app to it.

Visit [Understand Firebase Projects](https://firebase.google.com/docs/projects/learn-more#best-practices) to learn more about best practices and considerations for adding apps to a Firebase project.

1. In the [Firebase console's project overview page](https://console.firebase.google.com/), click the **Web** icon (< />) to launch the setup workflow.

   If you've already added an app to your Firebase project, click **Add app** to display the platform options.
2. Enter your app's nickname.

   The nickname is an internal, convenience identifier and is only visible to you in the Firebase console.
3. *(Optional)* Set up Firebase Hosting for your web app. If you do not set up Hosting now it's not a problem as Firepress will handle this during deployment.
4. Click **Register app**.
5. You can skip through the next few steps as we will handle that in the coming sections.

###

### Step 3: Authentication

In this step we will be enabling Firebase Authentication so that we can later log in as an admin user and create updates.

1. From the [Firebase console's project overview page](https://console.firebase.google.com/), go to the **Authentication** section.
2. On the **Users** tab, click the button to **Set up a sign-in method**.
3. Enable the **Google** provider.

&#x20;

### **Step 4: Cloud Firestore**

Firepress CMS uses cloud firestore to manage stored data.

1. From the [Firebase console's project overview page](https://console.firebase.google.com/), go to the **Cloud Firestore** section.
2. Click the **Create Database** button.
3. Select **Start in production mode** and click **Next**.
4. When the database has finshed provisioning, go to the **Data** tab and click **Start Collection**.
5. Add the collection **blocks**. **--** This **blocks** collection is where all of the Firepress CMS content will be stored.
6. In order to create a collection the collection must also include a document. Click the **Auto-id** button to generate a random id, and then click **Next**. -- This document won't be used and is solely there to enable the creation of the **blocks** collection.
7. Next, go to the **Rules** tab. -- You can read more about Firebase Rules at <https://firebase.google.com/docs/rules>
8. If you created your database in production mode, your rules should look like:

   `rules_version ='2';` \
   `service cloud.firestore {`\
   &#x20;  `match /databases/{database}/documents {`\
   &#x20;     `match /{document=**} {`\
   &#x20;        `allow read, write: if false;`\
   &#x20;     `}`\
   &#x20;  `}`\
   `}`

   \
   This currently blocks all read/write updates from outside of privaliged enironments.\
   We are going to update this rule to allow read/write  operations from authenticated users with the custom claim of `editor`. You can read more about custom claims at <https://firebase.google.com/docs/auth/admin/custom-claims>.\
   Update your rules to be the following:

   `rules_version ='2';` \
   `service cloud.firestore {`\
   &#x20;  `match /databases/{database}/documents {`\
   &#x20;     `match /{document=**} {`\
   &#x20;        `allow read, write: if request.auth.token.editor == true;`\
   &#x20;     `}`\
   &#x20;  `}`\
   `}`
9. Click **Publish** to save you changes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://firepress.gitbook.io/documentation/get-started/create-firebase-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.
