|
1 | 1 | # Kromacut Native App (Tauri) |
2 | 2 |
|
3 | | -Kromacut can now be built as a native Mac application using Tauri, offering better performance than the web version. |
4 | | - |
5 | | -## Why Tauri? |
6 | | - |
7 | | -- **Smaller app size:** 2-3 MB vs 100+ MB with Electron |
8 | | -- **Better performance:** Uses native macOS WebKit instead of bundling Chromium |
9 | | -- **Lower memory usage:** More efficient resource utilization |
10 | | -- **Native integration:** Better macOS integration and feel |
| 3 | +Kromacut can be built as a native application for macOS, Windows, and Linux using Tauri. |
11 | 4 |
|
12 | 5 | ## Prerequisites |
13 | 6 |
|
14 | | -- **Rust:** Required for building native components |
| 7 | +- Rust |
15 | 8 | ```bash |
16 | 9 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
17 | 10 | source "$HOME/.cargo/env" |
18 | 11 | ``` |
19 | | - |
20 | | -- **Node.js:** Already required for the web version |
| 12 | +- Node.js |
21 | 13 |
|
22 | 14 | ## Development |
23 | 15 |
|
24 | | -Run the app in development mode: |
25 | | - |
26 | 16 | ```bash |
27 | 17 | npm run tauri:dev |
28 | 18 | ``` |
29 | 19 |
|
30 | | -This will: |
31 | | -1. Start the Vite dev server on port 5173 |
32 | | -2. Launch the native app window |
33 | | -3. Enable hot-reload for fast development |
34 | | - |
35 | | -## Building for Production |
36 | | - |
37 | | -Build the native Mac app: |
| 20 | +## Production Build |
38 | 21 |
|
39 | 22 | ```bash |
40 | 23 | npm run tauri:build |
41 | 24 | ``` |
42 | 25 |
|
43 | | -This creates two bundles: |
44 | | -1. **Kromacut.app** - Standard macOS application bundle |
45 | | - - Location: `src-tauri/target/release/bundle/macos/Kromacut.app` |
46 | | - - Double-click to run |
47 | | - |
48 | | -2. **Kromacut_0.1.0_aarch64.dmg** - DMG installer |
49 | | - - Location: `src-tauri/target/release/bundle/dmg/Kromacut_0.1.0_aarch64.dmg` |
50 | | - - Distributable installer for Apple Silicon Macs |
| 26 | +Build artifacts are created under `src-tauri/target/release/bundle/`. |
51 | 27 |
|
52 | 28 | ## Configuration |
53 | 29 |
|
54 | | -Key Tauri settings in [src-tauri/tauri.conf.json](src-tauri/tauri.conf.json): |
55 | | - |
56 | | -- **Window size:** 1400x900 (min: 1000x700) - optimized for the 2-pane layout |
57 | | -- **Bundle identifier:** `com.kromacut.lithophane` |
58 | | -- **Base path:** Automatically switches between `/` (Tauri) and `/Kromacut/` (GitHub Pages) |
59 | | - |
60 | | -## Performance Benefits |
61 | | - |
62 | | -The native app benefits from: |
63 | | -- **Direct GPU access** for Three.js rendering |
64 | | -- **Native file system** for faster image loading |
65 | | -- **No browser overhead** for better memory management |
66 | | -- **macOS optimization** for M1/M2 chip acceleration |
67 | | - |
68 | | -## Web vs Native |
69 | | - |
70 | | -Both versions are maintained: |
71 | | -- **Web (GitHub Pages):** `npm run build` → Deploy to https://zeroCoder1.github.io/Kromacut/ |
72 | | -- **Native (Tauri):** `npm run tauri:build` → Create Mac app bundle |
73 | | - |
74 | | -The codebase is shared; vite.config.ts automatically adapts the base path based on the build target. |
75 | | - |
76 | | -## Distribution |
77 | | - |
78 | | -### Local Distribution |
| 30 | +Main config file: `src-tauri/tauri.conf.json` |
79 | 31 |
|
80 | | -To share the app: |
81 | | -1. Use the `.dmg` file from `src-tauri/target/release/bundle/dmg/` |
82 | | -2. Recipients can drag Kromacut.app to their Applications folder |
83 | | -3. **Remove the quarantine attribute** (required for unsigned apps): |
84 | | - ```bash |
85 | | - sudo xattr -d com.apple.quarantine /Applications/Kromacut.app |
86 | | - ``` |
87 | | -4. Launch the app |
| 32 | +- Window defaults are set for Kromacut’s two-pane layout. |
| 33 | +- Bundle identifier is configured in the same file. |
88 | 34 |
|
89 | | -**If users see "Kromacut is damaged" error:** |
90 | | -This happens because the app isn't code-signed. The fix is to remove the quarantine flag that macOS adds to downloaded files: |
91 | | -```bash |
92 | | -sudo xattr -d com.apple.quarantine /Applications/Kromacut.app |
93 | | -``` |
94 | | -Enter your password when prompted. |
| 35 | +## Versioning and Release |
95 | 36 |
|
96 | | -### Automated Releases (GitHub) |
| 37 | +When releasing a new version: |
97 | 38 |
|
98 | | -The project includes a GitHub Action that automatically builds and releases the Mac app: |
| 39 | +1. Update `package.json` version. |
| 40 | +2. Update `src-tauri/tauri.conf.json` version. |
| 41 | +3. Commit and tag the release. |
99 | 42 |
|
100 | | -**To create a new release:** |
| 43 | +Example: |
101 | 44 |
|
102 | 45 | ```bash |
103 | | -# Update version in both files |
104 | | -# 1. package.json - "version": "0.2.0" |
105 | | -# 2. src-tauri/tauri.conf.json - "version": "0.2.0" |
106 | | - |
107 | | -# Commit the changes |
108 | 46 | git add package.json src-tauri/tauri.conf.json |
109 | | -git commit -m "Bump version to 0.2.0" |
110 | | - |
111 | | -# Create and push a version tag |
112 | | -git tag v0.2.0 |
| 47 | +git commit -m "Bump version to vX.Y.Z" |
| 48 | +git tag vX.Y.Z |
113 | 49 | git push origin main |
114 | | -git push origin v0.2.0 |
| 50 | +git push origin vX.Y.Z |
115 | 51 | ``` |
116 | 52 |
|
117 | | -The workflow will automatically: |
118 | | -1. Build for both Apple Silicon (M1/M2/M3) and Intel Macs |
119 | | -2. Create a GitHub release with the tag name |
120 | | -3. Upload both DMG files as release assets |
121 | | -4. Include installation instructions in the release notes |
122 | | - |
123 | | -**Manual trigger:** |
124 | | -You can also trigger the workflow manually from the Actions tab on GitHub. |
125 | | - |
126 | | -**Release artifacts:** |
127 | | -- `Kromacut_VERSION_aarch64.dmg` - Apple Silicon (M1/M2/M3) |
128 | | -- `Kromacut_VERSION_x86_64.dmg` - Intel Macs |
| 53 | +The GitHub Actions workflow will automatically build native applications for: |
| 54 | +- **macOS**: Apple Silicon (M1/M2/M3) and Intel |
| 55 | +- **Windows**: x64 installer |
| 56 | +- **Linux**: AppImage and .deb package |
129 | 57 |
|
130 | | -### Code Signing & Notarization (Future Enhancement) |
| 58 | +All artifacts are attached to the GitHub release. |
131 | 59 |
|
132 | | -Currently, the app is **ad-hoc signed** (configured with `signingIdentity: "-"` in tauri.conf.json). This allows the app to run but users must remove the quarantine attribute after downloading. |
| 60 | +## Distribution Notes |
133 | 61 |
|
134 | | -**To eliminate the quarantine requirement entirely**, you would need to: |
| 62 | +**macOS:** Unsigned builds require removing quarantine: |
135 | 63 |
|
136 | | -1. **Enroll in Apple Developer Program** ($99/year) |
137 | | - - Visit: https://developer.apple.com/programs/ |
138 | | - |
139 | | -2. **Obtain a Developer ID Application certificate** |
140 | | - - Issued through your Apple Developer account |
141 | | - - Allows distribution outside the Mac App Store |
142 | | - |
143 | | -3. **Configure Tauri with your signing identity** |
144 | | - ```json |
145 | | - "macOS": { |
146 | | - "signingIdentity": "Developer ID Application: Your Name (TEAM_ID)", |
147 | | - "entitlements": "path/to/entitlements.plist" |
148 | | - } |
149 | | - ``` |
150 | | - |
151 | | -4. **Notarize the app with Apple** |
152 | | - - Apple scans the app for malicious content |
153 | | - - Adds a "ticket" that tells Gatekeeper the app is safe |
154 | | - - Required for apps distributed outside the App Store as of macOS 10.15+ |
155 | | - |
156 | | -**Benefits of notarization:** |
157 | | -- ✅ No quarantine warnings for users |
158 | | -- ✅ No `xattr` command needed |
159 | | -- ✅ Professional distribution |
160 | | -- ✅ Users can simply double-click to install |
161 | | -- ✅ Better trust and user experience |
| 64 | +```bash |
| 65 | +sudo xattr -d com.apple.quarantine /Applications/Kromacut.app |
| 66 | +``` |
162 | 67 |
|
163 | | -**Current state (v2.1):** |
164 | | -- Ad-hoc signing is enabled |
165 | | -- Users must run: `sudo xattr -d com.apple.quarantine /Applications/Kromacut.app` |
166 | | -- This is acceptable for personal use and small-scale distribution |
| 68 | +For notarized distribution, configure a Developer ID signing identity in `tauri.conf.json`. |
167 | 69 |
|
168 | | -## Updating |
| 70 | +**Windows:** The `.msi` installer may trigger Windows SmartScreen for unsigned builds. Users can click "More info" → "Run anyway". |
169 | 71 |
|
170 | | -When the app version changes: |
171 | | -1. Update version in [package.json](package.json) |
172 | | -2. Update version in [src-tauri/tauri.conf.json](src-tauri/tauri.conf.json) |
173 | | -3. Rebuild: `npm run tauri:build` |
| 72 | +**Linux:** AppImage bundles are portable and require no installation. `.deb` packages integrate with the system package manager. |
0 commit comments