DEV Community

Story of 'smoodit' (1) : Electron to Tauri

The author developed a desktop text editor named smoodit, aiming to boost editing efficiency with predictive text. Initially built with Electron and an embedded LLM via Ollama, the project faced resource bloat due to Electron and the LLM. To address this, a migration to Tauri v2 was undertaken, leveraging a React frontend with Vite and a Python FastAPI backend as a sidecar. The AI engine also ran as a separate Ollama binary sidecar. Key to the migration was mastering Tauri's "Sidecar" feature, which involved packaging the Python backend with PyInstaller and configuring external binaries in `tauri.conf.json`. Tauri v2 requires specific target triple suffixes for sidecar filenames. The frontend communicated with the local FastAPI backend using the `@tauri-apps/plugin-http` to bypass strict WebView security policies and CORS issues. A "Health Check Polling" mechanism was implemented to ensure the backend was ready before user interaction. Troubleshooting included addressing MacOS's "Quarantine" attribute on bundled binaries by stripping it with `xattr -d`. PIPE buffer hangs were resolved by redirecting Ollama's output to a log file instead of using `subprocess.PIPE`. Zombie processes were managed by detaching child processes using `start_new_session=True` and implementing socket-based port checks. Ultimately, the migration to Tauri significantly reduced installation package size and memory usage, resulting in a more performant developer tool.
favicon
dev.to
dev.to
Image for the article: Story of 'smoodit' (1) : Electron to Tauri