Skip to content

Latest commit

ย 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฅ GramHealth AI

A Comprehensive Multilingual Medical Consultation App for Rural India

React TypeScript Vite Gemini AI

Connecting Rural India to Healthcare through AI-powered preliminary medical assessments


๐Ÿ“– Overview

GramHealth AI is a cutting-edge healthcare application designed to bridge the healthcare gap in rural India. Using Google's Gemini AI, the app provides preliminary medical assessments through image analysis, video analysis, and voice-based symptom reporting. The application supports multiple Indian languages and offers an accessible, offline-capable solution for communities with limited access to healthcare facilities.

๐ŸŽฏ Key Features

  • ๐Ÿค– AI-Powered Diagnosis: Leverages Gemini 1.5 Pro for advanced medical image and video analysis
  • ๐ŸŒ Multilingual Support: Available in 6 languages - English, Hindi, Tamil, Bengali, Marathi, and Kannada
  • ๐Ÿ“ธ Visual Analysis: Upload photos or videos of symptoms for detailed AI assessment
  • ๐ŸŽ™๏ธ Voice Input: Speak symptoms in your native language for hands-free consultation
  • โ™ฟ Accessibility First:
    • Adjustable font sizes (100%, 125%, 150%)
    • Dark mode support
    • High contrast mode
    • Screen reader friendly
  • ๐Ÿ“Š Detailed Reports:
    • Bounding box detection on images
    • Severity assessment with color-coded indicators
    • Home remedies and doctor visit recommendations
    • Confidence breakdown and explainability
  • ๐Ÿ“ฑ Progressive Web App: Works offline and can be installed on mobile devices
  • ๐Ÿ‘จโ€โš•๏ธ Doctor Portal: Share consultation codes with healthcare professionals
  • ๐Ÿ“ˆ Health History: Track past consultations and progression analysis
  • ๐Ÿ”’ Privacy-Focused: Local data storage with optional sharing

๐Ÿ—๏ธ Project Structure

GramHealthAi/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ index.html              # Main HTML entry point with Tailwind CDN
โ”œโ”€โ”€ ๐Ÿ“„ index.tsx               # React app entry point
โ”œโ”€โ”€ ๐Ÿ“„ App.tsx                 # Main app component with routing and context
โ”œโ”€โ”€ ๐Ÿ“„ package.json            # Project dependencies and scripts
โ”œโ”€โ”€ ๐Ÿ“„ vite.config.ts          # Vite configuration
โ”œโ”€โ”€ ๐Ÿ“„ tsconfig.json           # TypeScript configuration
โ”œโ”€โ”€ ๐Ÿ“„ metadata.json           # App metadata and permissions
โ”œโ”€โ”€ ๐Ÿ“„ types.ts                # TypeScript type definitions
โ”œโ”€โ”€ ๐Ÿ“„ constants.ts            # App constants and translations
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore              # Git ignore rules
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ pages/                  # Application pages
โ”‚   โ”œโ”€โ”€ Home.tsx               # Home page with consultation history
โ”‚   โ”œโ”€โ”€ Consultation.tsx       # Main consultation interface
โ”‚   โ”œโ”€โ”€ Report.tsx             # Detailed analysis report viewer
โ”‚   โ”œโ”€โ”€ DoctorPortal.tsx       # Doctor collaboration interface
โ”‚   โ”œโ”€โ”€ FamilyAccess.tsx       # Family/caregiver access management
โ”‚   โ””โ”€โ”€ Community.tsx          # Community features
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ components/             # Reusable React components
โ”‚   โ”œโ”€โ”€ PermissionScreen.tsx   # Camera/microphone permission handler
โ”‚   โ””โ”€โ”€ LazyImage.tsx          # Lazy-loaded image component
โ”‚
โ””โ”€โ”€ ๐Ÿ“ services/               # Business logic and API services
    โ”œโ”€โ”€ geminiService.ts       # Gemini AI integration
    โ””โ”€โ”€ utils.ts               # Utility functions (caching, haptics, TTS)

๐Ÿ“‚ Key Directories Explained

pages/ - Application Routes

  • Home.tsx: Landing page displaying consultation history with pagination and delete functionality
  • Consultation.tsx: Core consultation flow - symptom input, media upload, voice recording
  • Report.tsx: Comprehensive analysis results with visual overlays and recommendations
  • DoctorPortal.tsx: Interface for healthcare professionals to review shared consultations
  • FamilyAccess.tsx: Manage caregiver permissions and family member access
  • Community.tsx: Community health features and discussion forums

components/ - Reusable UI Components

  • PermissionScreen.tsx: Handles browser permissions for camera and microphone with educational UI
  • LazyImage.tsx: Performance-optimized image loading component

services/ - Core Business Logic

  • geminiService.ts:
    • Handles Gemini AI API integration
    • Implements structured output schema for medical analysis
    • Supports image, video, and text-based consultations
    • Includes caching for improved performance
  • utils.ts:
    • Text-to-speech functionality
    • Haptic feedback utilities
    • Local storage caching mechanism
    • Language-specific voice synthesis

๐Ÿ› ๏ธ Technology Stack

Frontend

  • React 19.2.1 - Modern React with concurrent features
  • TypeScript 5.8.2 - Type-safe development
  • React Router DOM 7.10.1 - Client-side routing
  • Vite 6.2.0 - Lightning-fast build tool and dev server

UI & Styling

  • Tailwind CSS 3.x - Utility-first CSS framework (via CDN)
  • Lucide React 0.556.0 - Beautiful, consistent icons
  • Custom CSS - Glassmorphism effects, animations, accessibility features

AI & APIs

  • Google Gemini AI (@google/genai 1.31.0) - Multimodal AI for medical analysis
  • Web Speech API - Voice input and text-to-speech
  • MediaDevices API - Camera and microphone access
  • Canvas API - Image manipulation and bounding boxes

Additional Tools

  • html2pdf.js (via CDN) - PDF report generation
  • LocalStorage API - Offline data persistence
  • Service Worker Ready - PWA capabilities

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v18 or higher recommended)
  • npm or yarn package manager
  • Google Gemini API Key (Get it here)

Installation

  1. Clone the repository

    git clone https://github.com/kulharshit21/GramHealthAi.git
    cd GramHealthAi
  2. Install dependencies

    npm install
  3. Configure Environment Variables

    Create a .env.local file in the root directory:

    GEMINI_API_KEY=your_gemini_api_key_here
  4. Run the development server

    npm run dev
  5. Open your browser

    Navigate to http://localhost:3000

Build for Production

npm run build

The optimized production build will be in the dist/ directory.

Preview Production Build

npm run preview

๐Ÿ’ป Usage Guide

1๏ธโƒฃ Initial Setup

  • Grant camera and microphone permissions when prompted
  • Complete the onboarding tutorial
  • Accept the medical disclaimer
  • Select your preferred language

2๏ธโƒฃ Start a Consultation

  • Click "Start New Consultation" on the home page
  • Choose your input method:
    • ๐Ÿ“ธ Upload Photo/Video - Capture or select media showing symptoms
    • ๐ŸŽ™๏ธ Voice Input - Describe symptoms verbally
    • โŒจ๏ธ Text Input - Type symptom description

3๏ธโƒฃ Provide Details

  • Duration of symptoms
  • Pain level (1-10 scale)
  • Additional symptoms checklist
  • Upload multiple images/videos if needed

4๏ธโƒฃ Receive Analysis

  • AI processes your input using Gemini 1.5 Pro
  • View detailed diagnosis with:
    • Visual bounding boxes on detected issues
    • Severity assessment (High/Moderate/Healing)
    • Confidence scores
    • Home remedies
    • When to see a doctor
    • Recommended medical tests

5๏ธโƒฃ Take Action

  • Download PDF report
  • Share with doctor via WhatsApp
  • Generate consultation code for Doctor Portal
  • Save to consultation history

๐ŸŽจ Accessibility Features

GramHealth AI is built with accessibility as a core principle:

  • ๐Ÿ”ค Font Scaling: 3 sizes (Normal, Large, Extra Large)
  • ๐ŸŒ™ Dark Mode: Reduces eye strain in low-light conditions
  • ๐Ÿ‘๏ธ High Contrast Mode: Enhanced visibility for visual impairments
  • ๐ŸŽฏ Touch Targets: Minimum 60x60px for easy tapping
  • ๐Ÿ—ฃ๏ธ Text-to-Speech: Reads diagnoses and recommendations aloud
  • โ™ฟ Screen Reader Support: ARIA labels and semantic HTML
  • ๐ŸŒ Multilingual: Native language support for regional users

๐Ÿ” Privacy & Security

  • Local Storage: All data stored on device by default
  • No Mandatory Cloud Sync: Opt-in sharing only
  • Secure API Calls: Environment-based API key management
  • Medical Disclaimer: Clear warnings about AI limitations
  • HIPAA Awareness: Designed with healthcare privacy in mind

๐ŸŒ Supported Languages

Language Code Native Name Flag
English en English ๐Ÿ‡ฌ๐Ÿ‡ง
Hindi hi เคนเคฟเค‚เคฆเฅ€ ๐Ÿ‡ฎ๐Ÿ‡ณ
Tamil ta เฎคเฎฎเฎฟเฎดเฏ ๐Ÿ‡ฎ๐Ÿ‡ณ
Bengali bn เฆฌเฆพเฆ‚เฆฒเฆพ ๐Ÿ‡ฎ๐Ÿ‡ณ
Marathi mr เคฎเคฐเคพเค เฅ€ ๐Ÿ‡ฎ๐Ÿ‡ณ
Kannada kn เฒ•เฒจเณเฒจเฒก ๐Ÿ‡ฎ๐Ÿ‡ณ

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

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

Development Guidelines

  • Follow TypeScript best practices
  • Maintain accessibility standards
  • Add translations for all new UI text
  • Test on multiple screen sizes
  • Ensure offline functionality works

๐Ÿ› Known Issues & Limitations

  • Gemini API requires internet connectivity
  • Video analysis may take longer on slower connections
  • Browser permission denials require manual reset
  • Some languages may have limited TTS voice quality

๐Ÿ“œ License

This project is currently unlicensed. Please contact the repository owner for usage permissions.


๐Ÿ‘จโ€๐Ÿ’ป Author

Harshit Kulkarni


๐Ÿ™ Acknowledgments

  • Google Gemini Team - For the powerful multimodal AI API
  • React Community - For excellent documentation and tools
  • Tailwind CSS - For the utility-first CSS framework
  • Lucide Icons - For beautiful, consistent iconography

๐Ÿ“ž Support

For issues, questions, or suggestions:


Made with โค๏ธ for Rural India

Disclaimer: This app provides preliminary assessments only. Always consult qualified healthcare professionals for medical decisions.

About

GramHealth AI is a multimodal, multilingual healthcare assistant that uses Gemini 3 Pro to analyze symptoms from text, voice, images, and video, then provide preliminary triage and explanations for rural users.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages