Drive Fusion supports live Google OAuth account connection and post-login Drive sync so users can pull real quota and file metadata into the unified dashboard. The repository documents this flow using GET /auth/login?user_id=<account_id>, GET /auth/callback, and POST /api/accounts/{account_id}/sync. [page:1]
This guide explains that flow step by step for end users and maintainers.
This guide covers how to:
- add an account in Drive Fusion,
- start Google sign-in for that account,
- complete the consent screen,
- return to Drive Fusion successfully,
- run the sync endpoint,
- verify that the account now shows live quota and indexed files. [page:1]
Before you start, make sure the following are already done:
- The repository has been cloned locally. [page:1]
- A Python virtual environment has been created and activated. [page:1]
- Dependencies from
requirements.txtare installed. [page:1] .env.examplehas been copied to.envand Google OAuth variables have been filled in. [page:1]- The Google Drive API is enabled in your Google Cloud project. [web:66]
- The OAuth consent screen is configured. [web:61][web:67]
- If the app is still in testing mode, the Google account you want to sign in with has been added as a test user. [web:65]
From the repository root, start the app with the same Python environment where your dependencies are installed. The repository documents uvicorn drive_fusion.api.app:app --reload as the GUI launch command. [page:1]
Recommended command:
python -m uvicorn drive_fusion.api.app:app --reloadThen open the dashboard in your browser:
http://127.0.0.1:8000/
If you get ModuleNotFoundError: No module named 'fastapi', you are probably running Uvicorn outside your virtual environment. The repo’s installation instructions require creating a virtual environment, activating it, and installing requirements.txt first. [page:1]
The login route requires the id of an account that already exists in Drive Fusion. The repository states that /auth/login?user_id= must use the id of an account already added through the CLI or GUI. [page:1]
You can create or inspect accounts in two ways.
List existing accounts:
python -m drive_fusion.cli accountsAdd a new account if needed:
python -m drive_fusion.cli connect "Work" work@example.com --total-gb 25The CLI output includes the account id, which is the value you need for the login URL. The repository documents drive_fusion.cli as the command-line interface entry point and includes accounts and connect commands in the README. [page:1]
Open the dashboard and add an account using the connected accounts form. The repository says the GUI includes a connected accounts table and a form to add new accounts. [page:1]
After adding the account, note the generated account id. That id is required in the OAuth login URL. [page:1]
Before starting Google sign-in, identify the exact account_id. This is usually a value such as:
acct-primary
or
acct-work
Do not use the label or email unless the app explicitly says those are the same value. The login flow uses the actual account id in the query string. [page:1]
Open the following URL in your browser, replacing <account_id> with the real account id from Drive Fusion. The repository documents GET /auth/login as the route that starts the Google OAuth flow for ?user_id=. [page:1]
Example:
http://127.0.0.1:8000/auth/login?user_id=acct-work
What happens next:
- Drive Fusion starts the Google OAuth flow. [page:1]
- Google shows the account-selection and consent screen. [page:1]
- You select the Google account you want to connect.
- You review and approve the permissions requested by Drive Fusion.
- Google redirects you back to Drive Fusion at
/auth/callback. [page:1]
During sign-in, Google will show a consent screen that identifies the app and the data access being requested. Google documents this as part of the OAuth consent flow configured under the Google Auth platform. [web:61][web:67]
What to do:
- Choose the intended Google account.
- Review the requested permissions.
- Click Continue or Allow.
- Wait for Google to redirect you back to the app.
If the app is in testing mode and your email is not listed as a test user, Google may block access. Google’s OAuth setup requires test users for apps that are not yet fully published. [web:65]
After you approve access, Google redirects back to Drive Fusion’s callback route. The repository documents GET /auth/callback as the Google OAuth redirect target. [page:1]
A successful callback usually means:
- Drive Fusion exchanged the OAuth code for tokens,
- the tokens were stored for that account,
- the account is now authenticated for Drive API actions. [page:1]
If the browser returns to the app without an error, proceed to the sync step.
Connecting the account only completes OAuth. To actually pull live Google Drive data into Drive Fusion, the repository instructs you to call POST /api/accounts/{account_id}/sync. [page:1]
Example using curl:
curl -X POST http://127.0.0.1:8000/api/accounts/acct-work/syncReplace acct-work with the real account id.
What this sync does:
- requests live quota information from the Google Drive API,
- reads file metadata for the connected account,
- updates Drive Fusion’s per-account and aggregate views,
- refreshes the unified index with the latest metadata. [page:1]
The repository explicitly describes this endpoint as “Pull live quota + files for one account.” [page:1]
Once the sync request finishes, confirm that Drive Fusion now reflects live data. The repository describes the dashboard as showing usage totals, connected accounts, transfer jobs, and a unified file index. [page:1]
Check any of the following:
Refresh the GUI and confirm:
- quota values changed from placeholder values to live values,
- the account shows updated used/free storage,
- files from that account appear in the unified file index. [page:1]
Use these endpoints:
curl http://127.0.0.1:8000/api/accounts
curl http://127.0.0.1:8000/api/quota
curl http://127.0.0.1:8000/api/filesThe repository documents these endpoints in its API reference. [page:1]
If multiple accounts are connected, you can also use the sync-all route documented in the repo:
curl -X POST http://127.0.0.1:8000/api/syncThis syncs all connected accounts instead of only one. [page:1]
Here is the full flow from start to finish.
python -m uvicorn drive_fusion.api.app:app --reloadpython -m drive_fusion.cli accounts[
{
"id": "acct-work",
"label": "Work",
"email": "work@example.com"
}
]http://127.0.0.1:8000/auth/login?user_id=acct-work
You approve the app and Google redirects back to Drive Fusion. [page:1]
curl -X POST http://127.0.0.1:8000/api/accounts/acct-work/synccurl http://127.0.0.1:8000/api/quotacurl http://127.0.0.1:8000/api/filesAt this point, the connected account should be fully visible in the Drive Fusion dashboard and APIs. [page:1]
Cause: The redirect URI configured in Google Cloud does not exactly match the URI Drive Fusion is using.
Fix:
- Compare the redirect URI in
.envwith the OAuth client’s configured redirect URI. - Match scheme, hostname, port, and path exactly.
- If the app uses
127.0.0.1, do not register onlylocalhost, and vice versa. Google’s OAuth client configuration requires exact redirect URI matches. [web:60]
Cause: The OAuth app is in testing mode and the user is not listed as a test user.
Fix:
- Open the Google Auth platform settings.
- Add the user email as a test user.
- Retry the login flow. Google’s testing-mode OAuth flow requires authorized test users. [web:65]
Cause: The Drive API may not be enabled, the scopes may be insufficient, or the token may not have the permissions the sync operation needs.
Fix:
- Confirm Google Drive API is enabled. [web:66]
- Confirm your scopes match what the app requests. Google documents
drive.metadata.readonlyas the metadata scope for viewing file metadata without file content access. [web:59][web:62][web:68] - Reconnect the account after changing scopes.
Cause: The browser session may have selected a different signed-in Google account.
Fix:
- Sign out of the unintended Google account in the browser, or
- use an incognito/private window and sign in only with the intended account.
Cause:
The user_id in the URL does not match a valid stored account id.
Fix:
- Run
python -m drive_fusion.cli accountsagain. - Copy the exact
idvalue. - Retry the URL with that id. [page:1]
The current README sentence can be expanded into clearer end-user instructions.
Suggested replacement:
- Add an account in the CLI or GUI and note its
id. [page:1] - Open
http://127.0.0.1:8000/auth/login?user_id=<account_id>in your browser. [page:1] - Sign in to Google and approve the Drive Fusion consent screen. [page:1]
- After you return to the app, sync the account:
curl -X POST http://127.0.0.1:8000/api/accounts/<account_id>/sync- Refresh the dashboard or call
/api/quotaand/api/filesto verify that live quota and metadata were imported. [page:1]
This guide should be linked from README.md, RUNNING.md, and any future Settings or Setup page in the GUI. The repository already has a growing setup surface and live OAuth support, so a dedicated guide reduces onboarding friction and makes troubleshooting much easier. [page:1]