Architecture Overview
Inkdown is a modern, cross-platform markdown note-taking application built with Tauri v2, React 19, and TypeScript. It follows a modular monorepo architecture with a platform-agnostic core and platform-specific adapters, enabling true cross-platform compatibility across Desktop, Web, and potentially Mobile platforms.High-Level Architecture
The application is organized as a Bun monorepo with the following structure:- Apps Layer (
apps/): Platform-specific entry points. Currently includes the Desktop app using Tauri. - Core Layer (
packages/core/): Platform-agnostic business logic, state management, managers, and Plugin API. - UI Layer (
packages/ui/): Shared React component library for design consistency. - Plugins Layer (
packages/plugins/): Built-in plugins providing core functionality. - Platform Adapters:
- Editor Adapters:
@inkdown/editor-codemirror(with future support for React Native editors) - Native Adapters:
@inkdown/native-tauri(with future support for Web and React Native) - Storage Adapters:
@inkdown/storage-tauri
- Editor Adapters:
Core System (@inkdown/core)
The Core package is the foundation of Inkdown. It exposes the main App class and various Managers that handle specific domains.
Key Managers
| Manager | Description |
|---|---|
| App | Central hub that initializes all managers and coordinates the application lifecycle |
| Plugins | Unified facade for built-in and community plugin access via app.plugins |
| Workspace | Manages file operations (CRUD) and file events. Acts as the “Vault” |
| WorkspaceUI | Manages UI state including tabs, views, and active file |
| PluginManager | Handles built-in plugin loading, enabling, and disabling |
| CommunityPluginManager | Handles community plugin discovery, installation, and updates from GitHub |
| ConfigManager | Persistent configuration storage (JSON files in app config directory) |
| ThemeManager | Theme loading, switching, and CSS injection for built-in themes |
| CommunityThemeManager | Community theme browsing, installation, and management from GitHub |
| FileSystemManager | Bridge to the Rust backend for file system operations |
| EditorRegistry | Manages CodeMirror editor instances and provides access to active editor |
| EditorStateManager | Manages content of open files, dirty states, and auto-saving |
| TabManager | Handles tab management, restoration, and persistence |
| CommandManager | Central registry for all commands (plugin and built-in) |
| MetadataCache | Caches file metadata and frontmatter for quick access |
| SyncManager | Handles workspace synchronization |
| BookmarkManager | Manages bookmarked files |
| FontManager | System font discovery and management |
Initialization Flow
Data Flow
Class Diagram
Technology Stack
| Component | Technology |
|---|---|
| Desktop Framework | Tauri v2 (Rust backend) |
| Frontend | React 19 + TypeScript |
| Editor | CodeMirror 6 |
| Styling | CSS Variables (no Tailwind) |
| Package Manager | Bun |
| Build Tool | Vite |
| Linting | Biome |
Cross-Platform Architecture
Inkdown achieves cross-platform compatibility through the Bridge Pattern and Dependency Injection:- Platform-Agnostic Core: All business logic is implemented without platform dependencies
- Abstract Interfaces: Platform features (file system, editor, storage) are accessed through interfaces
- Platform Providers: Each platform implements these interfaces (Tauri, Web, React Native)
- Runtime Registration: Platform providers are registered at app startup
Related Documentation
- App and Managers - App class and all managers
- Editor System - Editor architecture and CodeMirror integration
- Theme System - Theme management and customization
- Config System - Configuration persistence and management
- UI System - Cross-platform UI abstractions
