3.2 KiB
3.2 KiB
Journal.App
SvelteKit 5 + Tauri 2 desktop application for Project Journal.
Tech Stack
- Frontend: SvelteKit 5, TypeScript, Vite 6
- Tauri shell: Rust (Tauri 2),
tokioasync runtime - Backend bridge:
Journal.Sidecar.exemanaged as a persistent long-lived child process
Dev Setup
npm install
npm run dev # SvelteKit dev server at http://localhost:1420
npm run tauri dev # Tauri desktop window (connects to dev server)
Build Targets
| Command | Output | Use case |
|---|---|---|
npm run build |
Journal.App/build/ |
Web bundle for Journal.WebGateway |
.\scripts\publish-app.ps1 -Target web |
Journal.App/build/ |
Same, via script |
.\scripts\publish-app.ps1 -Target tauri -TauriBundles none |
src-tauri/target/release/journalapp.exe |
Raw desktop exe |
.\scripts\publish-app.ps1 -Target tauri -TauriBundles nsis |
NSIS installer | Packaged installer |
Frontend State Management
Svelte stores are the source of truth for all feature state.
Current Stores
| Store file | State exports | Notes |
|---|---|---|
src/lib/stores/entries.ts |
entriesStore |
Entry list, getDefaultEntry, createEntryDraft |
src/lib/stores/fragments.ts |
fragmentsStore |
Fragment CRUD + parse/serialize helpers |
src/lib/stores/todos.ts |
todoListsStore, todosStore |
Todo list and item CRUD |
src/lib/stores/lists.ts |
listsStore |
Generic list CRUD, createListDraft |
src/lib/stores/settings.ts |
settingsTags, settingsFragmentTypes |
Tag/type config |
Store-First Rule
- Components call store helper functions for CRUD operations — not inline mutations.
- Components should focus on rendering, local form state, and invoking store operations.
- Backend calls (
sendCommand) belong inside store/service helpers, not components.
Tauri Commands (Rust → Frontend)
| Command | Description |
|---|---|
sidecar_command |
Forward a CommandEnvelope to Journal.Sidecar stdin/stdout and return parsed JSON |
get_sidecar_root |
Get currently resolved sidecar root path |
set_sidecar_root |
Override root path (saved to settings.json, restarts sidecar) |
get_ui_settings |
Load tag/fragment-type settings |
set_ui_settings |
Persist tag/fragment-type settings |
shutdown |
Stop sidecar, exit app |
Sidecar Path Resolution
The Rust shell looks for Journal.Sidecar.exe starting from the auto-detected repository root:
<root>/Journal.Sidecar.exe<root>/publish/Journal.Sidecar.exe<root>/Journal.Sidecar/bin/Debug/net10.0/Journal.Sidecar.exe<root>/Journal.Sidecar/bin/Release/net10.0/win-x64/publish/Journal.Sidecar.exe- Recursive scan of
<root>/Journal.Sidecar/
Build the sidecar before running the Tauri app:
.\scripts\publish-sidecar.ps1 -Configuration Release -Runtime win-x64
Recommended IDE Setup
VS Code + Svelte + Tauri + rust-analyzer