Skip to content

pauldev-hub/swahealthy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

33 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SwaHealthy ๐Ÿฅ

Rural Health Companion for West Bengal

Multilingual symptom checker with AI health assistant, mental wellness tools, and GPS-based facility finder โ€” in Bengali, Hindi & English. Works offline.


๐Ÿ“Œ Version & Languages

Version Python JavaScript HTML5 CSS3 License


๐Ÿ”— Live App: https://swahealthy-1.onrender.com


๐Ÿ“‘ Table of Contents


What is SwaHealthy?

SwaHealthy is a multilingual, offline-capable Progressive Web App (PWA) that helps rural and semi-urban residents in West Bengal check their symptoms, receive first-aid guidance, and find the nearest government health facility โ€” all in their preferred language.

An independent project designed and built by Pratyush.


โญ Quick Stats

Feature Count
๐Ÿฅ Health Conditions 20+
๐Ÿ” Symptoms Database 40+
๐Ÿ—บ๏ธ West Bengal Facilities 10+
๐Ÿ‘จโ€โš•๏ธ Sample Doctors 5+
๐ŸŒ Languages Supported 3 (EN, BN, HI)
๐Ÿ“ฑ Responsive Design Mobile-First
โšก Offline Capability Full PWA Support

Features

  • Symptom Checker โ€” Select symptoms by body area; rule-based engine matches 20+ conditions with weighted scoring
  • Severity Classification โ€” Color-coded results: ๐ŸŸข Low / ๐ŸŸ  Medium / ๐Ÿ”ด High
  • AI Health Assistant โ€” Groq-powered Llama 3 chatbot answers health questions in real time
  • Photo Analysis โ€” Upload images of skin conditions, rashes, or wounds for AI-powered visual assessment via OpenRouter
  • Doctor Appointments โ€” Browse specialists, check availability, and book consultation slots
  • Mental Wellness โ€” PHQ-9 and GAD-7 assessments, mood tracking, journaling, and crisis detection
  • Facility Finder โ€” GPS-based map showing nearest PHCs, hospitals & Jan Aushadhi stores (Haversine distance)
  • Multilingual โ€” Full support for English, Bengali (เฆฌเฆพเฆ‚เฆฒเฆพ), and Hindi (เคนเคฟเค‚เคฆเฅ€)
  • Offline PWA โ€” Works without internet after first load via Service Worker caching
  • Session History โ€” Last 10 checks stored locally; shareable summary for doctor visits
  • Emergency SOS โ€” One-tap access to 108 Ambulance, 100 Police, 112, and 1091 Women Helpline
  • User Profiles โ€” Google OAuth login with age/gender personalisation

๐ŸŽฌ Demo & Screenshots

Here's a visual walkthrough of SwaHealthy on mobile:

๐Ÿ“ฑ Splash & Loading

Loading Screen


๐Ÿ“ฑ Home & Symptom Selection

Home Screen


๐Ÿ“ฑ Diagnosis Results

Diagnosis Results


๐Ÿ“ฑ Duration Counter

Duration Counter


๐Ÿ“ฑ Emergency Contacts (SOS)

Emergency Modal


๐Ÿ“ฑ Facility Finder

Facility Finder


๐Ÿ“ฑ Mental Wellness & Mood Tracking

Mental Wellness


๐Ÿค– AI Health Assistant (MindCare)

AI Assistant


๐Ÿ’ฌ SwaHealthy AI Chat

AI Chat


๐Ÿง  SwaHealthy Assistant Page

Assistant Page


๐Ÿ“… Doctor Appointments

Appointments


Screenshots Overview

All screenshots showcase the app's key features:

  • โœ… Loading & Splash screen
  • โœ… Home with personalized greeting & symptom selection
  • โœ… AI-powered diagnosis results with first-aid guidance
  • โœ… Duration tracking for symptom monitoring
  • โœ… Emergency SOS contacts (108, 100, 112, 1091)
  • โœ… GPS-based facility finder for hospitals & Jan Aushadhi
  • โœ… Mental wellness with mood tracking & journaling
  • โœ… AI health assistant (MindCare) for symptom queries
  • โœ… AI chat interface for health conversations
  • โœ… Dedicated assistant page
  • โœ… Doctor appointment booking system

Tech Stack

Layer Technology
Backend Python 3.10+ + Flask
Database SQLite
Frontend HTML5 + CSS3 + Vanilla JS
Maps Leaflet.js + OpenStreetMap
AI Assistant Groq API (Llama 3)
Photo Analysis OpenRouter API (vision model)
Authentication Google OAuth + Flask-Login
Offline PWA Service Worker
Hosting Render.com

Run Locally

# 1. Clone the repository
git clone https://github.com/pauldev-hub/swahealthy.git
cd swahealthy/swahealthy

# 2. Install dependencies
pip install -r requirements.txt

# 3. Run the app
python run.py

Then open your browser at http://localhost:5000

On first run, the database is automatically created and seeded with 40 symptoms, 20 conditions, 10 West Bengal facilities, and 5 sample doctors.


Project Structure

swahealthy/
โ”œโ”€โ”€ run.py                        # App entry point
โ”œโ”€โ”€ config.py                     # Flask configuration
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ main.py               # Core routes (diagnosis, facilities, history)
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py               # Google OAuth login/logout
โ”‚   โ”‚   โ””โ”€โ”€ appointments.py       # Doctor booking endpoints
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”‚   โ”œโ”€โ”€ schema.py             # Database schema
โ”‚   โ”‚   โ”œโ”€โ”€ helpers.py            # Haversine, DB utilities
โ”‚   โ”‚   โ””โ”€โ”€ seed.py               # Symptoms, conditions, doctors seed data
โ”‚   โ””โ”€โ”€ services/
โ”‚       โ”œโ”€โ”€ engine.py             # Rule-based diagnosis engine
โ”‚       โ””โ”€โ”€ photo_analyzer.py     # OpenRouter vision integration
โ””โ”€โ”€ frontend/
    โ”œโ”€โ”€ templates/
    โ”‚   โ”œโ”€โ”€ base.html             # Shared layout (nav, SOS, AI sheet)
    โ”‚   โ””โ”€โ”€ pages/
    โ”‚       โ”œโ”€โ”€ index.html        # Symptom selection
    โ”‚       โ”œโ”€โ”€ results.html      # Diagnosis results + facility map
    โ”‚       โ”œโ”€โ”€ history.html      # Past diagnoses
    โ”‚       โ”œโ”€โ”€ appointments.html # Doctor booking UI
    โ”‚       โ”œโ”€โ”€ ai_analysis.html  # Photo upload + AI analysis
    โ”‚       โ”œโ”€โ”€ wellness.html     # Mental health assessments
    โ”‚       โ””โ”€โ”€ profile.html      # User profile
    โ””โ”€โ”€ static/
        โ”œโ”€โ”€ css/style.css
        โ”œโ”€โ”€ js/app.js
        โ”œโ”€โ”€ js/translations.js    # i18n strings (EN/BN/HI)
        โ””โ”€โ”€ pwa/
            โ”œโ”€โ”€ manifest.json
            โ””โ”€โ”€ service-worker.js

API Endpoints

Endpoint Method Description
/ GET Home โ€” symptom selection
/diagnose POST Run symptom diagnosis
/results GET Diagnosis results page
/facilities GET Nearby hospitals + Jan Aushadhi
/analyze-photo POST AI photo analysis
/chat POST AI health assistant
/history GET, DELETE User diagnosis history
/appointments GET Browse doctors
/book-appointment POST Book a slot
/wellness GET Mental wellness page
/wellness/phq9 POST PHQ-9 depression assessment
/wellness/gad7 POST GAD-7 anxiety assessment
/profile GET, POST User profile
/login GET Google OAuth login
/logout GET Logout

Supported Languages

Code Language
en English (default)
bn เฆฌเฆพเฆ‚เฆฒเฆพ โ€” Bengali
hi เคนเคฟเค‚เคฆเฅ€ โ€” Hindi

Language preference is stored in localStorage and applied to all UI labels, symptom names, condition names, and first-aid steps.


Medical Disclaimer

SwaHealthy is not a substitute for professional medical advice, diagnosis, or treatment. Always consult a qualified health provider for medical concerns.


References


๐Ÿค Contributing

We welcome contributions! Whether it's bug fixes, new features, translations, or documentation improvements, your help makes SwaHealthy better.

How to Contribute

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes and test thoroughly
  4. Commit with clear messages: git commit -m "Add feature: description"
  5. Push to your fork: git push origin feature/your-feature-name
  6. Open a Pull Request with a description of your changes

Areas We Need Help With

  • ๐ŸŒ Translations โ€” Add more languages or improve existing ones
  • ๐Ÿ› Bug Reports โ€” Report issues you find
  • โœจ Feature Requests โ€” Suggest improvements
  • ๐Ÿ“ฑ UI/UX โ€” Design improvements and responsive fixes
  • ๐Ÿ“š Documentation โ€” Help improve README and comments
  • ๐Ÿงช Testing โ€” Write unit tests and integration tests

๐Ÿ“œ License

SwaHealthy is licensed under the MIT License โ€” see the LICENSE file for details.

You are free to use, modify, and distribute this project, as long as you include the original license and copyright notice.


๐Ÿ™ Acknowledgments

  • Pratyush โ€” Creator & Developer
  • Groq โ€” AI Assistant API
  • OpenRouter โ€” Vision Model Integration
  • OpenStreetMap & Leaflet โ€” Mapping Services
  • West Bengal Health Department โ€” Public Health Data

๐Ÿ“ง Contact & Support

For questions, feedback, or bug reports, please open an issue on GitHub.

Created with โค๏ธ for rural health in West Bengal

About

SwaHealthy is a multilingual, offline-capable health symptom checker built for rural and semi-urban communities in West Bengal, India. Users can select their symptoms, receive a probable condition diagnosis with step-by-step first-aid guidance, and locate the nearest government hospital.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก