### Prerequisites

1. A Google Cloud Platform account
2. A project on Google Cloud Platform (These 2 steps are covered in the Mobile App - Google Maps Integration)
3. Install GCloud and run auth command

- Download GCloud https://cloud.google.com/sdk/
- Open a terminal and run the following command

    gcloud auth application-default login --project=YOUR_PROJECT_ID

### Create a bucket

1. Go to Google Cloud Platform on https://console.cloud.google.com/
2. Click on console.
3. Select the project you want to use.
4. In the searchbar, search for “Buckets” and click on “Buckets”.

5. Click on “Create Bucket”.

6. Add a new name and other required data for your bucket and click on “Create”. (Make sure you select a region that is close to your server’s location)

7. You should see a screen similar to this one

8. Go to the PERMISSIONS tab and allow anyone to view the files from the bucket

- Click on `GRANT ACCESS`
- Add `allUsers` as new principal
- Add `Storage Object Viewer` as role

The bucket is now created and anyone can see the images uploaded there. Let’s see how we can upload and delete files from the bucket.

### Create a service account

1. In the Google Console platform, search for Service Accounts IAM

2. Click on the “Create Service Account” button
3. Add a name and description for your service account and click on “Continue”

4. Grant the service account the Storage Admin role and click on “Done”

5. Click on the service account you just created, got to the Keys tab and click on Add key with JSON format. This will download a JSON file with the credentials for your service account.

6. Copy the content of the JSON file that was downloaded
7. Create a `service-account.json` file in the root of the server and paste the content of the JSON file inside it

### Add bucket to .env

Add name of the bucket inside the `.env` file in the root of the server

    GCLOUD_STORAGE_BUCKET=YOUR_BUCKET_NAME

Firebase Integration Google Maps Integration