Skip to content

user-Rishabh/ArogyaBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

134 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ ArogyaBot

Vite Tailwind CSS Express.js Supabase Google Gemini

A premium, comprehensive public health awareness and wellness assistant designed specifically for rural and semi-urban India. ArogyaBot provides health guidance, disease awareness, vaccine information, personalized diet planning, BMI insights, medicine suggestions, safety/interaction checks, and seamless WhatsApp integration in a highly accessible, multilingual manner.


πŸ›  Tech Stack

Layer Technology Description
Frontend React (v19) + Vite + Tailwind CSS (v3) Ultra-fast rendering, responsive layout, modern design system.
Routing React Router DOM (v7) Dynamic routing and client-side page handling.
Authentication Supabase Auth Secure, token-based authentication and sessions.
Database Supabase (PostgreSQL) Secure and scalable user profile and health history storage.
Backend Node.js + Express.js Core API gateway and routing logic.
AI Engine Google Gemini 2.5 Flash / OpenRouter (Llama 3.3) State-of-the-art LLMs for smart chat, diet planning, and health checks.
Messaging Twilio WhatsApp API Direct delivery of health summaries and prescriptions via WhatsApp.
PDF/Canvas jsPDF + html2canvas On-the-fly generation of downloadable wellness reports.

✨ Features

🩺 Multilingual Health Chatbot

  • AI Health Consultation: Conversational wellness guidance using Google Gemini or OpenRouter (Llama 3.3).
  • Disease & Vaccine Awareness: Detailed information on regional diseases and immunization timelines.
  • Multilingual Support: Real-time toggling and automated detection for Hindi and English.
  • Speech-to-Text Integration: Chrome-based Web Speech API allows users to speak their questions instead of typing.
  • Medical Disclaimer Protection: Safeguards user behavior by automatically appending necessary medical disclaimers.

πŸ’Š Intelligent Medicine Suggester

  • Alternative Systems of Medicine: Support for Ayurvedic, Homeopathic, and Allopathic suggestions.
  • Age-Adjusted Dosages: Intelligent dosage recommendations tailored to Pediatric, Adult, and Geriatric groups.
  • Multi-Step Safety Warning: Tailored precautions for chronic conditions, age limits, and allergies.

πŸ₯— Personal Diet Planner

  • Tailored Indian Diet Charts: Generates customized breakfast, lunch, snack, and dinner options.
  • Multi-Factor Customization: Automatically calculates suggestions based on:
    • Age, Height, Weight, and calculated BMI category.
    • Health Goal (Weight Loss, Weight Gain, Maintenance).
    • Dietary Preference (Vegetarian, Non-Vegetarian).

βš–οΈ BMI Tracker & Health Dashboard

  • Dynamic BMI Analysis: Calculates BMI instantly with visual category scales.
  • Wellness Advisory Panel: Seasonal tips, hydration tracking, and preventative suggestions updated in real time.
  • Emergency Contacts: Quick access to national and state-level healthcare helpline numbers.

πŸ“± WhatsApp & Offline Sharing

  • WhatsApp Share: Integrated Twilio messaging client to push diet plans and tips to a user's phone.
  • PDF Report Generation: Instant export of health profile, diet plans, and BMI stats into a printable PDF.

πŸ“ Project Structure

ArogyaBot/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── healthData.json         # Static dictionary of diseases and vaccines
β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   └── supabase.js             # Supabase server client initialization
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ chat.js                 # Chatbot endpoint wrapper
β”‚   β”‚   β”œβ”€β”€ diet.js                 # Personal diet planner endpoint
β”‚   β”‚   β”œβ”€β”€ interactions.js         # Medicine interactions checker route
β”‚   β”‚   β”œβ”€β”€ suggestions.js          # Medicine suggestions generator route
β”‚   β”‚   └── whatsapp.js             # Twilio WhatsApp messaging logic
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── claudeClient.js         # Google Gemini & OpenRouter AI adapter
β”‚   β”œβ”€β”€ .env                        # Local Backend environment file (ignored)
β”‚   β”œβ”€β”€ package.json                # Node dependencies and run scripts
β”‚   └── server.js                   # Express application entrypoint
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/                     # Static assets (favicons, logos)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/                 # SVGs, images, and fonts
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ BMICalculator.jsx   # Interactive BMI calculator and indicator
β”‚   β”‚   β”‚   └── EmergencyNumbers.jsx # List of important Indian helpline numbers
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   β”‚   └── AuthContext.jsx     # Global Supabase authentication wrapper
β”‚   β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”‚   └── useSpeech.js        # Custom speech recognition hook
β”‚   β”‚   β”œβ”€β”€ lib/
β”‚   β”‚   β”‚   └── supabase.js         # Supabase client credentials and init
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Landing.jsx         # Modern landing page with interactive features
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.jsx           # Clean login screen
β”‚   β”‚   β”‚   β”œβ”€β”€ Signup.jsx          # Register user with email credentials
β”‚   β”‚   β”‚   β”œβ”€β”€ Onboarding.jsx      # Collects initial user details (age, weight, goal)
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.jsx       # Tabbed interface (Advisory, Suggester, Diet, BMI)
β”‚   β”‚   β”‚   └── Chat.jsx            # Speech-enabled healthcare assistant workspace
β”‚   β”‚   β”œβ”€β”€ App.css                 # Local component rules
β”‚   β”‚   β”œβ”€β”€ App.jsx                 # Routing configuration (Protected routes)
β”‚   β”‚   β”œβ”€β”€ index.css               # Global tailwind rules & HSL color tokens
β”‚   β”‚   └── main.jsx                # React app mount
β”‚   β”œβ”€β”€ .env                        # Local Frontend environment file (ignored)
β”‚   β”œβ”€β”€ tailwind.config.js          # Tailwind customization and color palette
β”‚   └── vite.config.js              # Vite bundler configurations
β”‚
└── supabase_schema.json            # Database schema backup file

βš™οΈ Local Setup

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/arogya-bot.git
cd arogya-bot

2. Configure Environment Variables

Create .env files in both the Backend and frontend folders using the templates provided below.

3. Backend Setup

cd Backend
npm install
npm run dev

The backend will run on http://localhost:3000.

4. Frontend Setup

cd ../frontend
npm install
npm run dev

The frontend will run on http://localhost:5173. Open your browser to explore the dashboard.


πŸ”‘ Environment Variables

Backend Configuration (Backend/.env)

Create a file named .env in the Backend directory:

# Server Port
PORT=3000

# Google Gemini API
GOOGLE_API_KEY=your_gemini_api_key

# OpenRouter (Optional: Fallback/Alternative LLM Provider)
OPENROUTER_API_KEY=your_openrouter_api_key
OPENROUTER_MODEL=meta-llama/llama-3.3-70b-instruct:free

# Supabase Configurations
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_supabase_service_role_key

# Twilio Credentials (WhatsApp integration)
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token

Frontend Configuration (frontend/.env)

Create a file named .env in the frontend directory:

# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_publishable_key

# API connection URL
VITE_API_URL=http://localhost:3000

πŸš€ Deployment

Database (Supabase)

Create a table profiles in your Supabase database using the SQL Editor:

create table profiles (
  id uuid references auth.users not null primary key,
  name text,
  age numeric,
  gender text,
  height numeric,
  weight numeric,
  conditions text,
  diet_preference text,
  goal text,
  updated_at timestamp with time zone default timezone('utc'::text, now()) not null
);

-- Enable Row Level Security (RLS)
alter table profiles enable row level security;

create policy "Users can view their own profile" on profiles
  for select using (auth.uid() = id);

create policy "Users can update their own profile" on profiles
  for update using (auth.uid() = id);

create policy "Users can insert their own profile" on profiles
  for insert with check (auth.uid() = id);

Frontend (Vercel)

  1. Link your GitHub repository to Vercel.
  2. Configure build settings:
    • Framework Preset: Vite
    • Root Directory: frontend
  3. Add environmental variables:
    • VITE_SUPABASE_URL
    • VITE_SUPABASE_ANON_KEY
    • VITE_API_URL (Pointer to deployed backend URL)

Backend (Render / Railway)

  1. Deploy the Backend directory as a Web Service.
  2. Ensure the start script is set to npm start.
  3. Provide variables: GOOGLE_API_KEY, SUPABASE_URL, SUPABASE_SERVICE_KEY, TWILIO_ACCOUNT_SID, and TWILIO_AUTH_TOKEN.
  4. Copy the deployed backend URL and update your frontend's VITE_API_URL.

πŸ‘¨β€πŸ’» Developed For

Academic Project / Full Stack AI Healthcare Assistant aimed at improving public health literacy, accessibility, and emergency support for semi-urban and rural populations.


Disclaimer: ArogyaBot is an AI-powered public health assistant designed for educational and informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors