How faamaral/medtime works
Main Components
• Mobile Client/UI Layer: Represent the user interface built with Jetpack Compose. This layer consists of various screens (HomeScreen, Login, Signup, CreateEditMedicamentoScreen, etc.) and UI components (e.g., AppBar, Custom TextFields, DatePicker, TimePicker).
• ViewModel/Presentation Layer: Include the viewmodels (AuthViewModel, MedicamentoViewModel, UserViewModel) that encapsulate the UI logic and interact with the underlying services and repositories.
• Data Layer: This layer comprises the database modules and local storage functionalities including:
• Room database (MedtimeDatabase)
• DAOs (MedicamentoDao, HorariosDao)
• Repositories (MedicamentoRepository, UserRepository)
• Data models/entities (Medicamento, MedicamentoEntity, User, etc.)
• Service/Background Work Layer: Represent the notification services responsible for scheduling alarms and sending reminders. Components include:
• Notification-related services (AlarmScheduler, NotificationServices, Notifier, etc.)
• Notification workers and receivers (MedicamentoNotificationWorker, AlarmReceiver, MedicamentoNotificationReceiver)
• External Services: Display external dependencies like Firebase Cloud Firestore (and integration via google-services.json) which handle authentication and possibly remote data syncing.
Dependencies and Interactions
• Similarly, present a notification flow where the Notification or Alarm services (AlarmScheduler, NotificationWorker) are triggered either by the ViewModel logic or by time-based events, and then they interact with the system’s receivers to display notifications.
Architectural Patterns and Design Principles
• MVVM (Model-View-ViewModel) as the core architectural approach:
• Model = Data layer (database/entities, network if applicable)
• ViewModel = Business logic (viewmodels and services)
• View = UI components and screens.
• Separation of concerns by clearly differentiating the responsibilities of UI, data, and background processing.
Relevant Technologies
• Kotlin: Main programming language.
• Jetpack Compose: UI layer framework.
• Room: For local database operations.
• Firebase Cloud Firestore: For authentication and remote data storage.
• Android WorkManager/AlarmManager: For scheduling notifications.
• Gradle (Kotlin DSL): Build tool and dependency management.