โ ๏ธ Note: This application is currently under active development. Features and endpoints may change frequently as we continue building out the core platform.
Welcome to the HealthHub AI project! This repository contains the foundation for an intelligent Triage and Doctor Marketplace platform, designed to accurately evaluate patient symptoms using AI and connect them with the right specialists.
HealthHub AI is an AI-powered medical triage and telehealth platform designed to accurately evaluate patient symptoms and connect them with verified specialists.
- Architecture & Full-Stack: Engineered a scalable platform using React, FastAPI, and PostgreSQL, featuring 30+ RESTful API endpoints for robust patient-doctor workflows.
- AI & Vector Search: Architected a Retrieval-Augmented Generation (RAG) system with
pgvector, embedding 50,000+ medical knowledge chunks to achieve <200ms semantic search latency for real-time symptom triage. - Intelligent Triage Engine: Developed an advanced NLP pipeline utilizing LLMs (Groq/Gemini/OpenAI) to extract symptoms, detect emergency red flags, and calculate automated medical risk assessments.
- Real-Time Telehealth: Integrated end-to-end encrypted WebRTC video consultations with PeerJS, ensuring secure, HIPAA-compliant telehealth appointments.
- Infrastructure & Deployment: Streamlined application delivery by fully containerizing the architecture with Docker and Docker Compose, reducing local setup time and ensuring environment consistency.
- Enterprise Security: Implemented robust security using JWT authentication and Role-Based Access Control (RBAC) to securely manage Patient, Doctor, and Admin interfaces.
graph TD
%% Frontend Layer
subgraph Frontend ["React / Vite Frontend"]
UI["User Interface"]
PatientDash["Patient Dashboard"]
DoctorDash["Doctor Dashboard"]
AdminDash["Admin Panel"]
end
%% Backend Layer
subgraph Backend ["FastAPI Backend"]
API["API Router"]
AuthSvc["Auth & RBAC Service"]
DocSvc["Doctor Onboarding & PDF Service"]
%% Triage Pipeline
subgraph TriagePipeline ["Intelligent Triage Pipeline"]
SympExt["Symptom Extraction (LLM)"]
RedFlag["Red-Flag Emergency Detection"]
TriageScore["Triage Scoring Engine"]
end
%% RAG System
subgraph KnowledgeSystem ["RAG Knowledge System"]
CorpusPipe["Corpus Ingestion Pipeline"]
RAG["RAG Retrieval Service"]
end
end
%% Database Layer
subgraph Database ["PostgreSQL + pgvector"]
UsersDB[("Users & Roles")]
ProfilesDB[("Profiles & Applications")]
VectorDB[("Medical Embeddings")]
end
%% External APIs
LLM["External LLM APIs<br>(Groq, Gemini, OpenAI)"]
%% Connections
UI <--> API
API <--> AuthSvc
API <--> DocSvc
API <--> SympExt
AuthSvc <--> UsersDB
DocSvc <--> ProfilesDB
SympExt --> |"Raw Text"| LLM
LLM --> |"Canonical JSON"| SympExt
SympExt --> |"Canonical Symptoms"| RedFlag
RedFlag --> |"If safe (No Red-Flags)"| TriageScore
CorpusPipe --> |"Chunking & Embeddings"| VectorDB
RAG <--> |"Similarity Search"| VectorDB
This application has been fully containerized using Docker, making it incredibly easy to spin up the Frontend, Backend, and Database with a single command.
- Docker Desktop installed and running.
-
Clone the repository:
git clone https://github.com/MiliKava/HealthHubAi.git cd HealthHubAi -
Set up Environment Variables: Duplicate the
.env.examplefile inside thebackendfolder and rename it to.env:# On Windows copy backend\.env.example backend\.env # On macOS/Linux cp backend/.env.example backend/.env
(Note: The
docker-compose.ymlautomatically passes the correctDATABASE_URLto the containers, so you do not need to manually configure the database URL unless you are running it outside of Docker). -
Start the Application: Spin up the entire stack (PostgreSQL with
pgvector, FastAPI Backend, and Vite Frontend) in the background:docker-compose up -d --build
-
Seed the Database (Optional): To add the default Admin user, run this command inside the running backend container:
docker-compose exec backend python seed_admin.py -
Ingest Medical Knowledge (Phase 6): To test the AI Vector Database, you can ingest the MedQuAD dataset into
pgvectorby running:docker-compose exec backend python scripts/ingest_corpus.py
- Frontend Interface: Open your browser and navigate to http://localhost:5173.
- Admin Access: You can log in using
admin@healthhub.aiandadmin123to access the Admin Panel to approve doctor applications.
- Admin Access: You can log in using
- Backend API Docs: The FastAPI interactive documentation is available at http://localhost:8000/docs.
- Database Access: The PostgreSQL database is mapped to your local port
5433(to avoid conflicts with local installations). You can connect via pgAdmin usinglocalhost:5433, userpostgres, passwordpassword, and databasehealthhub.
project is in development phase, stay tuned.
