README.md
spark-rs
A personal, Spark-style email client with a Rust core. First target: Windows
on ARM (aarch64-pc-windows-msvc).
Created in T3 Code.
Layout
| 1 | crates/store SQLite storage: accounts, messages, outbox (bundled SQLite with FTS5) |
| 2 | crates/mail IMAP/SMTP and Microsoft Graph: sync, sending, Microsoft sign-in |
| 3 | crates/ai bring-your-own-key AI client (Anthropic, OpenAI-compatible) |
| 4 | apps/cli spark-cli, the headless dev tool |
| 5 | apps/desktop desktop app UI: React + Tailwind + daisyUI (Vite) |
| 6 | apps/desktop/src-tauri desktop app shell (Tauri 2): accounts, sync workers, demo mailbox |
| 7 | tools/cross Docker image for building Windows binaries on Linux |
Building
Everything builds in a Docker image, so the host needs nothing besides
Docker. The first run builds the image (a few minutes). On the first Windows
build, cargo-xwin downloads the MSVC CRT and Windows SDK (about 5 GB, cached in
~/.cache/spark-rs-cross); using those means accepting Microsoft's license
terms for them.
| 1 | # Linux: lint, test, run |
| 2 | tools/cross/run.sh cargo clippy --workspace --all-targets -- -D warnings |
| 3 | tools/cross/run.sh cargo test --workspace |
| 4 | tools/cross/run.sh cargo run -p spark-cli -- doctor |
| 5 | |
| 6 | # IMAP/SMTP end-to-end test against GreenMail (setup in crates/mail/tests/greenmail.rs) |
| 7 | SPARK_CROSS_DOCKER_ARGS='--network spark-test -e SPARK_TEST_GREENMAIL=spark-greenmail' \ |
| 8 | tools/cross/run.sh cargo test -p spark-mail --test greenmail |
| 9 | |
| 10 | # Desktop UI: build it first (Node on the host); the app embeds apps/desktop/dist |
| 11 | (cd apps/desktop && npm install && npm run build) |
| 12 | (cd apps/desktop && npm run dev) # UI alone in a browser at localhost:1420, demo data |
| 13 | |
| 14 | # Windows on ARM |
| 15 | tools/cross/run.sh cargo xwin build --release --target aarch64-pc-windows-msvc -p spark-desktop -p spark-cli |
| 16 | # → target/aarch64-pc-windows-msvc/release/{spark-desktop,spark-cli}.exe |
spark-desktop.exe is a single file with the UI embedded; it needs the
WebView2 runtime, which Windows 11 includes. On the Windows machine,
spark-cli.exe doctor checks that SQLite, TLS and networking work there.
TLS uses rustls with the aws-lc-rs backend. Don't switch it to ring: ring's
build forces plain clang on ARM64 Windows, which fails with cargo-xwin's
MSVC-style flags.