https://github.com/jaspreetsingh-exe/medxpert-frontend
MedXpert is an Android-based healthcare application that leverages OCR (Tesseract, pdfplumber) and LLMs (OpenAI GPT-3.5) to automate medical report extraction, abnormality detection, and natural language summarization. It features Firebase-powered user authentication, role-based access control, and real-time chatbot integration for medical queries.
https://github.com/jaspreetsingh-exe/medxpert-frontend
android-application chatbot fastapi firebase firestore gpt35turbo healthcare image-to-text kotlin llm medical-report ocr openai-api pdf-to-text python summarization
Last synced: 3 months ago
JSON representation
MedXpert is an Android-based healthcare application that leverages OCR (Tesseract, pdfplumber) and LLMs (OpenAI GPT-3.5) to automate medical report extraction, abnormality detection, and natural language summarization. It features Firebase-powered user authentication, role-based access control, and real-time chatbot integration for medical queries.
- Host: GitHub
- URL: https://github.com/jaspreetsingh-exe/medxpert-frontend
- Owner: JaspreetSingh-exe
- License: apache-2.0
- Created: 2025-03-03T19:59:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-05T09:44:17.000Z (over 1 year ago)
- Last Synced: 2025-09-10T23:43:18.910Z (10 months ago)
- Topics: android-application, chatbot, fastapi, firebase, firestore, gpt35turbo, healthcare, image-to-text, kotlin, llm, medical-report, ocr, openai-api, pdf-to-text, python, summarization
- Language: Kotlin
- Homepage:
- Size: 2.98 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MedXpert-FrontEnd
Welcome to **MedXpert-FrontEnd**, the Android application of the **MedXpert** system. MedXpert is a smart medical report analysis platform designed to simplify complex medical documents, highlight abnormal readings, and provide users with a clear, easy-to-understand health summary.
This repository contains the full Android app codebase for the MedXpert system, responsible for interacting with users and displaying simplified medical insights retrieved from the backend.
---
## π₯ Problem Statement & Why MedXpert is Useful
### **The Challenge:**
Understanding medical reports can be challenging for non-medical professionals. Many patients struggle to interpret complex test results, abnormal values, and medical terminology. Additionally, doctors often have limited time to explain reports in detail, leaving patients uncertain about their health conditions.
---
## π How MedXpert Solves This Problem
### Backend:
The backend of MedXpert is responsible for handling the heavy lifting of medical report analysis. It performs the following tasks:
- β
**Extracts Medical Data**: Utilizes advanced OCR technologies like Tesseract and pdfplumber to accurately extract text from PDF and image-based medical reports.
- β
**Summarizes Medical Jargon**: Processes complex medical terminologies and converts them into simplified, understandable summaries using AI-powered language models (OpenAI GPT-3.5).
- β
**Detects Abnormal Readings**: Scans for abnormal values within the report and highlights potential health concerns through AI-driven analysis.
- β
**Powers the Chatbot**: Provides instant, reliable answers to user queries about their medical reports by leveraging LLM (Large Language Model)-based responses.
---
### Frontend:
The frontend of MedXpert provides a seamless and user-friendly Android interface for interacting with the backend features. It handles:
- β
**User-Friendly Interface**: Designed to ensure even non-technical users can easily upload reports and view results.
- β
**Report Upload & Results Display**: Allows users to submit their reports and receive a detailed analysis and summary of the findings.
- β
**Abnormality Highlighting**: Visually marks abnormal values within the summary to help users quickly identify areas of concern.
- β
**User Role Management**: Manages user authentication (guest and logged-in users) and enforces usage limits.
- β
**Chatbot Interaction**: Facilitates communication with the backend chatbot for personalized health insights and explanations.
---
### β
MedXpert makes medical understanding accessible and actionable by:
- β
Providing an intuitive Android app interface.
- β
Allowing users to upload reports and view summaries.
- β
Displaying highlighted abnormalities visually.
- β
Managing user roles, limits, and chatbot interactions.
---
## π₯ Download MedXpert APK
π [**Download Latest APK**](https://github.com/JaspreetSingh-exe/MedXpert-FrontEnd/releases/download/v1.0.0/app-debug.apk)
π‘ Click the link above to download the latest version of the MedXpert app and install it on your Android device.
---
## π Live Demo
βΆοΈ **Click the image below to watch the full demo video:**
[](https://youtu.be/-8R1s6liwyo)
---
## βοΈ Features
- **User authentication (Guest & Logged-in users)**
```kotlin
// β
Signup
FirebaseAuth.getInstance()
.createUserWithEmailAndPassword(email, password)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// Signup success
} else {
// Signup failed
}
}
// β
Signin
FirebaseAuth.getInstance()
.signInWithEmailAndPassword(email, password)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// Signin success
} else {
// Signin failed
}
}
// β
Forgot Password
FirebaseAuth.getInstance()
.sendPasswordResetEmail(email)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// Reset email sent
} else {
// Failed to send reset email
}
}
```
- **Upload medical reports (PDF/Image formats)**
```kotlin
val intent = Intent(Intent.ACTION_GET_CONTENT)
intent.type = "application/pdf"
startActivityForResult(intent, REQUEST_CODE)
```
- **View simplified summaries and abnormalities of your reports**
```kotlin
summaryTextView.text = "Summary: ${viewModel.summary}"
```
- **Usage limits based on user roles**:
- **Logged-in Users** (Limit: 5 uploads per day and 10 chabot queries per day):
```kotlin
if (user.isLoggedIn && dailyUploads >= 10) showLimitReached()
```
- **Guest Users** (Limit: 2 uploads per day and not chabot access):
```kotlin
if (user.isGuest && dailyUploads >= 2) showLimitReached()
```
- **Integrated chatbot**
---
## π οΈ Tech Stack
| Technology | Description |
|-------------------------|-----------------------------------------------------------------------------------------------|
| **Platform** | Android (**Kotlin**) β A modern, concise, and powerful statically typed programming language. |
| **UI Design** | XML Layouts β Declarative UI component design for seamless user experiences. |
| **State Management** | ViewModel + LiveData β Lifecycle-aware components to handle and observe UI-related data. |
| **Authentication** | Firebase Authentication β Secure, scalable user sign-in and account management. |
| **Backend Integration** | OkHttp β Efficient and powerful HTTP client for handling API communication. |
| **Cloud Services** | Firebase β Realtime database, storage, analytics, and backend services. |
| **Deployment** | Google Play Store *(coming soon)* β For global Android app distribution. |
---
### π Example Integrations:
#### OkHttp Setup:
```kotlin
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.medxpert.com/")
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
// Handle failure
}
override fun onResponse(call: Call, response: Response) {
// Handle response
}
})
```
#### Firebase Authentication:
```kotlin
FirebaseAuth.getInstance().signInWithEmailAndPassword(email, password)
.addOnCompleteListener { task ->
if (task.isSuccessful) {
// User signed in successfully
}
}
```
---
## π Project Structure
```
MedXpert/
βββ manifests/
β βββ AndroidManifest.xml # Defines essential app configurations and permissions.
βββ java/
β βββ com.example.medxpert
β βββ adapters/ # Handles data population in RecyclerViews.
β β βββ ChatAdapter.kt # Manages chat messages display.
β β βββ ReportAdapter.kt # Manages report items in a list.
β β βββ UserAdapter.kt # Manages user list and interactions.
β βββ fragments/ # Modular UI components for various screens.
β β βββ ChatBotFragment.kt # Chat interface with the medical assistant.
β β βββ ChatIntroFragment.kt # Introduction to chatbot features.
β β βββ ResultsFragment.kt # Displays analyzed medical report results.
β β βββ UploadFragment.kt # Handles medical report upload.
β βββ models/ # Data classes used across the app.
β β βββ Report.kt # Represents a medical report structure.
β β βββ User.kt # Represents user profile information.
β β βββ Message.kt # Represents chat message data.
β βββ DashBoardActivity.kt # Post-login dashboard.
β βββ ForgotPasswordActivity.kt # Allows users to recover passwords.
β βββ MainActivity.kt # App's main entry point handling navigation.
β βββ ProfileActivity.kt # Displays and updates user profile.
β βββ SignInActivity.kt # Manages login functionality.
β βββ SignUpActivity.kt # Handles user registration.
β βββ SplashActivity.kt # Displays splash screen on app startup.
βββ res/
β βββ drawable/ # Contains image assets and vector graphics.
β βββ layout/ # Holds all XML UI layout files.
β βββ activity_dash_board.xml # Layout for the dashboard screen.
β βββ activity_forgot_password.xml # Layout for password recovery.
β βββ activity_main.xml # Main container layout.
β βββ activity_profile.xml # User profile screen layout.
β βββ activity_sign_in.xml # Login screen layout.
β βββ activity_sign_up.xml # Registration screen layout.
β βββ activity_splash.xml # Splash screen layout.
β βββ dialog_loading.xml # Loading dialog layout.
β βββ dialog_reset_success.xml # Success dialog after password reset.
β βββ dialog_verification.xml # Verification dialog layout.
β βββ fragment_chat_bot.xml # ChatBot UI layout.
β βββ fragment_chat_intro.xml # Intro screen for chatbot.
β βββ fragment_results.xml # Displays report results.
β βββ fragment_upload.xml # Upload report screen layout.
β βββ item_chat_ai.xml # Layout for AI chat messages.
β βββ item_chat_user.xml # Layout for user chat messages.
β βββ mipmap/ # App launcher icons.
β βββ raw/ # Stores raw assets like instructional videos.
β βββ values/ # XML files for app-wide constants (strings, colors, themes).
βββ build.gradle.kts # Gradle build script for project dependencies and settings.
βββ proguard-rules.pro # Rules for code obfuscation and optimization.
βββ google-services.json # Firebase configuration file.
βββ README.md # Project documentation.
```
---
## π Installation
### 1. Clone the repository
To clone the project repository, use the following commands:
```bash
git clone https://github.com/JaspreetSingh-exe/MedXpert-FrontEnd.git
cd MedXpert-FrontEnd
```
### 2. Open in Android Studio
Follow these steps to open the project:
- Launch **Android Studio**.
- Select **Open an existing project**.
- Navigate to the cloned directory and select the project.
### 3. Setup environment
Ensure the following configurations:
- Add your Firebase configuration file `google-services.json` to the `/app` directory.
- Connect your project with Firebase through the Firebase Console.
- Define your backend API endpoints in the appropriate service classes.
### 4. Add api_url in `strings.xml`
```xml
https://api.medxpert.com/
```
### 5. Build and run
To run the project:
- Click on the **Run** button or use the shortcut `Shift + F10`.
- Choose a connected device or emulator for testing.
---
## π Backend Integration
The MedXpert Android app communicates with the MedXpert Backend API to provide the core functionalities of the application. The backend processes and returns the necessary data, and the frontend handles the presentation and interaction.
### π How the Backend Works with the Frontend:
- **Medical Report Analysis**: When a user uploads a report, the frontend sends the file via an HTTP request to the backend. The backend performs OCR and text extraction, then analyzes the data to detect abnormalities and generate summaries.
- **Summary Generation**: The backend uses AI-powered language models to convert complex medical data into simplified summaries and returns them to the frontend for display.
- **Usage Management**: The backend tracks the number of uploads and chatbot interactions per user and enforces daily usage limits.
- **Chatbot Integration**: The chatbot interface on the app sends user queries to the backend, which generates intelligent, context-aware responses using LLMs.
### π Backend Repository
π [MedXpert-Backend Repository](https://github.com/JaspreetSingh-exe/MedXpert-Backend-FastAPI)
---
## π§© Future Improvements
### πΉ Dark Mode
Introduce a dark theme option to reduce eye strain and provide a comfortable user experience in low-light conditions.
### πΉ Upload History and Tracking
Add functionality for users to access and manage a history of their uploaded reports, enabling easy review and re-analysis.
### πΉ Multi-language Support
Implement support for multiple languages to make the app accessible to a global user base, breaking language barriers in healthcare.
### πΉ Offline Support
Allow users to view previously analyzed reports and summaries without needing an active internet connection.
---
## π€ Open for Contributions
We welcome contributions from developers and UI/UX designers to enhance the MedXpert Application! If you would like to contribute, hereβs how you can help:
### **How to Contribute**
1. **Fork the Repository**: Click on the "Fork" button at the top right of this repository.
2. **Clone Your Fork**: Clone the repository to your local machine.
```bash
git clone https://github.com/JaspreetSingh-exe/MedXpert-FrontEnd.git
cd MedXpert-FrontEnd
```
3. **Create a New Branch**: Make sure to create a new branch for your changes.
```bash
git checkout -b feature-new-enhancement
```
4. **Make Your Changes**: Add new features, fix bugs, or improve documentation.
5. **Commit and Push**: Commit your changes and push to your fork.
```bash
git add .
git commit -m "Added a new feature"
git push origin feature-new-enhancement
```
6. **Create a Pull Request**: Submit a pull request (PR) to the `main` branch of this repository.
### **Guidelines for Contributions**
- Follow best practices for **code structure, comments, and documentation**.
- Ensure that your code **passes all tests and does not break existing functionality**.
- If adding a new feature, please **update the documentation accordingly**.
- Be **respectful and collaborative** when reviewing and discussing PRs.
Join me in making **MedXpert a powerful and intelligent AI-based medical report analyzer**! π
---
## π Support
If you encounter any issues, feel free to create an issue on GitHub.
For any queries reach out at `jaspreetsingh01110@gmail.com`
---
## π License
This project is licensed under the **Apache License 2.0**. See `LICENSE` for details.
---
> β Don't forget to **star** this repo if you like the project!