Skip to content

CubeStar1/health-monitor-next

Repository files navigation

HealthHub: Health Data Management and AI-Assisted Analysis Platform

This project is a health data management and AI-assisted analysis platform. It combines personal health record management with advanced AI capabilities for data analysis and medical information retrieval using RAG.

Platform Overview

HealthHub Landing Page HealthHub Assistant

AI-Powered Health Assistant

Health Assistant Interface Health assistant powered by a RAG pipeline using Langchain.

Video Assistant Video assistant powered by HeyGen.

Real-Time Health Dashboard

Health Dashboard Overview of your health metrics, vitals, and analytics in one unified interface.

Medical Records & Analysis

Medical Records Records Transcription Secure storage and vectorization of your medical records with automatic transcription.

Health Monitoring & Activities

Real-time Monitoring Activity Tracking Track vital signs in real-time and monitor your daily activities and fitness progress.

Nutrition & Health Reports

Nutrition Tracking Health Reports Monitor your nutrition and generate comprehensive health reports for healthcare providers.

Features

Real-time Health Data Integration & Monitoring

  • Integration with Arduino sensors for vital signs monitoring and live dashboard updates
  • Structured data collection and analysis for health trends via ESP8266 and Supabase

AI-Powered Health Assistant

  • Multi-modal interaction with voice, text, and video interfaces using Gemini 2.0 and HeyGen AI
  • RAG pipeline powered by Langchain for personalized health insights
  • Medical knowledge search and verification using Tavily API

Health Records Management

  • Secure storage and automatic transcription of medical records
  • Document vectorization with Cohere embeddings for semantic search
  • Health reports generation combining structured sensor data and unstructured medical records

Tech Stack

  • Frontend: Next.js with TypeScript
  • Backend: FastAPI (Python)
  • Database: Supabase (PostgreSQL with pgvector extension)
  • AI/ML: Langchain, OpenAI API, Cohere embeddings
  • External APIs: Tavily for medical web search

Getting Started

Prerequisites

  • Node.js (v14 or later)
  • Python (v3.8 or later)
  • Supabase account
  • OpenAI API key
  • Gemini API key
  • Tavily API key
  • Cohere API key
  • Resend API key
  • Nutritionix API key

Installation

  1. Clone the frontend repository:

    git clone https://github.com/CubeStar1/health-monitor-next.git
    cd health-monitor-next
  2. Install frontend dependencies:

    npm install
  3. Clone the Python backend repository:

    git clone https://github.com/CubeStar1/health-monitor-api.git
    cd healthhub-backend
  4. Set up the Python backend:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    pip install -r requirements.txt
  5. Set up environment variables: Create a .env file in the frontend root directory and a .env file in the backend directory with the following contents:

    # Frontend .env (in health-monitor-next directory)
    
    # Supabase
    NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
    NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
    SUPABAE_ADMIN=your_supabase_service_role_key
    
    # FastAPI
    NEXT_PUBLIC_API_URL=http://localhost:8000
    API_URL=http://localhost:8000
    
    # Resend
    RESEND_API_KEY=your_resend_api_key
    RESEND_DOMAIN=your_resend_domain
    
    # Nutritionix API
    NUTRITIONIX_API_URL=https://trackapi.nutritionix.com/v2
    NUTRITIONIX_APP_ID=your_nutritionix_app_id
    NUTRITIONIX_API_KEY=your_nutritionix_api_key
    
    # DB Credentials
    NEXT_PUBLIC_DB_USER=<your_db_user>
    NEXT_PUBLIC_DB_PASSWORD=<your_db_password>
    NEXT_PUBLIC_DB_HOST=<your_db_host>
    NEXT_PUBLIC_DB_PORT=<your_db_port>
    NEXT_PUBLIC_DB_NAME=<your_db_name>
    # Backend .env (in health-monitor-api directory)
    OPENAI_API_KEY=<your_openai_api_key>
    LOCAL_LLM_URL=<your_local_llm_url>
    GOOGLE_API_KEY=<your_google_api_key>
    COHERE_API_KEY=<your_cohere_api_key>
    TAVILY_API_KEY=<your_tavily_api_key>
    
    SUPABASE_URL=<your_supabase_project_url>
    SUPABASE_KEY=<your_supabase_service_role_key>
    
  6. Start the development servers:

    # In the frontend directory
    cd health-monitor-next
    npm run dev
    
    # In a new terminal, navigate to the backend directory
    cd path/to/health-monitor-api
    uvicorn main:app --reload

Medical Records Processing

When a medical record is uploaded:

  1. The file is sent to the backend for processing.
  2. If it's a PDF, it's converted to text using PyPDF2. If it's an image, OCR is performed using Tesseract.
  3. The extracted text is then sent to Cohere to generate embeddings.
  4. The embeddings, along with the original text and metadata, are stored in the Supabase vector database.

This process allows for efficient semantic search and retrieval of relevant information during chat interactions

About

Health Data Management and AI-Assisted Analysis Platform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages