Skip to content

pinkvaportrip/health-tracker

Repository files navigation

Health Tracker

A fully local React Native / Expo application for flexible health tracking. Users can create custom health areas (Migraine, Sleep, Nutrition, etc.), define trackers, log structured and free-form entries, browse timelines, manage tags, and export everything—including media—without leaving the device.

Getting started

npm install
npx expo start

Use any Expo-supported target (development build, iOS simulator, Android emulator, or Expo Go) to run the app.

Key features

  • On-device storage – SQLite stores structured data, while the media directory under the app's document folder keeps photos, videos, and recordings.
  • Custom health areas & trackers – Each tracker defines structured fields, tracker type, hints, and allowed attachment types.
  • Rich entry logging – Numeric/boolean/choice fields, timestamp edits, title, tags, text notes, audio recordings, photo/video capture or gallery import.
  • Timeline & filters – Scrollable daily groups with filtering by date range, areas, trackers, tracker type, tags, and attachment type.
  • Entry detail – View attachments (images, audio playback, videos), edit structured values + tags, or delete entries with automatic media cleanup.
  • Settings – Manage health areas, trackers (including field definitions), tags, biometric lock (via Local Authentication), and ZIP export.
  • ZIP export – Choose a date range to create export.json plus a media/ directory zipped and surfaced to the share sheet.

Architecture overview

  • domain/ – TypeScript data model and filter contracts.
  • storage/ – SQLite schema bootstrap, repository pattern for reads/writes, media file helpers, and the ZIP exporter (JSZip + FileSystem + Sharing).
  • state/ – Providers for database access (SQLiteProvider), query caching, and optional biometric lock state.
  • app/ – File-based navigation powered by Expo Router:
    • onboarding flow (3 steps) shown until at least one area & tracker exist.
    • (tabs)/index (today/home), (tabs)/timeline, (tabs)/settings.
    • new-entry, entry/[id] stack screens for logging and reviewing entries.
  • hooks/ – Audio recorder helper wrapping expo-av.
  • utils/ – Date helpers for grouping and formatting.

All modules are written in TypeScript with strict mode enabled.

Data export

  1. Open Settings → Export data.
  2. Enter start and end dates (YYYY-MM-DD).
  3. Tap Export ZIP. The app collects health areas, trackers, matching entries, attachments metadata, copies referenced media into the ZIP, then invokes the system share sheet so you can save/share the archive.

Notes & next steps

  • Additional permissions may be requested at runtime (camera, media library, microphone, biometrics) depending on the flow.
  • If you add new native modules, run npx expo prebuild or rebuild the dev client as needed.
  • Consider enhancing validation (e.g., nicer date pickers) or syncing with remote services if the app ever needs cloud connectivity.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published