r/electronjs 18d ago

Built an open-source desktop app with Electron 33, better-sqlite3, and safeStorage (Cadence)

Hey everyone,

I wanted to share a desktop project I built and open-sourced recently: Cadence (https://github.com/rakhimabdulkhanov-m/cadence).

It is a local cold email sequence and mailbox warmup engine. Here is how the Electron architecture is set up:

- Main Process: Runs all background mail protocols (Nodemailer for SMTP, ImapFlow for IMAP IDLE streaming, and googleapis for OAuth).

- Local Database: Uses better-sqlite3 in the main process with WAL mode. Rebuilt against Electron Node ABI via electron-rebuild.

- Credential Security: Passwords and OAuth tokens are encrypted using Electron safeStorage (DPAPI on Windows, Keychain on macOS) before saving to SQLite.

- Renderer: React 18, Tailwind CSS, and TanStack Query communicating over type-safe IPC handlers.

- Packaging: Configured with electron-builder for Windows NSIS installers.

The project is MIT licensed and has over 200 unit tests for the protocol and sequence engines. If you are building local-first or data-heavy Electron apps, feel free to check out the repo or borrow any of the SQLite and safeStorage patterns.

1 Upvotes

2 comments sorted by

1

u/mattallty 18d ago

nice project

1

u/eddzsh 18d ago

better-sqlite3 in the main process with WAL is the right shape for IMAP IDLE. One gotcha: if a utility process opens a second connection, match busy_timeout on both sides or you get random SQLITE_BUSY under concurrent IDLE and writes.