Personal health companion.
Tracks daily steps. Earn rewards.
- Daily step tracking via Android Health Connect / Apple HealthKit.
- Rewards system — users earn points based on steps walked each day.
- Self-hosted & works completely offline for privacy; optional cloud sync via PocketBase.
Store medical documents safely.
Flutter (Material 3) on Android / iOS / desktop / web, with:
image_picker— capture from camera or import from gallery (web uses file picker).sqflite+sqflite_common_ffi(desktop) +sqflite_common_ffi_web(web, via sqlite3.wasm + IndexedDB) — local SQLite store for documents, episodes and tags.health— reads daily step count from Android Health Connect (API 26+) and Apple HealthKit.pocketbase— optional self-hosted backend for user accounts, step sync, and rewards.- Image bytes are stored as
BLOBinside SQLite, so no platform-specific filesystem code is needed.
All data stays on the device / browser by default; nothing leaves the client unless you configure a PocketBase server.
Note on web: SQLite runs in a shared worker via
sqlite3.wasmand persists to IndexedDB. Health data is not available on web.
PocketBase is a single-binary self-hosted backend. To enable cloud sync and rewards:
-
Download PocketBase and run it:
./pocketbase serve -
In the Admin UI (
http://127.0.0.1:8090/_/), create these collections:Collection Fields users(built-in)add reward_points(number, default 0)stepsuser(relation→users),date(text),steps(number) -
Set your PocketBase URL in the app settings.
Steps per day are synced to PocketBase. The server (or a scheduled job) can apply any reward formula, e.g.:
- < 5 000 steps → 0 pts
- 5 000 – 9 999 steps → 10 pts
- ≥ 10 000 steps → 25 pts
Health Connect must be installed (pre-installed on Android 14+, available on Play Store for Android 9+). The app requests READ_STEPS permission at runtime.
HealthKit NSHealthShareUsageDescription is declared in Info.plist. The app requests read-only access to step count at runtime.
lib/
main.dart # App entry, theme, routing, sqlite factory wiring
models/document.dart # MedicalDocument model (image stored as bytes)
platform/
desktop_sqlite.dart # FFI init for macOS/Linux/Windows
desktop_sqlite_web.dart # No-op stub for web (conditional import)
services/
database_service.dart # SQLite persistence
health_service.dart # Step count via Health Connect / HealthKit
pocketbase_service.dart # PocketBase auth, step sync, rewards
screens/
home_screen.dart # Documents grouped by episode
capture_screen.dart # Take photo, OCR, save
document_detail_screen.dart # View / edit / delete a document
flutter pub get
# One-time, only needed for web:
dart run sqflite_common_ffi_web:setup
flutter run # mobile / desktop
flutter run -d chrome # web
The Android build requires minSdk >= 21 for ML Kit (already configured). Health Connect requires minSdk >= 26.