Skip to content

AltanEsmer/MSD-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Medication Adherence App

A dual-app Android medication adherence system built with Kotlin, Jetpack Compose, and Clean Architecture. Designed specifically for elderly patients with comprehensive accessibility features, plus a family caregiver monitoring app.

Status Platform Kotlin Architecture


πŸ“± Project Overview

This Medication Adherence app solves one of healthcare's most pressing issues: medication non-adherence. It consists of two interconnected applications:

  • Patient App: Simple, accessible medication management for elderly users
  • Family App: Remote monitoring and alert system for caregivers

Target Users: Elderly patients (65+) managing multiple medications and their family caregivers
Core Value: Reliable medication tracking with family peace of mind


πŸ—οΈ Architecture

The app follows Clean Architecture with three distinct layers:

app/
β”œβ”€β”€ data/                      # Data Layer
β”‚   β”œβ”€β”€ local/                 # Room database & local storage
β”‚   β”‚   β”œβ”€β”€ entity/           # Room entities (DB tables)
β”‚   β”‚   β”œβ”€β”€ dao/              # Data Access Objects (queries)
β”‚   β”‚   β”œβ”€β”€ database/         # Room database configuration
β”‚   β”‚   β”œβ”€β”€ converter/        # Type converters (DateTime, List)
β”‚   β”‚   β”œβ”€β”€ mapper/           # Entity ↔ Domain model mappers
β”‚   β”‚   └── LocalMedicationDataSource.kt
β”‚   β”œβ”€β”€ repository/           # Repository implementations
β”‚   └── work/                 # WorkManager (background tasks)
β”‚
β”œβ”€β”€ domain/                    # Domain Layer
β”‚   β”œβ”€β”€ model/                # Pure business models
β”‚   └── repository/           # Repository interfaces
β”‚
└── presentation/              # Presentation Layer
    β”œβ”€β”€ patient/              # Patient app
    β”‚   β”œβ”€β”€ screen/           # Patient screens
    β”‚   └── viewmodel/        # ViewModels
    β”œβ”€β”€ family/               # Family app
    β”‚   └── *.kt              # Family screens
    β”œβ”€β”€ common/               # Shared UI
    β”‚   └── components/       # Reusable components
    └── theme/                # Material Design 3 theme

Architecture Patterns:

  • Clean Architecture - Separation of concerns (Data/Domain/Presentation)
  • MVVM - Model-View-ViewModel for UI
  • Repository Pattern - Data abstraction
  • Dependency Injection - Hilt for DI

✨ Current Features

Patient App (Phase 1 Complete βœ…)

Core Features

  • βœ… Modern Patient Dashboard - Personalized greeting, daily stats, medication list
  • βœ… Medication Management - Add, view, and track medications
  • βœ… Today's Progress Tracking - Visual progress indicators (streak, doses taken)
  • βœ… One-Tap Medication Logging - Simple TAKE button for dose confirmation
  • βœ… Medication Details - Full medication information with adherence history
  • βœ… Sample Data Seeding - 3 sample medications auto-loaded on first launch

Technical Implementation

  • βœ… Room Database - Local persistence with proper entities
  • βœ… MVVM Architecture - Clean separation with ViewModels
  • βœ… Kotlin Coroutines & Flow - Reactive data streams
  • βœ… WorkManager - Reliable background reminder system
  • βœ… Hilt Dependency Injection - Modular, testable code

Accessibility Features

  • βœ… Large Touch Targets - Minimum 44dp for easy tapping
  • βœ… Scalable Text - 18sp+ body text, 22sp+ headings
  • βœ… High Contrast Colors - Better visibility for low vision
  • βœ… TalkBack Support - Full screen reader compatibility
  • βœ… Content Descriptions - Semantic labels for assistive tech
  • βœ… Visual Status Indicators - Color-coded medication states

Family App (Phase 1 Complete βœ…)

Caregiver Features

  • βœ… Family Dashboard - Real-time patient status overview
  • βœ… Patient Monitoring - Track multiple patients simultaneously
  • βœ… Alert System - Missed dose notifications (Critical/Warning/Info)
  • βœ… Activity Timeline - Chronological medication event log
  • βœ… Progress Tracking - Today's adherence with visual indicators
  • βœ… Quick Actions - Message, call, or check patient status
  • βœ… Reports Screen - Adherence analytics and trends

Monitoring Features

  • βœ… Real-Time Updates - See medication status changes instantly
  • βœ… Alert Prioritization - Critical alerts for missed important doses
  • βœ… Multi-Patient Support - Monitor multiple family members
  • βœ… Adherence Analytics - Week/month/quarter views with trends

🎯 User Experience

Patient Journey

  1. Welcome Screen - Onboarding for new users
  2. Dashboard - Today's medications with large, accessible cards
  3. Add Medication - Simple form with validation
  4. Take Medication - One-tap confirmation
  5. Progress Tracking - Visual feedback on adherence
  6. History View - Detailed adherence records over time

Caregiver Journey

  1. Family Dashboard - Overview of all monitored patients
  2. Alerts Screen - Filter and respond to medication issues
  3. Patient Status - Detailed view of patient's medication schedule
  4. Messaging - Quick communication with patient
  5. Reports - Long-term adherence analytics and insights

πŸ› οΈ Technology Stack

Core Android

// Android Core
androidx.core:core-ktx:1.12.0
androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0
androidx.activity:activity-compose:1.8.2

Jetpack Compose

// UI Framework
androidx.compose:compose-bom:2023.10.01
androidx.compose.material3:material3
androidx.compose.material:material-icons-extended

Room Database

// Local Persistence
androidx.room:room-runtime:2.6.1
androidx.room:room-ktx:2.6.1
kapt("androidx.room:room-compiler:2.6.1")

Dependency Injection & Background Work

// Hilt DI
com.google.dagger:hilt-android:2.48
kapt("com.google.dagger:hilt-compiler:2.48")

// WorkManager
androidx.work:work-runtime-ktx:2.9.0
androidx.hilt:hilt-work:1.1.0

Firebase (Ready for Integration)

// Cloud Services (Future)
com.google.firebase:firebase-firestore-ktx
com.google.firebase:firebase-auth-ktx
com.google.firebase:firebase-messaging-ktx

πŸ“ Key Components

Data Layer

Component Purpose Location
Entities Room database tables data/local/entity/Entities.kt
DAOs Database queries data/local/dao/Daos.kt
Database Room configuration data/local/database/MedicationDatabase.kt
Mappers Entity ↔ Model conversion data/local/mapper/DataMappers.kt
Repository Data source abstraction data/repository/MedicationRepositoryImpl.kt
WorkManager Background tasks data/work/MedicationReminderWorker.kt

Domain Layer

Component Purpose Location
Models Business logic models domain/model/Models.kt
Repository Interfaces Data contracts domain/repository/RepositoryInterfaces.kt

Presentation Layer

Component Purpose Location
Screens Full-screen composables presentation/patient/screen/, presentation/family/
ViewModels State management presentation/patient/viewmodel/
UI Components Reusable composables presentation/common/components/
Theme Material Design 3 presentation/theme/

πŸ“– Documentation

This repository includes comprehensive documentation:


πŸš€ Getting Started

Prerequisites

  • Android Studio Hedgehog (2023.1.1) or later
  • JDK 17 or higher
  • Android SDK 24+ (target SDK 34)

Building the Project

  1. Clone the repository
git clone https://github.com/yourusername/medication-adherence-app.git
cd medication-adherence-app
  1. Open in Android Studio

    • Open Android Studio
    • Select "Open an Existing Project"
    • Navigate to the project directory
  2. Sync Gradle

    • Android Studio will automatically sync Gradle
    • Wait for dependencies to download
  3. Run the app

    • Connect an Android device or start an emulator
    • Click "Run" or press Shift+F10

First Run

  • The app will seed 3 sample medications on first launch
  • Patient Dashboard shows today's medications
  • Family App provides mock data for demonstration

πŸ§ͺ Testing

Unit Tests

  • MedicationViewModelTest - ViewModel logic
  • RepositoryTest - Data layer
  • AdherenceTrackingTest - Adherence calculations

UI Tests

  • Patient flow (add β†’ reminder β†’ take)
  • Family monitoring flow
  • Alert system verification

Run tests:

./gradlew test
./gradlew connectedAndroidTest

🎨 Design System

Material Design 3

  • Color Palette: Custom blue, green, orange, gray scales
  • Typography: Scalable text system (18sp+ body, 22sp+ headings)
  • Components: Material 3 Cards, Buttons, TextFields
  • Accessibility: WCAG 2.1 AA compliant

Color Scheme

// Primary
Blue600 (0xFF2563EB)   // App brand
Green600 (0xFF16A34A)   // Success states
Orange600 (0xFFEA580C)  // Warnings
Red600 (0xFFDC2626)     // Errors

// Neutral
Gray50 (0xFFF9FAFB)     // Background
Gray600 (0xFF6B7280)    // Secondary text
Gray900 (0xFF111827)    // Primary text

πŸ“Š Project Status

βœ… Phase 1: Complete

  • Patient App MVP
  • Modern UI with Material Design 3
  • Room Database implementation
  • WorkManager reminders
  • Accessibility features
  • Sample data seeding
  • Family App MVP
  • Alert system
  • Reports and analytics

🚧 Phase 2: In Progress

  • Firebase Authentication
  • Firestore data sync
  • Real-time push notifications
  • Edit medication functionality
  • Patient settings screen

πŸ“‹ Phase 3: Planned

  • Multi-language support
  • Medication interaction warnings
  • Doctor/pharmacy integration
  • Health data export
  • Advanced analytics
  • Integration with health apps

🎯 MVP Success Metrics

Patient App

  • βœ… Simple, accessible interface
  • βœ… Reliable reminder system
  • βœ… Progress tracking
  • βœ… One-tap medication logging
  • βœ… Large touch targets and readable text

Family App

  • βœ… Real-time status monitoring
  • βœ… Alert system for missed doses
  • βœ… Multi-patient support
  • βœ… Comprehensive adherence analytics
  • βœ… Quick communication features

Technical

  • βœ… Clean Architecture implementation
  • βœ… MVVM pattern with ViewModels
  • βœ… Room database for offline support
  • βœ… Hilt dependency injection
  • βœ… WorkManager for background tasks
  • βœ… Accessibility compliance (WCAG 2.1 AA)

πŸ‘₯ Target Audience

Primary Users

  • Elderly Patients (65+) - Managing 3+ daily medications
  • Family Caregivers - Monitoring loved ones remotely
  • Healthcare Workers - Providing medication adherence support

User Needs Addressed

  • Simple medication management for elderly users
  • Family peace of mind through remote monitoring
  • Reduced medication errors and missed doses
  • Better health outcomes through improved adherence

🀝 Contributing

This is a course project (MSD Project). Contributions, issues, and pull requests are welcome!

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Kotlin style guide compliance
  • Clean Architecture principles
  • Accessibility-first design
  • Material Design 3 guidelines
  • Comprehensive test coverage

πŸ“ License

This project is created for educational purposes as part of the MSD (Mobile Software Development) course.


πŸ“ž Contact

For questions or support, please refer to the project documentation or contact the development team.


πŸ™ Acknowledgments

  • Material Design 3 - Google
  • Jetpack Compose - Google
  • Room Database - Android
  • Hilt - Google Dagger
  • Clean Architecture - Robert C. Martin (Uncle Bob)

Built with ❀️ for elderly patients and their families

About

MSD course official project repo (SDU)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors