This is currently a learning app for Candid Engineering (@rkofman && @SilverMaiden) to practice svelte + desktop development. The goal is to have a simple application for tracking one's physical book library.
Current tech stack:
- Svelte + SvelteKit + Typescript
- Vitest (.js unit testing)
- Bulma (CSS framework)
- Tauri (WebView frontend + Rust backend)
And some are open questions:
- Local storage:
- sqlite? (guide)
- Tauri store?
- IndexedDB (likely with a wrapping library for ease of use)
- tauri-plugin-store
- Data syncing to a backend
- The backend itself
Before getting started, make sure the following is set up on your machine:
It is recommended to use a node version manager such as nodenv to install the required version of node. See .node-version
for the current required version.
We also specify a specific version of pnpm
in the packageManager
field of package.json
. Make sure to have it installed.
To install javascript packages, we use the pnpm package manager:
pnpm install
The default test command is:
pnpm test
This will run the javascript unit tests (files ending in .spec
within /src-ui
) as well as the rust tests (test modules within /src-tauri
).
A common way to have a quick development cycle is to keep a window open running tests in watch mode. This will re-run the tests any time relevant files change.
For javascript, that's available via:
pnpm js:test
Our rust code is not yet set-up for watch; but should be easy to add as an exercise left to the reader.
Integration tests are only available on Windows at this time. Before running them, you must download the version of MS Edge Driver that corresponds to your MS Edge browser.
(keeping the driver up to date over time is an exercise left to the reader)
Once that's installed, make sure to add it to your PATH_.
Then install tauri-driver
:
cargo install tauri-driver
Once that's done, you should be able to run end to end tests:
pnpm e2e:test
As an easy way to get started, run a SvelteKit development server (no Electron/Tauri features):
pnpm run svelte:dev
To run the full app including Tauri and native Rust code:
pnpm run dev
(This section may need to be filled out if there are any gotchas or required secrets to include when building)
pnpm run build
- Update
src-ui/lib/db/schema.ts
- Run
cargo xtask ben:migration [migration_name]
pnpm dev
will start the app and apply any migrations since the latest fully applied one.
- Note: Currently only new migrations will be applied (measured by timestamp). If a migration was skipped, it will remain skipped.