r/EmpiricalPrecision • u/loath-engine • 20h ago
Guide / Worked Example Guide: How to enable Google Drive Sync (and why your data is never stored on empiricalprecision.com)
One of the biggest design goals of Empirical Precision is that you own your data—no EP account, no login, and no server storing a list of your firearms, load recipes, or range sessions.
By default, everything you enter lives only in your browser's local IndexedDB (so it works 100% offline at the range). If you want automatic cloud backup or multi-device sync between your phone at the range and your laptop at the bench, you can turn on Google Drive Sync—and your data still never touches empiricalprecision.com.
How to enable Google Drive Sync (3 steps)
(See Screenshot 1 above)
- Click DB Sync in the top navigation bar (or press
Ctrl+K/⌘Kand jump to DB Sync). In the Google Drive Sync (Your Data) card, click Sync with Google Drive.
- Google will ask you to sign in and approve access for Empirical Precision.
- Once approved, you're redirected straight back to DB Sync and your first sync runs automatically.
- Leave Automatic Refresh toggled ON (the default once connected) if you want background sync, or switch it OFF if you prefer syncing only when you click the button.
Repeat steps 1–2 on a second device (e.g., phone + desktop) using the same Google account, and both devices stay in step automatically.
How two-way sync actually works
- What gets synced: Your firearms (including lands/throat-wear logs and velocity offsets), load recipes, marked target photos, chronograph strings, saved sessions, Analysis queues, saved scenarios, and custom components.
- What is excluded: EP's read-only reference catalog—every device pulls that automatically from
db.empiricalprecision.comusing ETag caching, so it doesn't bloat your backup. Safe multi-device merge: Sync uses the exact same timestamp-based merge engine as Manual Backup File (PDBF):
- Downloads
empirical-precision-user-data.jsonfrom your DriveappDataFolder(if one exists). - Merges it into your local IndexedDB—newer edits win, deletions carry across cleanly, and loads still referenced by a saved session stay protected.
- Uploads the converged snapshot back to your Drive
appDataFolder.
- Downloads
- When Automatic Refresh syncs: On launch, when returning to the tab (at most every 30 seconds), every 2 minutes while the tab is open and online, when your device reconnects after being offline at the range, and ~5 seconds after local edits.
- Multi-device cleanup: If two offline devices edit and delete the same session/target before reconnecting, the Integrity & Reset tab (Screenshot 3) includes Reference Repair and Data Check to inspect and clean up any orphan rows.
- Disconnecting: Clicking Disconnect clears your local OAuth tokens on that device while leaving both your local browser data and the backup file in your Google Drive untouched. (Note: if you ever use Danger Zone → Delete All My Data, disconnect Google Drive first so your Drive backup doesn't restore everything on the next sync.)
Why your data is NEVER stored at empiricalprecision.com
(See Diagram 2 above)
- Static app hosting only:
empiricalprecision.comis static HTML/JS served from GitHub Pages. There are no user accounts and no EP database for personal records. - One-way catalog only:
db.empiricalprecision.comserves the read-only public component/load catalog. Nothing personal is uploaded to it. - Direct browser → Google Drive OAuth 2.0 PKCE: When you connect Drive, your browser authenticates via OAuth 2.0 Authorization Code flow with PKCE (
S256) directly againstaccounts.google.comandoauth2.googleapis.com, stores your tokens strictly in your own browser'slocalStorage, and reads/writes directly togoogleapis.com/drive/v3/files. No EP server sits in the middle. - Narrowest possible Google permission (
drive.appdata): The app requests only thehttps://www.googleapis.com/auth/drive.appdatascope. That restricts it to a single hidden app-data folder containingempirical-precision-user-data.json. Empirical Precision cannot see, list, read, edit, or delete any of your regular Google Drive files, Docs, Sheets, or Photos.
How to verify it yourself
Because the project is Apache 2.0 open source, you don't have to take our word for it:
- Read the sync code: Check
src/utils/googleDriveSync.tsin the GitHub repository (and the DB Sync section of the User Guide). - Watch the Network tab: Open browser DevTools (
F12) → Network while clicking Sync with Google Drive—you'll see sync traffic go solely to Google (oauth2.googleapis.com/googleapis.com), with zero personal uploads toempiricalprecision.comordb.empiricalprecision.com.
(Prefer zero cloud involvement altogether? Use Manual Backup File (PDBF) right underneath Google Drive Sync to export/import the exact same .json backup file locally, and install the Offline App (PWA) to request persistent browser storage.)
Questions or feedback on sync/backups? Drop them below!