How horserider2146/meditrackpro works
1. High-level shape
- This is a single-module Android app (app/) written in Kotlin.
- The architecture is a mix of MVVM for data-backed screens and Activity/Fragment-driven UI for navigation and settings.
- The app centers on personal health management: medications, health records, profile/health info, caregiver settings, and account/security controls.
2. Entry points and screen navigation
- LoginActivity and SignUpActivity handle authentication before the user enters the main app.
- MainActivity is the post-login shell and likely hosts the bottom navigation and nav_graph.xml.
- The primary in-app destinations are the four main fragments:
- HomeFragment
- MedicationsFragment
- HealthFragment
- ProfileFragment
3. Core UI split: fragments vs. standalone activities
- The app uses fragments for the main dashboard sections and separate activities for focused editor/settings flows.
- Add/edit screens are isolated as activities:
- AddMedicineActivity
- AddHealthRecordActivity
- EditHealthInfoActivity
- Settings and preference screens are also separate activities:
- CaregiverSettingsActivity
- NotificationSettingsActivity
- PrivacySettingsActivity
- AppAppearanceActivity
- EmergencyContactsActivity
4. Medication subsystem
- The medication feature is a full local-data subsystem built around:
- Medicine entity
- MedicineDao
- MedicineDatabase
- MedicineViewModel
- MedicationsFragment presents organized views such as today’s meds, all meds, and refill tracking.
- AddMedicineActivity writes new medication data into the local database; the fragment reads it back through the ViewModel.
- The UI also includes refill and dosage card layouts, showing that medication data is rendered in multiple card styles rather than a single list.
5. Health records subsystem
- The health record side mirrors the medication architecture:
- HealthRecord entity
- HealthRecordDao
- HealthViewModel
- HealthFragment is the read/browse surface for records and category counts.
- AddHealthRecordActivity and EditHealthInfoActivity provide data entry/editing flows.
- The readme indicates record types like lab results, prescriptions, visits, and vaccinations, with deletion support from the list view.
6. Home/dashboard flow
- HomeFragment is the summary layer of the app.
- It aggregates user-facing health and medication status into a dashboard: live time, greeting, dose progress, and upcoming dose alerts.
- This makes it the “presentation-only” hub that pulls together information from the medication and profile subsystems rather than owning its own persistent model.
7. Profile, health info, and caregiver support
- ProfileFragment likely acts as the central user profile and settings gateway.
- EditHealthInfoActivity manages personal health attributes such as blood type, height, weight, DOB, gender, and conditions; the readme notes BMI is computed from the entered values.
- Caregiver configuration is separated into CaregiverSettingsActivity, indicating a distinct workflow for contact details and alert preferences.
- EmergencyContactsActivity holds two dedicated contact slots, suggesting emergency contacts are a separate data domain from caregiver data.
8. Authentication and account lifecycle
- Firebase Authentication is the external identity boundary for the app.
- Email/password sign-in and sign-up are handled by LoginActivity and SignUpActivity.
- The presence of google-services.json and Firebase in the readme indicates the app depends on Google services configuration at build/runtime.
- Privacy flows include password reset, biometric unlock on launch, and account deletion with re-authentication.
9. Local persistence boundary
- The app’s persistent health and medication data is stored locally with Room on SQLite.
- ViewModels sit between the UI and the Room layer, which keeps screens decoupled from direct database access.
- This is the main data flow pattern in the repo: Activity/Fragment → ViewModel → DAO → Room database.
- The readme also mentions “clear all local data,” reinforcing that local persistence is a major concern and likely user-resettable.
10. Appearance and app-wide behavior
- BaseActivity and AppThemeHelper indicate centralized behavior for app-wide theme/font application.
- AppAppearanceActivity lets users change dark/light theme, accent color, and text size.
- The resource set includes multiple color/dot/pill drawable variants, which supports the app’s theme customization system.
- This is a cross-cutting layer that affects many screens rather than a feature silo.
11. Navigation and UI composition
- The app uses the Jetpack Navigation Component with a bottom navigation menu (bottom_nav_menu.xml) and a navigation graph (nav_graph.xml).
- Screen layouts are mostly Material-style XML views, with reusable item layouts for medicine, health records, dose cards, and refill cards.
- That suggests a classic Android view-based UI, not Compose.
12. Infrastructure and platform dependencies
- Material Components, CardView, ConstraintLayout, AndroidX Biometric, and likely LiveData/ViewModel are the main Android framework dependencies shaping the app.
- The readme mentions WorkManager and notification features, so background reminder infrastructure is part of the intended architecture, even though worker classes are not visible in this file tree.
- Overall, the architecture is split cleanly between:
- Remote identity: Firebase Auth
- Local health data: Room
- UI/navigation: Activities, Fragments, Navigation Component
- Cross-cutting preferences: theme, font scale, biometric/privacy settings
Main entry points: ProfileFragment.kt Profile · MainActivity.kt Main Shell · MedicineViewModel.kt Medicine VM · HealthViewModel.kt Health VM
Components 24
Auth
Login, signup, and account lifecycle flows.
App Shell
Post-login navigation and shared UI infrastructure.
- Main Shell · Post-login container for in-app navigation.
app/src/main/java/com/example/meditrackpro/MainActivity.kt - Home · Dashboard summary for meds and health status.
app/src/main/java/com/example/meditrackpro/HomeFragment.kt
Medications
Medication capture, tracking, and local persistence.
- Medications · Medication overview, doses, and refill tracking.
app/src/main/java/com/example/meditrackpro/MedicationsFragment.kt - Add Medicine · Create medication entries.
app/src/main/java/com/example/meditrackpro/AddMedicineActivity.kt - Medicine VM · Bridges medication UI and local data.
app/src/main/java/com/example/meditrackpro/MedicineViewModel.kt - Medicine DB · Local medication persistence boundary.
app/src/main/java/com/example/meditrackpro/MedicineDatabase.kt - Medicine DAO · Medication queries and writes.
app/src/main/java/com/example/meditrackpro/MedicineDao.kt - Medicine · Medication record model.
app/src/main/java/com/example/meditrackpro/Medicine.kt
Health Records
Health record browsing and editing flows.
- Health · Health record browsing and counts.
app/src/main/java/com/example/meditrackpro/HealthFragment.kt - Add Record · Create new health records.
app/src/main/java/com/example/meditrackpro/AddHealthRecordActivity.kt - Health VM · Bridges health record UI and local data.
app/src/main/java/com/example/meditrackpro/HealthViewModel.kt - Health DAO · Health record queries and writes.
app/src/main/java/com/example/meditrackpro/HealthRecordDao.kt - Health Record · Health record model.
app/src/main/java/com/example/meditrackpro/HealthRecord.kt
Profile & Settings
Profile, health info, privacy, and preferences.
- Profile · Profile gateway into personal and settings flows.
app/src/main/java/com/example/meditrackpro/ProfileFragment.kt - Edit Health · Personal health info editor.
app/src/main/java/com/example/meditrackpro/EditHealthInfoActivity.kt - Caregiver · Caregiver contact and alert settings.
app/src/main/java/com/example/meditrackpro/CaregiverSettingsActivity.kt - Emergency Contacts · Dedicated emergency contact slots.
app/src/main/java/com/example/meditrackpro/EmergencyContactsActivity.kt
Shared Infra
Cross-cutting app behavior and platform integration.
- Appearance · Theme, accent, and text-size settings.
app/src/main/java/com/example/meditrackpro/AppAppearanceActivity.kt - Privacy · Security and account lifecycle controls.
app/src/main/java/com/example/meditrackpro/PrivacySettingsActivity.kt - Notifications · Reminder and alert settings.
app/src/main/java/com/example/meditrackpro/NotificationSettingsActivity.kt - Base Activity · Common activity behavior for the app.
app/src/main/java/com/example/meditrackpro/BaseActivity.kt - Theme Helper · Centralized theme and font application.
app/src/main/java/com/example/meditrackpro/AppThemeHelper.kt
Connections 24
- Login → Main Shell: auth success · Successful sign-in enters the main shell.
- Sign Up → Main Shell: register success · New account creation proceeds into the app.
- Main Shell → Home: hosts · Main shell hosts the dashboard fragment.
- Main Shell → Medications: hosts · Main shell hosts medication navigation.
- Main Shell → Health: hosts · Main shell hosts health record navigation.
- Main Shell → Profile: hosts · Main shell hosts profile navigation.
- Home → Medicine VM: summarizes · Dashboard reflects medication status.
- Medications → Medicine VM: reads writes · Medication UI uses the ViewModel boundary.
- Add Medicine → Medicine VM: creates · Add flow persists through the ViewModel.
- Medicine VM → Medicine DAO: uses · ViewModel delegates local data access.
- Medicine DAO → Medicine DB: queries · DAO operates on the Room database.
- Medicine DB → Medicine: stores · Room database persists medication entities.
- Health → Health VM: reads · Health UI uses the ViewModel boundary.
- Add Record → Health VM: creates · Add record flow persists through the ViewModel.
- Health VM → Health DAO: uses · ViewModel delegates local data access.
- Health DAO → Health Record: stores · DAO reads and writes record entities.
- Profile → Edit Health: opens · Profile surface routes into personal health editing.
- Profile → Caregiver: opens · Profile surface routes into caregiver settings.
- Profile → Emergency Contacts: opens · Profile surface routes into emergency contacts.
- Profile → Privacy: opens · Profile surface routes into privacy controls.
- Profile → Notifications: opens · Profile surface routes into notification settings.
- Profile → Appearance: opens · Profile surface routes into appearance settings.
- Base Activity → Theme Helper: applies · Shared activity behavior centralizes theming.
- Appearance → Theme Helper: configures · Appearance settings update shared theme state.