{"id":19883276,"url":"https://github.com/rh-id/a-medic-log","last_synced_at":"2026-01-17T23:25:12.107Z","repository":{"id":37754194,"uuid":"457405015","full_name":"rh-id/a-medic-log","owner":"rh-id","description":"A simple and easy to use personal medical notes.","archived":false,"fork":false,"pushed_at":"2026-01-17T03:28:03.000Z","size":1186,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-17T15:23:19.187Z","etag":null,"topics":["a-navigator","a-provider","android","android-app","android-application","android-applications"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rh-id.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-09T14:59:38.000Z","updated_at":"2026-01-17T03:28:06.000Z","dependencies_parsed_at":"2024-01-02T03:45:12.536Z","dependency_job_id":null,"html_url":"https://github.com/rh-id/a-medic-log","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/rh-id/a-medic-log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh-id%2Fa-medic-log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh-id%2Fa-medic-log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh-id%2Fa-medic-log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh-id%2Fa-medic-log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rh-id","download_url":"https://codeload.github.com/rh-id/a-medic-log/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rh-id%2Fa-medic-log/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28522047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a-navigator","a-provider","android","android-app","android-application","android-applications"],"created_at":"2024-11-12T17:19:46.622Z","updated_at":"2026-01-17T23:25:12.102Z","avatar_url":"https://github.com/rh-id.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# a-medic-log\n\n![Languages](https://img.shields.io/github/languages/top/rh-id/a-medic-log)\n![Downloads](https://img.shields.io/github/downloads/rh-id/a-medic-log/total)\n![GitHub release (by tag)](https://img.shields.io/github/downloads/rh-id/a-medic-log/latest/total)\n![Release](https://img.shields.io/github/v/release/rh-id/a-medic-log)\n![Android CI](https://github.com/rh-id/a-medic-log/actions/workflows/gradlew-build.yml/badge.svg)\n![Release Build](https://github.com/rh-id/a-medic-log/actions/workflows/android-release.yml/badge.svg)\n![Emulator Test](https://github.com/rh-id/a-medic-log/actions/workflows/android-emulator-test.yml/badge.svg)\n\nA simple and easy to use personal medical notes.\n\u003cul\u003e\n  \u003cli\u003eEasily add your medical notes\u003c/li\u003e\n  \u003cli\u003eMultiple profile to keep track elderly and family members medical history\u003c/li\u003e\n  \u003cli\u003eAdd medicine information and medicine reminder to notify you to take medicine\u003c/li\u003e\n  \u003cli\u003eSupport dark mode and light mode\u003c/li\u003e\n\u003c/ul\u003e\n\nThis project is intended for demo app for [a-navigator](https://github.com/rh-id/a-navigator) and [a-provider](https://github.com/rh-id/a-provider) library usage.\nThe app still works as production even though it is demo app.\n\n## Project Structure\n\nThe app uses a-navigator framework as navigator and StatefulView as base structure,\ncombined with a-provider library for service locator,\nand finally RxAndroid to handle UI use cases.\n\n## Architecture\n\nThe project is divided into two main modules:\n*   `app`: Contains the UI logic, navigation, dependency injection wiring, and business logic implementation.\n*   `base`: Contains the Data Layer (Room Entities, DAOs), Repositories, and basic domain models.\n\n### Key Components \u0026 Technical Detail\n\n#### 1. Dependency Injection (`a-provider`)\nThe app utilizes a hierarchical provider structure to manage dependency scopes effectively:\n*   **Global Scope (`AppProviderModule`):**\n    *   Lifecycle: Bound to `MainApplication`.\n    *   Components: `AppDatabase`, `WorkManager`, `Notifiers` (Singleton), `ScheduledExecutorService`.\n*   **Activity Scope (`ActivityProvider`):**\n    *   Lifecycle: Bound to `MainActivity`. Created via `Provider.createNestedProvider`.\n    *   Components: `AppNotificationHandler` (UI-specific logic), `INavigator` (Context-aware).\n*   **View Scope (`StatefulViewProvider`):**\n    *   Lifecycle: Transient/Pooled.\n    *   Usage: Provides dependencies needed strictly for View rendering or local logic.\n\n#### 2. Navigation (`a-navigator`)\n*   **Single Activity:** `MainActivity` acts as the container.\n*   **StatefulView:** All pages (e.g., `HomePage`, `NotesPage`) extend `StatefulView`.\n*   **Configuration:** `NavConfiguration` maps String routes (e.g., `/home`) to `StatefulViewFactory` implementations.\n*   **Back Stack:** `Navigator` manages the stack of views. `onBackPressed` is intercepted and delegated to the Navigator.\n\n#### 3. Reactive Lifecycle Management\n*   **RxJava3 / RxAndroid:** Used for all asynchronous operations and event handling.\n*   **RxDisposer:** A custom helper class that manages `Disposable` objects.\n    *   It is provided via DI and linked to the lifecycle of the Provider/Component.\n    *   When a `StatefulView` is disposed, its associated Provider (and thus `RxDisposer`) cleans up all active subscriptions, preventing memory leaks.\n\n### Architecture Diagram\n\n```mermaid\ngraph TD\n    subgraph \"Base Module\"\n        DB[(Room Database)]\n        DAO[DAOs]\n        Entity[Entities]\n    end\n\n    subgraph \"App Module\"\n        subgraph \"DI Layer\"\n            AppProv[AppProvider]\n            ActProv[ActivityProvider]\n            CmdProv[CommandProvider]\n        end\n\n        subgraph \"UI Layer\"\n            Act[MainActivity]\n            Nav[Navigator]\n            View[\"StatefulView (Page)\"]\n        end\n\n        subgraph \"Logic Layer\"\n            Cmd[\"Command (Business Logic)\"]\n            Notif[\"Notifier (Event Bus)\"]\n        end\n    end\n\n    AppProv --\u003e ActProv\n    Act --\u003e ActProv\n    ActProv --\u003e Nav\n    Nav --\u003e View\n    View --\u003e|Injects| CmdProv\n    CmdProv --\u003e|Creates| Cmd\n    Cmd --\u003e|Updates| DAO\n    DAO --\u003e|Persists| DB\n    Cmd --\u003e|Triggers| Notif\n    Notif --\u003e|Emits to| View\n```\n\n## Workflow \u0026 Logic Flow\n\n### 1. Command Execution Pattern (Business Logic)\nThe app strictly separates UI from Data Logic using the **Command Pattern**.\n\n1.  **UI Action:** User performs an action (e.g., \"Save Note\").\n2.  **Command Creation:** View requests a Command instance (e.g., `UpdateNoteCmd`) from `CommandProvider`.\n3.  **Execution:** Command runs on a background thread (`ExecutorService`).\n4.  **Persistence:** Command calls `NoteDao` to write to SQLite.\n5.  **Notification:** Upon success, Command calls `NoteChangeNotifier`.\n6.  **Reaction:** The Notifier emits an event. Active Views listening to this notifier (via `RxDisposer`) update their state.\n\n#### Sequence Diagram\n\n```mermaid\nsequenceDiagram\n    participant User\n    participant View as StatefulView\n    participant Cmd as Command\n    participant DB as AppDatabase\n    participant Bus as Notifier\n\n    User-\u003e\u003eView: Click Save\n    View-\u003e\u003eCmd: Execute(Data)\n    activate Cmd\n    Cmd-\u003e\u003eDB: Insert/Update\n    DB--\u003e\u003eCmd: Success\n    Cmd-\u003e\u003eBus: notifyChanged(Data)\n    deactivate Cmd\n    Bus--\u003e\u003eView: onNext(Data)\n    View-\u003e\u003eView: updateUI()\n```\n\n### 2. Domain Model Relationships\nThe domain follows a strict hierarchy rooted in the **Profile**.\n\n*   **Profile:** Top-level entity. Represents a person.\n*   **Note:** Medical entry. **Belongs to** a Profile.\n*   **Medicine:** Medication details. **Belongs to** a Note.\n*   **MedicineReminder:** Schedule config. **Belongs to** a Medicine.\n*   **MedicineIntake:** History log. **Belongs to** a Medicine.\n\n#### Entity Relationship Diagram\n\n```mermaid\nerDiagram\n    PROFILE ||--o{ NOTE : has\n    NOTE ||--o{ MEDICINE : contains\n    NOTE ||--o{ NOTE_ATTACHMENT : has\n    MEDICINE ||--o{ MEDICINE_REMINDER : schedules\n    MEDICINE ||--o{ MEDICINE_INTAKE : history\n```\n\n## Screenshots\n\u003cimg src=\"https://github.com/rh-id/a-medic-log/blob/master/fastlane/metadata/android/en-US/images/featureGraphic.png\" width=\"1024\"/\u003e\n\n\u003cimg src=\"https://github.com/rh-id/a-medic-log/blob/master/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png\" height=\"512\"/\u003e\n\u003cimg src=\"https://github.com/rh-id/a-medic-log/blob/master/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png\" height=\"512\"/\u003e\n\u003cimg src=\"https://github.com/rh-id/a-medic-log/blob/master/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png\" height=\"512\"/\u003e\n\n## Support this project\nConsider donation to support this project\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003ca href=\"https://trakteer.id/rh-id\"\u003ehttps://trakteer.id/rh-id\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frh-id%2Fa-medic-log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frh-id%2Fa-medic-log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frh-id%2Fa-medic-log/lists"}