Skip to content
Saadmadni84Public

About

A comprehensive, secure, and user-friendly health management platform built with Next.js, TypeScript, and Supabase. SwasthAI enables users to manage their personal health information, family health records, medical appointments, and important documents in one centralized, secure location.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

72 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Live Demo

๐Ÿ‘‰ https://swasth-ai-jc2f.vercel.app/hero

๐ŸŒฟ GramSwasth: Revolutionizing Rural Healthcare

Note: The repository is now organized as a monorepo with separate frontend (Next.js) and backend (Python/Flask ML) services.

Monorepo structure

.
โ”œโ”€โ”€ frontend/        # Next.js app (App Router)
โ”‚   โ”œโ”€โ”€ app/         # Routes and UI
โ”‚   โ”œโ”€โ”€ components/  # Shared UI components
โ”‚   โ”œโ”€โ”€ public/      # Static assets
โ”‚   โ””โ”€โ”€ Dockerfile   # Production container (standalone)
โ”œโ”€โ”€ backend/         # Python ML API (Flask)
โ”‚   โ”œโ”€โ”€ app.py       # API entrypoint
โ”‚   โ”œโ”€โ”€ models/      # ML models (incl. models/ml/*)
โ”‚   โ”œโ”€โ”€ utils/       # Helpers (symptom extraction, doctor finder)
โ”‚   โ””โ”€โ”€ Dockerfile   # Backend container
โ”œโ”€โ”€ backend-node/    # Legacy Node backend (preserved)
โ””โ”€โ”€ docker-compose.yml

Quick start (local)

Docker (optional)

Run both services via Docker:

docker compose up --build

This will start:

A comprehensive, secure, and user-friendly health management platform built with Next.js, TypeScript, and Supabase. SwasthAI enables users to manage their personal health information, family health records, medical appointments, and important documents in one centralized, secure location.

๐ŸŒŸ Features

๐Ÿ” Authentication & Security

  • Secure Authentication: Email/password authentication with Supabase Auth
  • Email Verification: Required email confirmation for account security
  • Row-Level Security: Database-level security ensuring users only access their own data
  • Protected Routes: Middleware-based route protection
  • Session Management: Automatic session handling with refresh tokens

๐Ÿ‘ค Profile Management

  • Complete Profile Setup: Personal information, contact details, medical info
  • Profile Photo Upload: Secure avatar storage with Supabase Storage
  • Medical Information: Blood group, allergies, emergency contacts
  • Address Management: Complete address information storage

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Family Vault

  • Family Member Management: Add and manage family members' health information
  • Document Storage: Secure upload and storage of important family documents
  • Document Categories: Identity, medical, insurance, legal, financial, education, photos
  • File Management: View, download, and delete documents with proper permissions
  • Emergency Contacts: Manage emergency contact information for the family

๐Ÿฅ Health Records Management

  • Medical Records: Store prescriptions, lab reports, diagnoses, vaccinations, surgeries
  • File Attachments: Upload and attach medical documents to health records
  • Family Health Tracking: Track health records for all family members
  • Advanced Filtering: Filter records by type, family member, and date
  • Doctor Information: Store doctor and hospital information with each record
  • Users can input health conditions, symptoms, or queries in any Indian native language (text or audio) and receive responses in the same language
  • Powered by AI-driven insights, providing accurate remedies, treatments, and guidance
  • Built with aiXplain custom agents, ensuring high accuracy and adaptability for rural healthcare needs

๐Ÿ‘จโ€โš•๏ธ Doctor Discovery & Appointment Booking (Swasth Connect)

  • Helps users find relevant doctors based on symptoms and health conditions
  • Provides a curated list of doctors with details like hospital affiliations, fees, experience, and specialization
  • Connects rural users with urban specialists

๐Ÿ—บ๏ธ Locate Nearest Healthcare Facilities (Swasth Map)

  • Uses Google Maps to find nearby hospitals, clinics, and health centers
  • Powerful tool to locate the nearest healthcare facilities based on user location and medical needs
  • Helps users save time during emergencies

๐Ÿ“ฐ Health Education & Awareness (Swasth Pulse)

  • Keeps users informed about health-related news, conditions, and updates specific to their area
  • Offers expert-curated blogs, articles, and news to promote health literacy and preventive care

๐Ÿ“Š Health Insights Dashboard (Swasth View)

  • Interactive visualizations showing urban-rural health disparities in India
  • Charts and graphs for different health metrics including:
    • Urban vs rural healthcare access comparison
    • Common health conditions prevalence
    • Life expectancy trends over time
    • Child mortality rates and improvements
  • Provides key takeaways and insights to drive informed healthcare decisions
  • Responsive design that works across all device sizes

๐Ÿง  Mental Health Smartwatch Dashboard

  • Real-time Data Monitoring: Simulated smartwatch data updated every 10 seconds
  • Key Health Metrics: Track heart rate (60-140 bpm), stress levels (1-10), sleep hours (3-9h), and daily steps (1000-10000)
  • Mental Health Score: AI-calculated wellness score (0-10) based on:
    • Stress levels > 7 โ†’ -2 points
    • Sleep < 6 hours โ†’ -2 points
    • Heart rate > 120 bpm โ†’ -3 points
    • Bonus points for optimal metrics
  • Status Categories:
    • ๐ŸŸข Healthy (Score โ‰ฅ 8)
    • ๐ŸŸก Moderate (Score 5-7)
    • ๐Ÿ”ด Stressed (Score < 5)
  • Personalized Recommendations: AI-driven health advice including:
    • Stress management techniques
    • Sleep optimization tips
    • Heart rate regulation guidance
    • Activity level recommendations
  • Interactive Visualizations: Live trend charts with mental health score and stress level tracking
  • Elegant UI: SwasthAI color palette (#003049, #669bbc, #780000, #c1121f, #fdf0d5) with Framer Motion animations
  • Glowing Effects: Hover effects on cards, smooth transitions, and animated health indicators

๐Ÿš€ Future Updates

๐Ÿ“Š AI-powered Demand Forecasting of Medicines

  • Predicts the demand for medicines in specific areas, ensuring better supply chain management
  • Helps pharmacies stock essential drugs based on demand trends

๐Ÿ”ฎ Disease Outbreak Prediction

  • Uses historical data to predict potential disease outbreaks in particular regions
  • Helps authorities take preventive action before diseases spread

๐Ÿ’ป Technology Stack

GramSwasth is built using modern, scalable technologies:

  • Frontend: React, Next.js, TypeScript, Framer, Vercel
  • Backend: Flask, JavaScript, Python
  • AI/ML: aiXplain custom agents, Google Maps integration

๐Ÿ› ๏ธ Setup and Installation

  1. Clone the repository
git clone https://github.com/yourusername/gram-aarogya.git
cd gram-aarogya
  1. Set up environment variables in a .env file:
TEAM_API_KEY=your_team_api_key
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
DOC_MODEL_ID=your_doc_model_id
SUMM_MODEL_ID=your_summ_model_id
NEWS_MODEL_ID=your_news_model_id
AGENT_MODEL_ID=your_agent_model_id
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
python backend.py

๐ŸŒ API Endpoints

Health Assistant

POST /ask

Body:

{
  "question": "What are the symptoms of dengue?"
}

Doctor Discovery

POST /doctors

Body:

{
  "condition": "diabetes",
  "location": "Mumbai"
}

Health Centers

POST /health-centers

Body:

{
  "latitude": 19.0760,
  "longitude": 72.8777
}

Health News

POST /news

Body:

{
  "language": "hindi"
}

โš ๏ธ Challenges & Known Issues

  • Internet Connectivity: Rural areas may face challenges with consistent internet access
  • Digital Literacy: Some users may require training to navigate the app effectively
  • Data Privacy: Ensuring user data security and compliance with healthcare regulations
  • Language Accuracy: Achieving 100% accuracy in translations for all dialects is an ongoing challenge
  • Real-Time Updates: Keeping healthcare facility information up-to-date in real-time

๐Ÿ™ Acknowledgments

  • aiXplain for AI model support & custom model creation
  • Google Maps API for location services

Because everyone deserves good healthโ€”anytime, anywhere.

๐Ÿ‘ค Author

For any questions or issues, please open an issue on GitHub: @Saadmadni84


Made with โค๏ธ and lots of โ˜•

About

A comprehensive, secure, and user-friendly health management platform built with Next.js, TypeScript, and Supabase. SwasthAI enables users to manage their personal health information, family health records, medical appointments, and important documents in one centralized, secure location.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages