Personal project · 2026
Cura
Offline-first desktop clinic-management application built for medical offices operating under intermittent internet connectivity.
Personal project · 2026
Offline-first desktop clinic-management application built for medical offices operating under intermittent internet connectivity.
Medical clinics require reliable daily operations—patient registration, intake, treatment logging, billing—in regions where internet connectivity is intermittent or unavailable.
Architected an offline-first desktop app: a Rust core executes SQLite operations via a connection pool with WAL mode enabled, wrapped inside a Tauri shell containing a static Next.js UI.
Built a change-data-capture sync engine. SQLite AFTER triggers serialize mutations into JSON changelogs. Background workers push deduplicated, dependency-ordered batches with exponential backoff, pull remote cursor updates, and resolve conflicts using last-write-wins with device-id tiebreaks.
Implemented a custom Phoenix-protocol WebSocket client for realtime pull triggers, non-coordinative daily visit codes (YYYYMMDD-DEV-001), WAL checkpoints before rotating backups, and 54 unit tests.
Serialized row mutations to JSON within SQLite AFTER triggers, guaranteeing that local modifications cannot bypass the sync changelog.
Tagged synced rows with device IDs and dropped local changelog records post-pull, preventing infinite replication feedback loops.
Excluded settings, print queues, and schema version tables from cloud replication to prevent local workstation state corruption.
Generated unique daily visit codes using date-device composite keys and atomic UPSERT queries inside transactions, eliminating central server dependencies.
Executed PRAGMA wal_checkpoint(TRUNCATE) prior to file copies, ensuring database backups remain uncorrupted.
A cross-platform desktop application handling clinic workflows offline, maintaining realtime synchronization when connected, and validated by 54 unit tests.