You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our tech stack is Electron (main process) + better-sqlite3 + Next.js.
Right now we can trigger backups, but users need a way to track past backups and see them in the UI (similar to Time Machine or Windows Backup), and easily restore from them without needing to manually locate the file on disk.
Requirements
Backend Discovery:
In the backend (main process), create a utility to scan the backups/ directory (located in app.getPath('userData')) for .db files.
Parse their creation dates using fs.stat or by parsing the timestamp embedded in the filename (e.g., flo-backup-2026-07-18T16-19-03.db).
API Endpoint:
Expose a new API endpoint GET /api/db-tools/backups that returns a sorted list (newest first) of these backups with their dates, absolute paths, and file sizes.
Frontend UI:
In the Next.js frontend Settings page (likely under a new Backup/Restore section or inside Database Tools), create a table or list view showing the backup history.
Restore Flow:
Add a "Restore" button next to each backup.
Clicking restore should prompt the owner for the Master PIN.
Trigger the existing restore flow using the selected backup's file path.
Security & Best Practices
The endpoint must be protected and only accessible by the owner role.
Restore actions are highly destructive and must continue to require the Master PIN.
Ensure the backup scanning ignores non-sqlite files to prevent unexpected crashes.
A note for this issue's implementation: Currently, when clicking 'Create Backup' in the UI, the API auto-saves the .db file directly into the default backups/ folder inside app.getPath('userData').
While the native Electron menu (File -> Export Backup) allows the user to define the location via a save dialog (createBackup(targetPath)), the UI endpoint does not.
Decision Needed for this Issue:
Should the new Backup UI allow users to define a custom path when creating a backup, or should all UI-triggered backups forcefully go to the default backups/ directory to ensure they appear in the proposed 'Backup History' table?
This was already fully implemented in f7e399e (feat(settings): Backup Management & History UI) — backend scan of backups/ via listBackups(), owner-gated GET /api/db-tools/backups, frontend Backup History table, and a Master-PIN-gated restore flow (handleRestoreFromHistory → restore-backup IPC → authorizeMasterPin). Covered by tests/database-tools-api.test.ts, part of the full npm test suite. Just never got closed on GitHub. Closing now — no new work needed.
Activity
fix(settings): fix JSON database export auth and backup toast
khaira777 commentedon Jul 18, 2026
Scope Clarification: Custom Backup Paths
A note for this issue's implementation: Currently, when clicking 'Create Backup' in the UI, the API auto-saves the
.dbfile directly into the defaultbackups/folder insideapp.getPath('userData').While the native Electron menu (File -> Export Backup) allows the user to define the location via a save dialog (
createBackup(targetPath)), the UI endpoint does not.Decision Needed for this Issue:
Should the new Backup UI allow users to define a custom path when creating a backup, or should all UI-triggered backups forcefully go to the default
backups/directory to ensure they appear in the proposed 'Backup History' table?feat(settings): Backup Management & History UI (#120)
Add Google Drive integration for automated DB backups (FreeOpenSource…
itsbkm commentedon Jul 21, 2026
This was already fully implemented in f7e399e (feat(settings): Backup Management & History UI) — backend scan of
backups/vialistBackups(), owner-gatedGET /api/db-tools/backups, frontend Backup History table, and a Master-PIN-gated restore flow (handleRestoreFromHistory→restore-backupIPC →authorizeMasterPin). Covered bytests/database-tools-api.test.ts, part of the fullnpm testsuite. Just never got closed on GitHub. Closing now — no new work needed.Fix dead Check for Updates button, consolidate RevFlo, fix misleading…
docs: refresh README against current Electron/roadmap/feature state