feat: Google Drive sync — OAuth, upload/download, conflict detection#48
Open
DipandaAser wants to merge 4 commits into
Open
feat: Google Drive sync — OAuth, upload/download, conflict detection#48DipandaAser wants to merge 4 commits into
DipandaAser wants to merge 4 commits into
Conversation
…ection - Google Identity Services (GIS) for client-side OAuth 2.0 implicit flow - DRIVE_APPDATA scope — files private to app, invisible to user - Upload source of truth to Google Drive after each library merge - Download latest backup from Drive on app load if remote is newer - Conflict detection: compare local vs remote modifiedTime - Conflict resolution dialog: keep local or keep remote - SyncSection component in Settings: connect/disconnect, sync now, status - Sync badge on Library source of truth card (synced/not synced) - Silent re-auth on return visits (token refresh via prompt:'') - Generic config helpers exported from storage.ts - 18 new i18n keys in EN and FR - GIS script loaded async in app.html - TypeScript declarations for google.accounts.oauth2 Closes #19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Google Drive cloud sync for the web app — fully client-side, no backend needed.
Architecture
<script>tagsource-of-truth.jwlibrary) + metadata sidecar (sync-meta.json) in appDataFolderFeatures
storedAtvs remotemodifiedTimeNew files
apps/web/src/lib/gdrive.ts— Core sync module (auth, upload, download, conflict)apps/web/src/lib/components/SyncSection.svelte— Sync UI for Settingsapps/web/src/lib/types/google.d.ts— TypeScript declarations for GISapps/web/.env.example— DocumentsPUBLIC_GOOGLE_CLIENT_IDSetup required
To test, you need a Google Cloud project with:
http://localhost:5173(dev) + production URLPUBLIC_GOOGLE_CLIENT_IDin.envCloses #19
Test plan
.envconfigured: sync section shows "Connect" button, clicking fails gracefullypnpm --filter @jw-notes-sync/web check— 0 errors🤖 Generated with Claude Code