Architecture
Architecture Overview
Clean architecture with strict separation of concerns — monorepo structure, package dependencies, and data flow
Architecture Overview
Dripnex is a desktop-first note app. The marketing site is a separate surface. Sync is optional and end-to-end encrypted.
Monorepo Structure
+ ai-core, mcp-server, plugin-cli, …
The product is apps/desktop. apps/web does not read notes. packages/api never sees plaintext markdown.
Key Boundaries
Core
Pure domain logic. No Electron/React. Testable in Node.js.
Storage
Ports in storage-core. SQLite adapter. Live sync is desktop SyncService.
Editor
CodeMirror 6 configuration and extension system.
IPC
Typed IPC channels between main and renderer processes.
Data Flow
Renderer (React + TanStack Query + Zustand)
↓ window.dripnex.*
Preload (contextIsolation)
↓ ipcRenderer.invoke (Zod at the boundary)
Main handlers
↓ @dripnex/core operations
SQLiteNoteRepository
↓
SQLite (better-sqlite3) + optional SyncService → api.dripnex.app (ciphertext)Plugins run in the renderer. They receive a controlled PluginContext. They do not get raw SQL or Node fs.
Security Model
| Rule | Reality |
|---|---|
No nodeIntegration | Renderer cannot require Node. |
contextIsolation | Only window.dripnex is exposed. |
No executeSQL | Renderer never sees SQL. |
| Typed IPC | defineIpcHandler + Zod on main. |
| Plugins | Trusted, not sandboxed. new Function() in the renderer. Only load what the user installed. |
| Sync | AES-256-GCM client-side. The Worker stores blobs. |
Technology Stack
| Layer | Technology |
|---|---|
| Runtime | Electron |
| Build | electron-vite |
| Database | SQLite (better-sqlite3) |
| Editor | CodeMirror 6 |
| UI state | TanStack Query + Zustand |
| Styling | CSS modules + tokens (no Tailwind on desktop) |
| Sync | Desktop SyncService → Cloudflare Worker (api.dripnex.app) |
| Monorepo | pnpm + turborepo |