Skip to content

Akhilesh29/Health-Research-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Health Research AI

Health Research AI is a web app that helps people make sense of symptoms without jumping to conclusions. You sign in, describe what you’re feeling, and get a clear, structured readout: what might be going on, how urgent it feels, what to watch for, and practical next steps. Your checks are saved so you can see patterns over time. It can also suggest nearby doctors and hospitals based on where you are with map links and contact details when available. It’s built to feel calm and informative,not a replacement for a real doctor, but a better starting point than guessing alone.

Architecture

Architecture


Groq API

The project uses the Groq API for LLM inference. Groq is selected for its low-latency response times.

  • Model: llama3-70b-8192
  • Use case: Health research Q&A-the LLM receives the user's question and returns a research-informed response
  • Key management: API key is loaded from .env on the backend and never exposed to the client

Request flow:

Client -> Next.js -> Express API -> Groq API (LLM)
                         |
                    PostgreSQL (session + log write)


Environment Variables

Create backend/.env:

# Groq
GROQ_API_KEY=your_groq_api_key_here

# PostgreSQL
POSTGRES_USER=postgres
POSTGRES_PASSWORD=yourpassword
POSTGRES_DB=healthguide
DATABASE_URL=postgresql://postgres:yourpassword@db:5432/healthguide

# Auth
JWT_SECRET=your_jwt_secret

# Server
PORT=5000
NODE_ENV=development

Docker Setup

The backend stack (Express + PostgreSQL) runs via Docker Compose.

# Start all services
docker-compose up --build

# Stop services
docker-compose down

# Stop and remove volumes (resets database)
docker-compose down -v

Services started by docker-compose up:

Service Description Port
app Node.js / Express REST API 5000
db PostgreSQL 16 with pgdata volume 5432

Both services communicate over an internal Docker network (app <-> db). The database is not exposed externally in production.

docker-compose.yml summary:

services:
  app:
    build: ./backend
    ports: ["5000:5000"]
    depends_on: [db]
    env_file: .env

  db:
    image: postgres:16
    volumes:
      - pgdata:/var/lib/postgresql/data
    env_file: .env

volumes:
  pgdata:

Database

PostgreSQL stores users, sessions, and conversation logs.

Table Description
users Registered accounts
sessions Active JWT sessions
logs Conversation history and LLM responses

Run migrations inside the app container:

docker exec -it healthguide_app npm run migrate

Or apply SQL directly:

docker exec -it healthguide_db psql -U postgres -d healthguide -f /migrations/init.sql

Frontend

cd frontend
npm install
npm run dev        # Development server at http://localhost:3000
npm run build      # Production build
npm start          # Serve production build

Backend

cd backend
npm install
npm run dev        # Development server at http://localhost:5000

Contributing

git checkout -b feature/your-feature
git commit -m "description of change"
git push origin feature/your-feature
# Open a Pull Request on GitHub

About

A full-stack health intelligence system using LLM-driven symptom interpretation, PostgreSQL-backed session tracking, and geolocation-based provider discovery to deliver structured clinical guidance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors