Back to Blog
Desktop Apps · 13 min read

Desktop Apps: When the Cloud Isn't Enough

CadencesLab, Audio Hub and WhatsApp Agent — why desktop still matters in the cloud era and how we build offline-first applications with Electron, IndexedDB and smart Google Drive syncing.

Gonzalo Monzón

Gonzalo Monzón

· Founder & CTO

Desktop application development
Electron Offline-First IndexedDB

There's a widespread idea in the tech industry: "everything should be SaaS". And to some extent, that's true. But after building enterprise software for years, we've learned something Silicon Valley startups don't want to hear: sometimes you need a desktop app.

When does desktop matter? When you need offline access, local performance, unlimited storage, deep OS integration, or simply when your user doesn't want to open yet another browser tab. Cadences has 3 desktop applications in production and all of them exist for very specific technical reasons.

Fundamentals

Why Electron? The Real Trade-off

Yes, we know the criticisms: "Electron uses too much RAM", "it's just Chrome wrapped up". But the decision was pragmatic. Here's the real analysis:

Criteria Electron Tauri / Native
UI code reuse100% React + TailwindPartial / Rewrite
Development timeWeeksMonths
Binary size~150 MB~10 MB
RAM usage~200-400 MB~50-100 MB
Node.js ecosystemFull accessLimited to Rust
Playwright/PuppeteerNativeUnavailable
Cross-platformWin/Mac/LinuxWin/Mac/Linux

For us, the key was code reuse. CadencesLab shares 100% of its React UI with the web version. Audio Hub needs Node.js APIs for audio processing. WhatsApp Agent needs Playwright for browser automation. In all three cases, Electron was the natural choice.

Main App

CadencesLab: The App That Works Without Internet

CadencesLab is the desktop application version of the Cadences platform. Everything you can do on cadences.app you can do in CadencesLab — but with two superpowers: it works offline and syncs with Google Drive.

💾

Local Storage

All your data in IndexedDB. Projects, tasks, contacts, documents — everything available without internet.

☁️

Google Drive Sync

Automatic sync with Google Drive. Your data is compressed and uploaded as a JSON file. Works as backup + cross-device sync.

🔄

Sync Queue

Offline operations are automatically queued. When connection returns, they're processed in order with automatic retry and conflict resolution.

🖥️

System Tray

CadencesLab minimizes to the system tray. Always accessible with a single click, without taking up taskbar space.

Architecture

Offline-First: The Data Architecture

The offline-first concept means the app is designed to work without a connection as the default state, not as a fallback. Data is stored locally in IndexedDB and optionally synced with the cloud.

Offline-first persistence flow
// 1. User creates a task (always saved locally first)
const task = { title: "Review proposal", project: "acme-corp" };

// 2. Saved to IndexedDB immediately
await saveToIndexedDB('tasks', task);

// 3. If online, upload to backend
if (navigator.onLine) {
  await api.createTask(task);
} else {
  // 4. If offline, queue for later
  await addToQueue({
    type: 'CREATE_TASK',
    payload: task,
    timestamp: Date.now()
  });
}

// 5. When connection returns...
window.addEventListener('online', async () => {
  await processQueue(); // Process all pending operations
});
Synchronization

Google Drive as Personal Backend

Instead of a centralized backend for storage, CadencesLab uses Google Drive as a persistence layer. Data is serialized, compressed and uploaded as a JSON file to the user's appDataFolder. This means:

🔐

Privacy by design

Your data lives in your own Google Drive, not on our servers. You control access and retention.

💰

Zero infrastructure cost

Google Drive offers 15 GB free. Compressed Cadences data typically weighs less than 5 MB. Enough for years of use.

🔄

Cross-device sync

The same Drive file is read from any CadencesLab instance. Edit on your work PC, continue on your home laptop.

Adaptive sync with Google Drive
// Auto-compress before uploading
const data = await getAllDataFromIndexedDB();
const compressed = compressDriveData(data);

// File saved in appDataFolder (invisible to user)
await gapi.client.drive.files.update({
  fileId: existingFileId,
  media: {
    mimeType: 'application/json',
    body: JSON.stringify(compressed)
  }
});

// Adaptive debounce: doesn't upload on every change
const syncDebounce = new AdaptiveDebounce({
  minDelay: 5000,    // Minimum 5 seconds
  maxDelay: 60000,   // Maximum 1 minute
  backoff: 1.5       // Increment factor
});
Audio Hub

Audio Hub: AI-Powered Audio Production

Audio Hub is an Electron desktop application specialized in AI audio content generation and management. Connected to the same ElevenLabs infrastructure used by the Conversational Voice AI system, but oriented towards content production:

🎙️

Text-to-Speech

Generate high-quality audio from text. Multiple neural voices with speed, pitch and emotion control.

🎨

Voice Cloning

Clone any voice with audio samples. Ideal for maintaining brand consistency in narrated content.

📦

Batch Processing

Generate hundreds of audio files in batch. Ideal for catalogs, audio guides, IVR and educational content.

Feature Description Technology
Neural TTSHigh-quality text-to-speech generationElevenLabs API v2
Voice CloningClone voices with 30s of samplesElevenLabs Instant Clone
Batch ExportMass audio file generationQueue with rate limiting
Audio PreviewPreview before exportingWeb Audio API + IndexedDB
Voice CatalogBrowse and test available voicesElevenLabs Voice Library
Multi-format ExportMP3, WAV, OGG, PCMFFmpeg + Node.js Streams
Automation

WhatsApp Agent: Local Automation

WhatsApp Agent is the most unconventional app in the ecosystem. It's a local automation agent that uses Playwright to interact with WhatsApp Web, all from an Electron interface with a Fastify backend:

1

Persistent session

Scan the QR once. The WhatsApp Web session is saved to disk and reused on every start. No need to re-authenticate.

2

Playwright automation

Playwright with stealth plugins controls a headless Chromium. Sending messages, reading conversations, managing groups — all automated without official APIs.

3

Real-time WebSocket

The Electron interface communicates with the Fastify backend via WebSocket. Real-time updates on message status, sessions and queues.

4

Local database

SQL.js (SQLite compiled to WebAssembly) as local database. Message history, contacts and configurations — all in a zero-dependency file.

electron/main.js — WhatsApp Agent Architecture
// Main process configuration
const SERVER_PORT = 3600;
const APP_NAME = 'WhatsApp Agent';

// Persistent data directories
const userDataPath = app.getPath('userData');
const sessionsPath = join(userDataPath, 'sessions');  // QR sessions
const dataPath = join(userDataPath, 'data');         // SQLite DB

// Electron creates window and starts Fastify in parallel
app.whenReady().then(async () => {
  await startServer();     // Fastify backend on port 3600
  createWindow();          // BrowserWindow pointing to localhost:3600
  createTray();            // System tray icon
});
DevOps

Build & Distribution

Building Electron apps for production has its own challenges. Here's our pipeline:

Phase Tool Output
Bundle UIVite + React/dist/ static files
Packageelectron-builder.exe / .dmg / .AppImage
Code signingWindows AuthenticodeEV Certificate
Auto-updateelectron-updaterDifferential download
Portableelectron-builder --portable.exe no install
Security

Desktop App Security

Electron apps are essentially a web browser with filesystem access. That requires a rigorous security approach:

🔒 Context Isolation

The renderer process has no direct access to Node.js. All communication goes through a controlled preload script with contextIsolation: true.

🛡️ IPC Bridge

The preload exposes a minimal API via contextBridge.exposeInMainWorld(). Only explicitly defined functions are accessible.

📄 Strict CSP

Content Security Policy that blocks inline scripts, unauthorized external sources and communications with unlisted domains.

🔑 Secure OAuth

Google authentication uses the full OAuth 2.0 flow with PKCE. The token is stored in encrypted IndexedDB, not in localStorage.

Overview

The Three Apps Compared

CadencesLab Audio Hub WhatsApp Agent
PurposePlatform offlineAI audio productionWA automation
BackendGoogle DriveElevenLabs APIFastify local
DBIndexedDBIndexedDBsql.js (SQLite)
OfflineFullPartialInternet req.
SpecialGoogle syncFFmpeg + TTSPlaywright

Want to explore Cadences?

Try CadencesLab, Audio Hub or the complete Cadences web platform. One ecosystem — cloud when you want it, local when you need it.

Get Started
Summary

Conclusion

Desktop apps aren't an anachronism — they're a strategic tool. When you need local performance, offline access, deep OS integration, or simply a user experience that doesn't depend on your internet speed, Electron remains the best choice for teams already working with React and Node.js.

CadencesLab proves you can have an offline-first app with smart synchronization. Audio Hub proves that AI audio processing requires local filesystem access. And WhatsApp Agent proves that some automations are only possible from the desktop.

The best platform is one that doesn't force you to choose between the cloud and your hard drive.