Architecture
Architecture Overview
Clean architecture with strict separation of concerns — monorepo structure, package dependencies, and data flow
Architecture Overview
Readied follows a clean architecture with strict separation of concerns.
Monorepo Structure
+ 11 more packages
16 packages organized by domain responsibility.
Key Boundaries
Core
Pure domain logic. No Electron/React. Testable in Node.js.
Storage
Database adapter interfaces, migrations, backup/export/import.
Editor
CodeMirror 6 configuration and extension system.
IPC
Typed IPC channels between main and renderer processes.
Data Flow
┌──────────────────────────────────────────────────────────────────┐
│ Renderer Process │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
│ │ React UI │->│ TanStack │->│ Zustand │->│ Preload │ │
│ │ │ │ Query │ │ Stores │ │ Bridge │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────┬───────┘ │
└───────────────────────────────────────────────────┼─────────────┘
│ IPC
┌───────────────────────────────────────────────────┼─────────────┐
│ Main Process │ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌─────┴───────┐ │
│ │ SQLite │<-│ Core │<-│ Plugin │<-│ IPC │ │
│ │ (better │ │Operations│ │ System │ │ Handlers │ │
│ │ -sqlite3)│ │ │ │ │ │ │ │
│ └──────────┘ └──────────┘ └──────────┘ └─────────────┘ │
│ │ │
│ ┌─────┴───────┐ │
│ │ Sync Core │ │
│ │ (Supabase) │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘Security Model
| Rule | Description |
|---|---|
| No nodeIntegration | Renderer is sandboxed |
| IPC whitelist | Typed channels only |
| No executeSQL | No raw SQL in renderer |
| Preload minimal | Only necessary APIs exposed |
| Plugin sandbox | Plugins run in isolated context |
Technology Stack
| Layer | Technology |
|---|---|
| Runtime | Electron |
| Build | electron-vite |
| Database | SQLite (better-sqlite3) |
| Editor | CodeMirror 6 |
| UI State | TanStack Query + Zustand |
| Styling | CSS Modules + CSS custom properties |
| Sync | Supabase (via sync-core) |
| Monorepo | pnpm + turborepo |