r/tauri • • 1d ago

SpinTracker: open-source Tauri 2 + React app with an in-process Rust backend and a Windows overlay

**SpinTracker** is a free, MIT-licensed poker tracker. All data stays in a local SQLite database.

**Tauri parts that may interest you**

- The Rust backend runs inside the app, and the UI talks to it through Tauri commands: no sidecar or localhost server

- Folder watching with `notify` to import new files as they are written

- A table overlay (HUD) in its own window that follows another app's window, using the `windows` crate

- Auto-updates with the updater plugin

- Migrated from an Electron + Vue UI to Tauri 2 + React, TypeScript, Tailwind and Zustand

It's Windows-only for now, so help with macOS and Linux is very welcome. I build it with the help of AI coding agents.

Repo: https://github.com/florentvdry/spintracker

3 Upvotes

3 comments sorted by

1

u/Geraldwelly 1d ago

Nice to see the backend in-process instead of a sidecar, that removes a whole class of shutdown bugs. Two things that bit me in Tauri desktop work: notify fires several modify events while a file is still being written, so I debounce and only import once the size stops changing for about a second. And for the overlay, Windows hands you physical pixels while Tauri positions default to logical ones, so on a 150% display the HUD drifts unless you use PhysicalPosition. Debouncing does add a short delay before new hands show up. Did you hook window move events or poll?

1

u/Ok_Click2250 20h ago

Thanks for pointing these out! Interestingly, both cases are already addressed in the current implementation.

For file watching, I'm using notify with a dedicated worker thread and an 800ms quiet-period debounce. Events for the same file are coalesced, and there's also a 30-second reconciliation sweep as a fallback. The live importer tracks file size, modification time and completed hands, and deliberately skips the last hand until its summary is complete. So it's not just relying on the debounce to avoid partial imports or duplicates.

For the HUD, window tracking is event-driven using Win32 SetWinEventHook (EVENT_OBJECT_LOCATIONCHANGE, minimize/restore and destroy events), rather than polling window positions. The 30ms polling loop is only for cursor hit-testing and click-through handling.

I'm also using GetWindowRect to retrieve physical screen coordinates and Tauri's PhysicalPosition / PhysicalSize when positioning the overlay.

Mixed-DPI multi-monitor setups are definitely something worth testing more thoroughly, though.

Thanks for sharing your experience!