Tauri Configuration
Relevant source files
The following files were used as context for generating this wiki page:
Augenblick is built using the Tauri v2 framework, which facilitates a secure bridge between a Rust-based backend and a React-based frontend. The configuration manages window behavior, security policies, build pipelines, and system-level permissions required for note persistence and native OS integration.
The system is designed with a "vibe-coded" architecture, prioritizing a temporary-by-default note-taking experience while maintaining standard desktop application expectations like window state persistence and file system access.
Sources: plans/migration.md:1-15, src-tauri/tauri.conf.json:1-5
Core Application Identity
The application identity is defined in the primary configuration file, ensuring consistency across the executable, bundle, and data directories.
| Field | Value | Description |
|---|---|---|
productName | Augenblick | The display name of the application. |
version | 0.1.6 | Current semantic version. |
identifier | com.sunstory.augenblick | Unique bundle identifier used for OS settings and data paths. |
Sources: src-tauri/tauri.conf.json:3-6
Window and UI Customization
Augenblick utilizes a customized window appearance to provide a modern "Overlay" feel. This is achieved by hiding the standard title bar and creating a custom drag region within the frontend.
Window Configuration
The main window is configured with specific flags to support its unique UI layout:
- Title Bar Style: Set to
OverlaywithhiddenTitleenabled to allow the webview to occupy the entire window area. - Drag and Drop: Explicitly disabled (
dragDropEnabled: false) to manage file imports through thenote_import_filecommand instead. - Dimensions: Default size is 800x600 pixels.
Sources: src-tauri/tauri.conf.json:15-22, plans/migration.inventory.md:195-200
Native UI Interaction Flow
The frontend implements a custom title bar drag region that communicates with the Tauri core to manage window movement and maximization.
This diagram illustrates the logic for the custom drag region defined in the CSS and window management handlers.
Sources: plans/migration.inventory.md:200-210, src/App.css:168-176
Security and Permissions
Tauri v2 uses a capability-based security model. Permissions are explicitly granted to the frontend to interact with specific system features.
Content Security Policy (CSP)
The app employs a CSP that restricts source origins while allowing internal IPC communication and necessary developer tools.
"csp": "default-src 'self' asset:; img-src 'self' asset: data: blob: https:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; connect-src 'self' ipc: http://ipc.localhost https://ipc.localhost http://localhost:1420 ws://localhost:1420; font-src 'self' data:; object-src 'none'; base-uri 'none';"
Sources: src-tauri/tauri.conf.json:25
Capability Scopes
Permissions are divided into default and platform-specific capabilities.
| Capability Group | Enabled Permissions | Source File |
|---|---|---|
| Default | core:default, core:window:allow-start-dragging, core:window:allow-toggle-maximize, dialog:default, opener:default | plans/migration.inventory.md:225-231 |
| Desktop | window-state:default | plans/migration.inventory.md:232-234 |
Backend Dependencies and Features
The Rust backend is configured via Cargo.toml, integrating various Tauri plugins and system-level libraries for functionality like SQLite storage and macOS security-scoped bookmarks.
[dependencies]
tauri = { version = "2", features = ["devtools", "tray-icon", "image-png"] }
tauri-plugin-dialog = "2"
tauri-plugin-opener = "2"
tauri-plugin-updater = "2"
rusqlite = { version = "0.31", features = ["bundled"] }
tauri-plugin-window-state = "2"
Sources: src-tauri/Cargo.toml:17-27
Platform-Specific Logic (macOS)
On macOS, the app includes objc2 and objc2-foundation to handle security-scoped bookmarks. This allows the app to retain access to files saved outside its sandbox (e.g., user-selected .md files) across restarts.
Sources: src-tauri/Cargo.toml:29-32, plans/migration.inventory.md:255-265
Build Pipeline Integration
The build process links the Vite development server with the Tauri environment.
Vite and Tauri Dev Server
The configuration ensures that Vite ignores the src-tauri directory during hot-module replacement (HMR) to prevent unnecessary reloads when Rust code changes.
Sources: vite.config.ts:25-50, src-tauri/tauri.conf.json:7-12
Rollup Manual Chunks
To optimize loading times, large dependencies are split into specific chunks in vite.config.ts:
- prosemirror: Contains Tiptap and ProseMirror core logic.
- tiptap: Contains Tiptap extensions.
- markdown: Contains markdown parsing libraries.
Sources: vite.config.ts:28-36
Summary
The Tauri configuration for Augenblick establishes a robust desktop environment that balances modern web development (React/Vite) with native performance and security. By leveraging Tauri v2 plugins and a granular capability model, the application provides a seamless, "overlay" style experience while ensuring user data is safely managed through scoped file access and persistent window states.