docs: update project documentation and expand mobile technical details#285
Conversation
* **docs(root):** significantly expanded the `README.md` with a detailed mobile project structure, compilation instructions for Android/iOS, and updated the tech stack to reflect Compose Multiplatform. * **docs(root):** added prerequisites for mobile development, including JDK 17+, Android Studio, and Xcode requirements. * **docs(mobile):** completely overhauled the mobile-specific `README.md` to provide a deep dive into the technical architecture (Clean Architecture + MVI). * **docs(mobile):** documented key technical features including Ktor silent token rotation, native multiplatform audio recording (AAC), and Flow-based AI status polling. * **docs(mobile):** added visual documentation links and layout flows for various user roles (Patient, Doctor, Secretary, Manager). * **docs(mobile):** specified library versions for Ktor (3.3.2), Koin (4.1.1), and Compose Multiplatform (1.9.0). * **docs(mobile):** defined client-side validation rules, such as the 10MB multipart upload limit.
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe root and mobile READMEs were expanded with updated product architecture, Kotlin Multiplatform implementation details, role-based capabilities, screen references, development prerequisites, build instructions, and mobile testing commands. ChangesDocumentation updates
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Updated README.md to enhance clarity and detail regarding the medAI Mobile Client's features and functionality, including improvements to the authentication process and polling mechanism.
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mobile/MedAI/README.md`:
- Line 212: Add concise, workflow-specific alt text to every documented
screenshot image and add fallback descriptive text for each video in the README
media entries, including the referenced locations. Update only the media markup
while preserving the existing layout and video attributes.
- Line 78: Replace the machine-specific file:// links in the README, including
the references near the MviScreenModel description and lines 150-151, with
repository-relative links. Update the line 285 link to use an anchor matching
the current root heading, and preserve the existing link targets and
descriptions.
- Around line 115-143: Update the README Auth example to match the
implementation in KtorClient.kt: represent refresh-token retrieval from saved
cookies and call clearSession() when the refreshed access token is unavailable.
Alternatively, clearly label the snippet as pseudocode, but do not present
behavior that differs from the actual client as exact implementation.
- Around line 32-40: Update the “Local Storage” description in the README to
call Jetpack DataStore persistent key-value storage rather than secure storage,
reflecting the plain DataStore<Preferences> usage by InMemoryUserSessionManager;
do not claim encryption unless an existing encryption layer is documented.
In `@README.md`:
- Around line 287-297: Update the “Run Android Application” section to clarify
that :composeApp:installDebug only builds and installs the Android app; either
rename the step to “Build & install” or add explicit instructions for launching
the installed application.
- Around line 300-305: Update the “Run iOS Application” instructions so the
introductory text matches the artifact opened by the command: refer to
iosApp.xcodeproj as the Xcode project, or change the command to open the
repository’s actual workspace if that is the intended artifact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: accf248e-754e-4786-a94b-ff378dedf972
📒 Files selected for processing (2)
README.mdmobile/MedAI/README.md
| - **Dependency Injection**: [Koin](https://insert-koin.io/) for cross-platform, compile-safe dependency graphs. | ||
| - **Network Engine**: [Ktor Client 3.3.2](https://ktor.io/) with native transport engines: | ||
| - `OkHttp` for Android (optimized pooling and connection reuse). | ||
| - `Darwin` for iOS (integrates with Apple's native URLSession network stack). | ||
| - **Navigation Framework**: [Voyager](https://voyager.adriel.cafe/) implementing Screen-model scoping, tabbed workspaces, and animated transitions. | ||
| - **Local Storage**: [Jetpack DataStore (Preferences)](https://developer.android.com/topic/libraries/architecture/datastore) for platform-agnostic, secure key-value storage. | ||
| - **Image Loader**: [Coil 3](https://coil-kt.github.io/coil/) equipped with Ktor Network pipelines for asynchronous, cached image loading. | ||
| - **Concurrency**: Kotlin Coroutines and Flows for event streams and async task handling. | ||
| - **On-Device Diagnostics**: [LiteRT (TensorFlow Lite)](https://ai.google.dev/edge/litert) for running client-side classification and inference on Android. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## README excerpt\n'
nl -ba mobile/MedAI/README.md | sed -n '24,48p'
printf '\n## Search for DataStore/sessionManager/storage wrappers\n'
rg -n --hidden -S "sessionManager|DataStore|Preferences|Keystore|Keychain|encrypt|encrypted|secure key-value|secure storage" mobile/MedAIRepository: MedAI-MU/medai
Length of output: 211
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## File list around mobile/MedAI\n'
git ls-files mobile/MedAI | sed -n '1,200p'Repository: MedAI-MU/medai
Length of output: 19112
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## README excerpt\n'
sed -n '24,48p' mobile/MedAI/README.md | cat -n
printf '\n## DataStore and session-related files\n'
sed -n '1,220p' mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/data/local/DataStoreFactory.kt | cat -n
printf '\n---\n'
sed -n '1,220p' mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/core/data/OnboardingStorage.kt | cat -n
printf '\n---\n'
sed -n '1,220p' mobile/MedAI/composeApp/src/androidMain/kotlin/org/example/project/core/data/OnboardingStorage.android.kt | cat -n
printf '\n---\n'
sed -n '1,220p' mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/data/repository/InMemoryUserSessionManager.kt | cat -n
printf '\n---\n'
sed -n '1,260p' mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/data/remote/KtorClient.kt | cat -n
printf '\n---\n'
sed -n '1,220p' mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/data/remote/PersistentCookiesStorage.kt | cat -nRepository: MedAI-MU/medai
Length of output: 23663
Describe DataStore as persistent storage, not secure storage. InMemoryUserSessionManager stores user_token and cookies in plain DataStore<Preferences>; there’s no encryption or Keystore/Keychain wrapper here. Rename this to “persistent key-value storage,” or document the encryption layer if secrets are meant to live there.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@mobile/MedAI/README.md` around lines 32 - 40, Update the “Local Storage”
description in the README to call Jetpack DataStore persistent key-value storage
rather than secure storage, reflecting the plain DataStore<Preferences> usage by
InMemoryUserSessionManager; do not claim encryption unless an existing
encryption layer is documented.
|
|
||
| ### MVI Pattern (Model-View-Intent) | ||
|
|
||
| Each screen operates on a strict unidirectional data flow governed by [MviScreenModel](file:///f:/AndroidStudioProjects/medai/mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/core/presentation/mvi/MviScreenModel.kt): |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Replace machine-specific file:// links with repository-relative links.
These links point to f:/AndroidStudioProjects/..., so they will be broken for every other reader. Line 285 also uses an outdated anchor that does not match the current root heading.
Proposed fix
-[MviScreenModel](file:///f:/AndroidStudioProjects/medai/mobile/MedAI/composeApp/src/commonMain/kotlin/org/example/project/core/presentation/mvi/MviScreenModel.kt)
+[MviScreenModel](composeApp/src/commonMain/kotlin/org/example/project/core/presentation/mvi/MviScreenModel.kt)
-[Android Implementation](file:///f:/AndroidStudioProjects/medai/mobile/MedAI/composeApp/src/androidMain/kotlin/org/example/project/domain/audio/AndroidAudioRecorder.kt)
+[Android Implementation](composeApp/src/androidMain/kotlin/org/example/project/domain/audio/AndroidAudioRecorder.kt)
-[Root README](file:///f:/AndroidStudioProjects/medai/README.md#2-compiling--launching-the-mobile-app)
+[Root README](../../README.md#compiling--running-the-mobile-client)Also applies to: 150-151, 285-285
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@mobile/MedAI/README.md` at line 78, Replace the machine-specific file://
links in the README, including the references near the MviScreenModel
description and lines 150-151, with repository-relative links. Update the line
285 link to use an anchor matching the current root heading, and preserve the
existing link targets and descriptions.
| ### 1. Authentication & Onboarding | ||
| | Patient Onboarding | Doctor/Staff Signup | | ||
| | :---: | :---: | | ||
| | <video src="https://github.com/user-attachments/assets/32d3a704-dbb0-4591-aa10-9d7071d2687a" width="250" autoplay loop muted controls></video> | <img src="https://github.com/user-attachments/assets/a1d8cff9-5ac6-4b4b-ad71-c1aa15792426" width="250" /> | |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Add alternative text to the documented media.
The screenshots currently have no alt text, preventing screen-reader users from understanding the workflows shown. Add concise descriptions to each image and a fallback description for the video.
Also applies to: 219-220, 227-228, 235-235, 242-243, 250-250
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)
[warning] 212-212: Images should have alternate text (alt text)
(MD045, no-alt-text)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@mobile/MedAI/README.md` at line 212, Add concise, workflow-specific alt text
to every documented screenshot image and add fallback descriptive text for each
video in the README media entries, including the referenced locations. Update
only the media markup while preserving the existing layout and video attributes.
Source: Linters/SAST tools
| #### 2. Run Android Application | ||
| Ensure you have an Android virtual device running or a physical device connected: | ||
| * **macOS / Linux**: | ||
| ```shell | ||
| cd mobile/MedAI | ||
| ./gradlew :composeApp:installDebug | ||
| ``` | ||
| * **Windows**: | ||
| ```shell | ||
| cd mobile\MedAI | ||
| .\gradlew.bat :composeApp:installDebug |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Clarify that installDebug only installs the Android app.
This command does not launch the application. Either rename the step to “Build & install” or add an explicit launch step/instruction.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 287 - 297, Update the “Run Android Application”
section to clarify that :composeApp:installDebug only builds and installs the
Android app; either rename the step to “Build & install” or add explicit
instructions for launching the installed application.
| #### 3. Run iOS Application (macOS required) | ||
| Open the Xcode workspace inside `mobile/MedAI/iosApp`: | ||
| ```bash | ||
| cd mobile/MedAI/iosApp | ||
| open iosApp.xcodeproj | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use consistent Xcode project/workspace terminology.
The text says “Open the Xcode workspace,” but the command opens iosApp.xcodeproj. Either document the project accurately or open the repository’s actual .xcworkspace.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@README.md` around lines 300 - 305, Update the “Run iOS Application”
instructions so the introductory text matches the artifact opened by the
command: refer to iosApp.xcodeproj as the Xcode project, or change the command
to open the repository’s actual workspace if that is the intended artifact.
Updated project description and added platform support badges.
* **docs:** Fixed a trailing whitespace/formatting issue in the technical overview section of the README.
* **style(ai):** Removed trailing whitespace and normalized line spacing throughout `app.py`. * **style(ai):** Added a missing newline at the end of the file for better PEP 8 compliance.
README.mdwith a detailed mobile project structure, compilation instructions for Android/iOS, and updated the tech stack to reflect Compose Multiplatform.README.mdto provide a deep dive into the technical architecture (Clean Architecture + MVI).Summary by CodeRabbit