A comprehensive healthcare solution combining AI symptom triage, telemedicine, digital health records, and emergency response
Features β’ Tech Stack β’ Getting Started β’ Documentation β’ Contributing
- Overview
- Features
- Tech Stack
- Architecture
- Prerequisites
- Getting Started
- Running the Application
- API Documentation
- Testing
- Deployment
- Project Structure
- Contributing
- License
- Disclaimer
CareLink is an enterprise-grade, AI-powered healthcare platform that bridges the gap between patients and medical care. It combines cutting-edge machine learning, natural language processing, and telemedicine capabilities to provide:
- π€ Intelligent symptom triage with ML-based risk assessment (LOW/MEDIUM/HIGH)
- π©Ί Medical image analysis using Vision-Language Models (VLM)
- π¨ββοΈ Telemedicine consultations (video, audio, text)
- π Digital health records management with HIPAA-compliant storage
- π¨ Emergency response system with GPS hospital location and first-aid guidance
- π Medicine & pharmacy search with price comparison
- π Multilingual support (English, Spanish, French)
- Free-text symptom input with NLP extraction
- Machine learning risk classification (LOW/MEDIUM/HIGH)
- Clinical safety rule engine with 8+ deterministic rules
- Confidence-based escalation for quality control
- Patient-friendly explanations in multiple languages
- Emergency flag auto-detection
- Complete audit trail for compliance
- Medical photo capture and upload
- AI-powered image analysis using MedGemma 4B-IT Vision-Language Model
- Severity assessment from medical images
- Finding extraction and labeling
- Non-diagnostic reference with compliance disclaimers
- Video consultations with real-time video streaming
- Audio consultations for phone-based support
- Text consultations via secure chat
- Doctor authentication and verification
- Digital prescriptions and referrals
- Appointment scheduling and reminders
- Consultation history tracking
- Complete health profile management
- Medical history, immunizations, test reports
- Medication tracking with adherence monitoring
- Trend analysis for health metrics (BP, glucose, weight)
- QR code sharing for emergency access
- Data access audit logs (HIPAA-compliant)
- Export in standard formats
- One-tap SOS emergency activation
- GPS-based nearest hospital location
- Automatic emergency contact notification
- AI-guided first-aid instructions
- Crisis navigation with step-by-step guidance
- Post-emergency follow-up reminders
- Comprehensive medicine database search
- GPS-based pharmacy locator
- Real-time price comparison across pharmacies
- Generic alternative suggestions
- Digital prescription upload
- Purchase tracking
- Appointment reminders
- Medication schedules and adherence alerts
- Health alerts for unusual readings
- Test result notifications
- Telemedicine updates
- English, Spanish, French
- Real-time language switching
- AI responses in user's preferred language
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Framework | React Native | 0.83.2 | Cross-platform mobile development |
| Build System | Expo | ~55.0.4 | Development & build toolchain |
| UI Library | React | 19.2.0 | Component architecture |
| Navigation | React Navigation | 7.x | Screen navigation |
| State Management | Context API | - | Global state management |
| Backend Client | Supabase JS | 2.98.0 | Database & auth integration |
| Storage | AsyncStorage | 2.2.0 | Local data persistence |
Key Expo Modules:
expo-camera- Medical image captureexpo-image-picker- Image/file uploadsexpo-local-authentication- Biometric securityexpo-location- GPS for hospital locationexpo-print&expo-sharing- Document exportexpo-updates- Over-the-air updates
| Component | Technology | Version | Purpose |
|---|---|---|---|
| API Framework | FastAPI | 0.109.0 | RESTful microservice |
| Server | Uvicorn | 0.27.0 | ASGI application server |
| ML Framework | Scikit-Learn | 1.4.0 | Risk classification |
| Boosting Model | XGBoost | 2.0.3 | Enhanced predictions |
| NLP Engine | spaCy | 3.7.2 | Entity extraction & tokenization |
| LLM Framework | HuggingFace Transformers | 4.50+ | Vision-Language Models |
| Model Optimization | BitsAndBytes | 0.43+ | 4-bit quantization for GPU |
| VLM Model | MedGemma 4B-IT | Latest | Medical image analysis |
| Data Processing | Pandas + NumPy | Latest | Feature engineering |
Security & Monitoring:
- JWT authentication with
python-jose - Password hashing with
passlib[bcrypt] - Prometheus metrics export
- Structured JSON logging
| Component | Technology | Purpose |
|---|---|---|
| Primary Database | Supabase (PostgreSQL) | User data, health records, chat history |
| Local Database | SQLite | Audit trails, prediction cache |
| ORM | SQLAlchemy | Database abstraction layer |
| File Storage | Supabase Storage | Medical images, test reports |
| Component | Technology | Purpose |
|---|---|---|
| Containerization | Docker | Backend deployment |
| Orchestration | Docker Compose | Local development |
| CI/CD | GitHub Actions | Automated testing & deployment |
| Mobile Deployment | Expo EAS | Android/iOS builds |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Mobile App (React Native) β
β βββββββββββ ββββββββββββ βββββββββββ ββββββββββββββββ β
β β Symptom β β Tele β β Health β β Emergency β β
β β Triage β β Medicine β β Records β β Response β β
β ββββββ¬βββββ ββββββ¬ββββββ ββββββ¬βββββ ββββββββ¬ββββββββ β
βββββββββΌβββββββββββββΌββββββββββββββΌββββββββββββββββΌββββββββββ
β β β β
ββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββ
β
βββββββββΌβββββββββ
β API Gateway β
βββββββββ¬βββββββββ
β
βββββββββββββββββββββΌββββββββββββββββββββ
β β β
βββββββββΌβββββββββ βββββββββΌβββββββββ ββββββββΌβββββββ
β AI Microserviceβ β Supabase β β External β
β (FastAPI) β β PostgreSQL β β APIs β
β β β β β β
β βββββββββββββββ β β ββββββββββββββ β β - Maps β
β β ML Model β β β β Users β β β - Pharmacy β
β β Triage β β β β Health Rec β β β - Translationβ
β βββββββββββββββ β β β Chat Hist β β βββββββββββββββ
β βββββββββββββββ β β β Appts β β
β β VLM Model β β β ββββββββββββββ β
β β MedGemma 4B β β β β
β βββββββββββββββ β β ββββββββββββββ β
β βββββββββββββββ β β β Storage β β
β β NLP Engine β β β β (Images) β β
β β spaCy β β β ββββββββββββββ β
β βββββββββββββββ β ββββββββββββββββββ
β βββββββββββββββ β
β β Rules Engineβ β
β β Clinical β β
β βββββββββββββββ β
βββββββββββββββββββ
User Input β NLP Processing β Feature Engineering β ML Classification
β β β β
Symptom Text Entity Extract Feature Vector Risk Prediction
β β β β
Clinical Rules Engine Override (if triggered)
β
Confidence Controller Check
β
Explanation Generation (LLM)
β
JSON Response to Mobile
Before you begin, ensure you have the following installed:
- Node.js >= 16.x (Download)
- npm or yarn (comes with Node.js)
- Expo CLI (install via
npm install -g expo-cli) - Android Studio (for Android development) or Xcode (for iOS development)
- Expo Go app on your mobile device (for testing)
- Python >= 3.11 (Download)
- pip (Python package manager)
- virtualenv or venv for virtual environments
- Docker & Docker Compose (optional, for containerized deployment)
- CUDA-capable GPU (optional, for VLM model - falls back to CPU)
- Supabase Account (Sign up free)
- Supabase CLI (optional, for local development)
-
Navigate to AI service directory
cd ai-service -
Create Python virtual environment
python -m venv venv # On Windows venv\Scripts\activate # On macOS/Linux source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Download spaCy language model
python -m spacy download en_core_web_sm
-
Set up environment variables
Create a
.envfile in theai-servicedirectory:# Environment ENVIRONMENT=development DEBUG=true LOG_LEVEL=INFO # Server Configuration HOST=0.0.0.0 PORT=8000 CORS_ORIGINS=http://localhost:3000,http://localhost:19006 # Model Configuration MODEL_VERSION=v1.0.0 CONFIDENCE_THRESHOLD=0.6 ESCALATION_THRESHOLD=0.75 # Security API_KEY_ENABLED=false API_KEY=your-secret-api-key-here # Monitoring ENABLE_METRICS=true ENABLE_AUDIT_LOGGING=true
-
Generate training data and train ML model
# Generate synthetic training data python data/synthetic_generator.py # Train the ML model python training/train_model.py
-
Run the AI service
# Development mode with auto-reload python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000 # Or use Docker docker-compose up -d
-
Verify installation
Open your browser and navigate to:
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Metrics: http://localhost:8000/api/v1/metrics
-
Navigate to mobile app directory
cd CareLink -
Install dependencies
npm install # or yarn install -
Configure Supabase
Create a
src/config/supabase.jsfile:export const SUPABASE_URL = 'https://your-project.supabase.co'; export const SUPABASE_ANON_KEY = 'your-anon-key-here';
Get these values from your Supabase Dashboard.
-
Configure AI Service endpoint
Update
src/services/aiService.jswith your backend URL:const AI_SERVICE_URL = 'http://localhost:8000'; // or your deployed URL
-
Run database migrations
npm run db:push
-
Seed initial data (optional)
npm run seed
-
Start the development server
npm start # or expo start -
Run on device/emulator
- Press
afor Android emulator - Press
ifor iOS simulator (macOS only) - Scan QR code with Expo Go app on your physical device
- Press
-
Create a Supabase project
- Go to Supabase Dashboard
- Click "New Project"
- Note your project URL and anon key
-
Run database migrations
cd supabase npx supabase db push -
Set up storage buckets
In Supabase Dashboard β Storage, create buckets:
medical-images(for medical photos)health-reports(for test results, PDFs)profile-pictures(for user avatars)
-
Install Supabase CLI
npm install -g supabase
-
Initialize Supabase locally
cd supabase supabase start -
Access local services
- API: http://localhost:54321
- Studio: http://localhost:54323
- Database: postgresql://postgres:postgres@localhost:54322/postgres
-
Terminal 1 - Backend AI Service
cd ai-service source venv/bin/activate # On Windows: venv\Scripts\activate python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Terminal 2 - Mobile App
cd CareLink npm start -
Terminal 3 - Supabase (if local)
cd supabase supabase start -
Open Expo Go on your mobile device and scan the QR code
# From ai-service directory
docker-compose up -d
# Verify services
docker-compose ps
docker-compose logs -f carelink-aicd CareLink
eas build --profile development --platform android# Android
eas build --profile production --platform android
# iOS (requires Apple Developer account)
eas build --profile production --platform ioshttp://localhost:8000/api/v1
POST /triage/predict
Content-Type: application/json
{
"symptoms_text": "I have chest pain and shortness of breath",
"age": 45,
"duration_days": 1,
"chronic_conditions": ["diabetes", "hypertension"],
"language": "en"
}Response:
{
"prediction": "HIGH",
"probabilities": {
"low": 0.05,
"medium": 0.15,
"high": 0.80
},
"confidence": 0.89,
"rules_triggered": ["CHEST_PAIN_CARDIOVASCULAR"],
"explanation": "Based on your symptoms, immediate medical attention is recommended...",
"emergency_flag": true,
"escalated": false,
"model_version": "v1.0.0",
"request_id": "req_abc123",
"timestamp": "2024-01-15T10:30:00Z"
}POST /triage/analyze-image
Content-Type: multipart/form-data
image: <binary file>
clinical_question: "What does this rash look like?"POST /triage/chat
Content-Type: application/json
{
"message": "What should I do for a headache?",
"context": {
"previous_messages": [],
"user_profile": {}
},
"language": "en"
}GET /healthGET /api/v1/metrics/prometheusOnce the backend is running, visit:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
cd ai-service
# Run all tests
pytest tests/ -v
# Run with coverage report
pytest tests/ --cov=app --cov-report=html
# Run specific test file
pytest tests/test_routes.py -v
# View coverage report
open htmlcov/index.html # On macOScd CareLink
# Run tests (when configured)
npm test
# Run linting
npm run lint- User registration and login
- Symptom triage with various inputs
- Medical image upload and analysis
- Telemedicine appointment booking
- Health records viewing and editing
- Emergency SOS activation
- Medicine search and pharmacy location
- Language switching (EN/ES/FR)
- Notification preferences
- Profile settings update
cd ai-service
# Build image
docker build -t carelink-ai:latest .
# Run container
docker run -d \
-p 8000:8000 \
-e ENVIRONMENT=production \
-e API_KEY_ENABLED=true \
-e API_KEY=your-production-key \
--name carelink-ai \
carelink-ai:latestAWS EC2 / Google Cloud / Azure VM:
- Set up virtual machine with Python 3.11+
- Clone repository
- Install dependencies
- Configure systemd service
- Set up reverse proxy (Nginx)
- Configure SSL with Let's Encrypt
Heroku:
heroku create carelink-ai
git subtree push --prefix ai-service heroku mainRailway / Render:
- Connect GitHub repository
- Set build command:
pip install -r requirements.txt - Set start command:
uvicorn app.main:app --host 0.0.0.0 --port $PORT
cd CareLink
# Configure EAS
eas build:configure
# Build for Android
eas build --platform android --profile production
# Build for iOS
eas build --platform ios --profile production
# Submit to stores
eas submit --platform android
eas submit --platform iosnpm run web
# Build for production
expo build:web
# Deploy to Netlify/Vercel
netlify deploy --dir=web-build --prodSupabase automatically handles:
- Database backups
- Scaling
- Security updates
- SSL encryption
For production:
- Upgrade to Supabase Pro plan (if needed)
- Set up database backups
- Configure row-level security (RLS) policies
- Enable Point-in-Time Recovery (PITR)
CareLink-/
βββ CareLink/ # Mobile app (React Native + Expo)
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ context/ # Context providers (Auth, Language)
β β βββ i18n/ # Internationalization (EN/ES/FR)
β β βββ navigation/ # React Navigation setup
β β βββ screens/ # All app screens
β β β βββ ai/ # AI chat screens
β β β βββ auth/ # Login, signup, onboarding
β β β βββ emergency/ # Emergency response
β β β βββ health/ # Health records
β β β βββ home/ # Home dashboard
β β β βββ medicine/ # Medicine search
β β β βββ notifications/ # Notifications
β β β βββ settings/ # Settings
β β β βββ symptomChecker/ # Symptom triage
β β β βββ telemedicine/ # Telemedicine
β β βββ services/ # API services
β β β βββ aiService.js # AI backend integration
β β β βββ supabase.js # Supabase client
β β β βββ medicineService.js
β β β βββ translationService.js
β β βββ theme/ # UI theming
β βββ assets/ # Images, fonts, icons
β βββ App.js # Root component
β βββ app.json # Expo configuration
β βββ eas.json # EAS Build configuration
β βββ package.json # Dependencies
β
βββ ai-service/ # Backend AI microservice (FastAPI)
β βββ app/
β β βββ api/ # API routes & schemas
β β βββ core/ # Configuration, logging, security
β β βββ services/ # Business logic
β β β βββ triage_service.py # ML triage
β β β βββ rule_engine.py # Clinical rules
β β β βββ confidence_controller.py
β β β βββ explanation_service.py # LLM explanations
β β βββ models/ # ML model artifacts
β β βββ nlp/ # NLP preprocessing
β β βββ monitoring/ # Metrics & audit logs
β β βββ main.py # FastAPI app
β βββ data/ # Training data
β β βββ synthetic_generator.py
β βββ training/ # Model training scripts
β β βββ train_model.py
β βββ tests/ # Test suite
β βββ Dockerfile # Docker configuration
β βββ docker-compose.yml # Local deployment
β βββ requirements.txt # Python dependencies
β βββ README.md # AI service docs
β
βββ supabase/ # Database & backend
β βββ migrations/ # Database migrations
β βββ config.toml # Supabase configuration
β βββ seed.sql # Initial data
β
βββ original_assets/ # Design assets
βββ PRESENTATION_ANALYSIS.md # Technical documentation
βββ README.md # This file
We welcome contributions to CareLink! Here's how you can help:
-
Fork the repository
git clone https://github.com/yourusername/carelink.git cd carelink -
Create a feature branch
git checkout -b feature/your-feature-name
-
Make your changes
- Write clean, documented code
- Follow existing code style
- Add tests for new features
- Update documentation as needed
-
Test your changes
# Backend tests cd ai-service && pytest tests/ -v # Frontend linting cd CareLink && npm run lint
-
Commit your changes
git add . git commit -m "feat: add new feature description"
Use conventional commits:
feat:new featurefix:bug fixdocs:documentationstyle:formattingrefactor:code restructuringtest:adding testschore:maintenance
-
Push and create Pull Request
git push origin feature/your-feature-name
- Frontend: Follow React Native best practices, use functional components
- Backend: Follow PEP 8, use type hints, document functions
- Commit Messages: Use conventional commits format
- Testing: Aim for >80% code coverage
- Documentation: Update README and inline comments
- π Bug fixes
- β¨ New features
- π Documentation improvements
- π Translations (add new languages)
- π¨ UI/UX enhancements
- β‘ Performance optimizations
- π§ͺ Test coverage improvements
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 CareLink Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
IMPORTANT: THIS SOFTWARE IS FOR EDUCATIONAL AND DEMONSTRATION PURPOSES ONLY
CareLink is a demonstration project and is NOT intended for actual clinical use without proper:
- β Medical device regulatory approval (FDA, CE, etc.)
- β Clinical validation studies
- β HIPAA compliance certification
- β Professional liability insurance
- β Medical oversight and governance
- β Data security audits
- β Legal review in your jurisdiction
- This application does NOT replace professional medical advice
- Always consult a qualified healthcare provider for medical concerns
- The AI predictions are probabilistic and may be inaccurate
- Do NOT use for emergency medical situations - call emergency services (911, etc.)
- The application is provided "AS IS" without warranty of any kind
- Implement proper PHI (Protected Health Information) safeguards before production use
- Ensure compliance with HIPAA, GDPR, and local healthcare data regulations
- Use end-to-end encryption for sensitive data
- Obtain proper informed consent from users
The developers and contributors assume NO liability for:
- Medical decisions made based on this application
- Data breaches or security incidents
- Regulatory violations
- Any damages arising from use of this software
For production healthcare deployment, consult with:
- Healthcare legal experts
- Medical device regulatory consultants
- HIPAA compliance specialists
- Licensed medical professionals
- π¬ GitHub Discussions
- π Issue Tracker
- π§ Email: kabilash0108@gmail.com
- π§ Email: nsdshakthi@gmail.com
- π§ Email: mritulashankar@gmail.com
- π§ Email: fspavitra11@gmail.com
- MedGemma - Medical Vision