Professional Architecture

WP Monitor

        │

Storage Interface

        │

Google Drive Adapter

        │

Google Drive API

        │

Customer Google Drive

Step 1: Create a Google Cloud Project

  1. Go to the Google Cloud Console.
  2. Create a new project.
  3. Enable the Google Drive API.

Step 2: Configure OAuth

Create an OAuth 2.0 Client ID.

You’ll receive:

  • Client ID
  • Client Secret

Step 3: Redirect User

When the customer clicks:

Connect Google Drive

Redirect them to Google’s OAuth consent page.

WP Monitor

↓

Google Login

↓

Allow Access

↓

Google redirects back

↓

Authorization Code

Step 4: Exchange Authorization Code

Exchange the code for:

  • Access Token
  • Refresh Token

Store the Refresh Token securely in your database.


Step 5: Upload Files

Use the Drive API to:

Create Folder

↓

WPMonitor

↓

site_123

↓

backup_2026_07_21

↓

chunk0001

chunk0002

manifest.json

Step 6: Restore

When restoring:

Read manifest

↓

Download chunk0001

↓

Download chunk0002

↓

Merge

↓

Restore

Database

You’ll usually store something like:

user_id

provider

google_drive

refresh_token

folder_id

connected_at

You generally do not keep asking the user to log in because you use the stored refresh token to obtain new access tokens as needed.


Storage Interface

Your existing abstraction might look like:

class StorageProvider:

    upload_chunk()

    download_chunk()

    delete_chunk()

    list_chunks()

    generate_download_url()

Then implement:

WasabiStorage

BackblazeStorage

GoogleDriveStorage

DropboxStorage

OneDriveStorage

The backup engine calls the same interface regardless of the provider.


Drawbacks

Google Drive is not object storage.

Compared with Wasabi:

❌ No S3 API

❌ No presigned URLs

❌ OAuth complexity

❌ API quotas and rate limits

❌ Slower for very large numbers of chunks