An Android mobile application engineered for individuals managing chronic illnesses to track symptoms, remediation attempts, daily mood, and medications while identifying high-frequency health trends.
Managing chronic conditions requires consistent and detailed tracking across complex daily variables. Chronic illness sufferers often experience a wide variety of symptoms and remedies, making standard rigid dropdowns insufficient.
ChronicLog addresses this by combining a flexible daily entry workflow with clinical autocompletes, photo capture persistence, real-time community chat, and automated provider export capabilities.
The application adheres to the Model-View-ViewModel (MVVM) architecture with a dedicated Repository Layer to decouple UI components from data sources and asynchronous network operations.
MainViewModel manages LiveData observed by UI fragments and delegates persistence to HealthRepository, keeping Firestore and Storage operations cleanly isolated.
Pattern: MVVM + RepositoryTo prevent scanning every symptom subcollection on load, a dedicated aggregates/symptom_stats document in Firestore is maintained for fast Trends rendering.
StateFlow + TrendsViewModelFdaRepository executes asynchronous searches against OpenFDA endpoints using Retrofit, OkHttp, and Gson, managing active coroutine jobs to prevent race conditions.
REST API + CoroutinesA Firebase SnapshotListener on the chat_general collection drives a real-time global message stream, updating UI states instantly across users.
Firestore SnapshotListenerIntegrates the OpenFDA Product Labeling endpoint for medication entry and the Adverse Events endpoint for symptom entry. This provides clinical standardized naming across the app and assists patients in identifying exact symptoms.
Captures symptom imagery via camera launches, storing images in Firebase Storage under user-specific path identifiers (users/{uid}/symptoms/{id}.jpg) and rendering image placeholders asynchronously using Glide.
Utilizes the Android PdfDocument and FileProvider APIs to format user logs, health profile data, and treatment history into structured PDF documents that can be securely exported to medical providers via email.
Powered by MPAndroidChart, the Trends screen calculates and displays high-frequency symptom patterns, allowing patients to observe recurring health trends visually over time.
Problem: Nested subcollections under users/{uid}/logs/{logId}/symptoms failed to populate after fresh app restarts despite being present in Firestore console, resulting in silent permission failures.
Solution: Identified missing collectionGroup authorization rules in Security Rules. Added explicit wildcard path rules (/{path=**}/symptoms/{symptomId}) and built composite indexes in the Firebase Console to enable multi-subcollection background queries.
Problem: Users can add multiple symptoms and remediations across several interactive pop-up screens before finalizing a daily health log.
Solution: Managed intermediate entry states in temporary LiveData variables (tempSymptoms, tempRemediations) inside MainViewModel, staging data in memory until the log item is explicitly committed to Firestore.
A breakdown of the project architecture and codebase volume across Kotlin modules, XML layouts, and network/data services.