Checking your blood glucose while coding or gaming on Windows usually means picking up your phone, unlocking it, and opening the Dexcom G7 app—or paying a recurring subscription for dated, closed-source Microsoft Store widgets. Most existing overlays also trap you in a frustrating UI trade-off: either you leave the window clickable and risk accidentally dragging it mid-game, or you lock it as click-through and lose the ability to inspect historical readings.
I built AlGlucoMon to fix all of that in a tiny, free, open-source (GPL-3.0) always-on-top transparent Windows desktop overlay for Dexcom G7. It displays your live reading (mg/dL or mmol/L), animated trend arrow, delta, and freshness indicator floating cleanly over an optional full-bleed background trend graph. In Dots mode, hovering any historical dot dims the live readout and reveals a floating tooltip with that reading's exact value and timestamp—and when Click-Through Lock is active, holding Alt (configurable) temporarily wakes the overlay so you can hover dots, reposition it, or unlock it in one click.
1. Two-Window Tauri v2 Architecture
AlGlucoMon uses a two-window Tauri v2 desktop architecture backed by a single Vite + React frontend bundle (hash-routed between the transparent overlay window at index.html and the settings window at index.html#settings) talking to a native Rust backend over Tauri IPC and broadcast events:
Visual tweaks in Settings.tsx broadcast settings-updated live so you see opacity, size, and graph changes immediately, while Dexcom Share credentials stay in draft state behind an explicit Sign In & Connect validation button so typing keystrokes never spams authentication requests.
2. Zero-Crate Win32 Click-Through Bypass
On Windows, enabling click-through sets WS_EX_TRANSPARENT, causing the OS to drop all mouse input—including hover events needed to inspect historical glucose dots.
Rather than adding heavy global hook crates, src-tauri/src/lib.rs links user32's GetAsyncKeyState directly via a 6-line extern "system" FFI declaration. A lightweight background thread polls at 40ms while click-through is enabled (120ms idle) and tracks an AtomicBool override state. Notice the mid-drag safety check on line 221: if you release Alt slightly before releasing the left mouse button (VK_LBUTTON) while dragging the card, the overlay stays interactive until the drag completes:
// File not found: projects/alglucomon/lib.rs3. Layered SVG Graph & Euclidean Dot Hit-Testing
Rendering a chart directly behind large live numbers easily ruins legibility. AlGlucoMon separates the card into four layers: glassmorphic base → SVG spline and range-colored dots (BackgroundGraph.tsx) → soft radial contrast scrim → tabular-nums foreground readout.
Trying to hit tiny 2.3px SVG circles with exact DOM pointer hitboxes is frustrating, so Overlay.tsx projects mouse coordinates into the 260×118 SVG viewBox and runs a Euclidean nearest-neighbor search within a 16-unit radius. When a dot is active, the foreground glucose readout fades smoothly to 16% opacity, the contrast scrim clears, and an edge-clamped tooltip pops up above the hovered point without blocking startDragging() or toolbar buttons:
// File not found: projects/alglucomon/Overlay.tsx4. Resilient Unofficial Dexcom Share Client
Dexcom's official Developer Web API enforces a 1–3 hour delay, making it unusable for a real-time desktop widget. AlGlucoMon instead speaks to Dexcom Share's regional publisher endpoints (us, ous, jp) via a 3-step publisher auth flow (AuthenticatePublisherAccount → LoginPublisherAccountById → ReadPublisherLatestGlucoseValues) with an in-memory Mutex<Option<CachedSession>> and automatic single-retry re-auth when sessions expire.
Historical and regional Share responses serialize Trend inconsistently as either strings ("FortyFiveUp") or integer codes (0..9), and .NET timestamps arrive across multiple formats ("Date(...)", "/Date(...)/", or timezone offsets like -0500). A custom serde TrendVisitor handles all variants cleanly:
// File not found: projects/alglucomon/dexcom.rs5. Engineering Roadblocks & Pivots
Click-Through Lock Breaking Dot Hover
- What happened: Right after adding interactive dot tooltips, toggling Click-Through Lock (
set_ignore_cursor_events(true)) caused Windows to stop deliveringmousemoveevents to the WebView. - Pivot: Made Rust the single source of truth for
set_ignore_cursor_events(removing duplicateuseEffectcalls inOverlay.tsxthat raced the backend), dimmed the locked card to55%, and added the globalGetAsyncKeyStatemodifier-key hold (Alt/Ctrl/Shift) to temporarily restore interactivity on demand.
Blank White Settings Window & Invisible Overlay During Dev
- What happened: Both Tauri windows suddenly rendered completely blank (a solid white Settings window and an invisible transparent overlay) even though Vite served every module with HTTP
200. - Diagnosis: Running headless Edge (
msedge.exe --headless=new --enable-logging=stderr --dump-dom) revealed the exact runtime failure:
Uncaught SyntaxError: The requested module '/src/components/BackgroundGraph.tsx' does not provide an export named 'VIEW_H'
- Fix: An open editor buffer had reverted
BackgroundGraph.tsxto an older version missingVIEW_H,VIEW_W, andcomputeGraphLayout. Becausemain.tsxstatically imported bothOverlayandSettings, that single broken export aborted module evaluation for both windows before React mounted. RestoringBackgroundGraph.tsxand verifying both DOM roots in headless Edge immediately fixed it.
Windows DWM Artifacts & Signed-Out Lockout Trap
- DWM border artifacts: Setting
"shadow": falsealongside"transparent": true, "decorations": falseintauri.conf.jsonstopped Windows Desktop Window Manager from drawing a faint square frame around the rounded glass card. - First-launch lockout guard: Guarded
.setup()andsave_settingsin Rust soclick_throughis forced tofalsewhenever no credentials are stored—preventing a first-time user from locking themselves out of the Sign-In prompt.
6. Footprint & Build Benchmarks
Because a glucose monitor runs continuously in the corner of your screen all day, shipping a ~150 MB Chromium runtime with Electron was hard to justify. Tauri v2 reuses Windows' built-in WebView2 and Windows Schannel TLS (reqwest default native-tls, avoiding OpenSSL build pain), keeping the entire installer tiny.
Measured on Windows (x86_64-pc-windows-msvc, Node v22.20.0, Rust 1.100.0, Tauri 2.12.7):
| Artifact / Metric | Measurement | Details |
|---|---|---|
Windows NSIS Installer (AlGlucoMon_0.1.0_x64-setup.exe) | 2.58 MiB | 2,700,496 bytes |
Compiled Release Binary (alglucomon.exe) | 11.11 MiB | 11,644,928 bytes |
Frontend JS Bundle (dist/) | 184.44 kB | 57.48 kB gzip |
Frontend CSS + HTML (dist/) | 9.87 kB CSS + 0.40 kB HTML | 2.63 kB + 0.26 kB gzip (~0.86s–1.34s Vite build) |
Rust Unit Tests (cargo test) | 4 / 4 passing (0.00s) | Timestamp formats, trend deserialization, modifier VKs |
7. Open Source Release
AlGlucoMon is published under the GNU General Public License v3.0 (GPL-3.0):
- Source Code: github.com/TheChos3nOne/AlGlucoMon
- Downloads (
v0.1.0): Signed Windows NSIS installer available on GitHub Releases.
