Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HealthPath Backend

Express API powering HealthPath — AI-driven health query analysis using Google Gemini.

Stack

  • Runtime: Node.js 18
  • Framework: Express
  • AI: Google Gemini (gemini-3-flash-preview for analysis, gemini-3-flash-preview for suggestions)
  • File parsing: pdf-parse, mammoth (DOCX), Tesseract.js (OCR)
  • Storage: Vercel Blob

Setup

npm install

Create .env:

API_KEY=your_google_generative_ai_key
BLOB_READ_WRITE_TOKEN=your_vercel_blob_token
npm start
# Server runs at http://localhost:3001

API Endpoints

GET /

Health check.


POST /query

Analyze a health query. Returns structured diagnosis, tests, resolutions, and next steps.

Body:

{ "input": "I have a headache and fever" }

Response: JSON with initialTests, possibleDiagnoses, fastestResolution, normalResolution, complexCases, nextSteps.


POST /suggestions

Get autocomplete suggestions for a health query.

Body:

{ "input": "chest" }

Response:

{ "originalQuery": "chest", "suggestions": ["chest pain", "chest tightness", "chest infection"] }

POST /upload

Upload a medical document (PDF, DOCX, JPEG, PNG) with a prompt. Extracts text via OCR/parsing, then queries the AI model.

Form data:

  • file — document (max 4.5 MB)
  • prompt — health query string

Response: Same structure as /query.

File Support

Type Parser
PDF pdf-parse
DOCX mammoth
JPEG/PNG Tesseract.js OCR

About

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages