Skip to content

Malaviya24/Swasthik

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Swasthik - AI Healthcare Assistant

React Version TypeScript Version Express Version TailwindCSS Version Google Gemini AI

๐Ÿฅ Overview

Swasthik (เคธเฅเคตเคพเคธเฅเคฅเคฟเค•) is an AI-powered healthcare assistant designed specifically for rural and semi-urban communities across India. The application provides comprehensive health guidance, symptom analysis, medication information, and healthcare facility location services in multiple Indian languages.

โœจ Key Features

๐Ÿค– AI Health Assistant

  • 24/7 Health Chat: Get instant health guidance powered by Google Gemini AI
  • Multilingual Support: Available in English, Hindi, Bengali, Tamil, Telugu, and Marathi
  • Contextual Conversations: Maintains conversation history for better assistance
  • Voice Interaction: Speak your health concerns and receive voice responses

๐Ÿ” Symptom Analysis

  • Intelligent Symptom Checker: Analyze symptoms with AI-powered recommendations
  • Severity Assessment: Get urgency levels and appropriate next steps
  • Personalized Recommendations: Tailored health advice based on symptoms
  • Medical Disclaimers: Always includes appropriate health disclaimers

๐Ÿ’Š Medication Information

  • Drug Database: Search and get detailed information about medications
  • Dosage Guidelines: Safe dosage recommendations with doctor consultation reminders
  • Side Effects & Interactions: Comprehensive medication safety information
  • Price Information: Approximate pricing in Indian Rupees

๐Ÿ“ Health Center Finder

  • Location-Based Search: Find nearby hospitals, clinics, and healthcare facilities
  • Detailed Information: Contact details, services, ratings, and timings
  • Emergency Services: Quick access to emergency healthcare facilities
  • Multiple Healthcare Types: Hospitals, clinics, pharmacies, and diagnostic centers

๐Ÿ“ธ Image Analysis

  • Health Image Analysis: Upload photos for AI-powered medical guidance
  • Visual Symptom Assessment: Analyze skin conditions, wounds, and other visible symptoms
  • Medical Image Interpretation: Get insights from X-rays, scans, and medical images

โฐ Health Reminders

  • Medication Reminders: Set reminders for medication schedules
  • Appointment Alerts: Never miss important health appointments
  • Vaccination Reminders: Track vaccination schedules
  • Health Checkup Alerts: Regular health monitoring reminders

๐Ÿ“ฑ Modern UI/UX

  • Responsive Design: Works seamlessly on desktop, tablet, and mobile devices
  • Intuitive Interface: Clean, modern design with easy navigation
  • Accessibility: Designed for users with varying technical expertise
  • Progressive Web App: Fast loading and offline capabilities

๐Ÿ› ๏ธ Technology Stack

Frontend

  • React 18.3.1 - Modern UI library
  • TypeScript 5.6.3 - Type-safe JavaScript
  • TailwindCSS 3.4.17 - Utility-first CSS framework
  • Wouter 3.3.5 - Lightweight routing
  • Framer Motion 11.13.1 - Smooth animations
  • Radix UI - Accessible component primitives
  • React Query - Data fetching and caching

Backend

  • Express.js 4.21.2 - Web application framework
  • Node.js - JavaScript runtime
  • TypeScript - Type-safe backend development
  • Multer - File upload handling
  • WebSocket - Real-time communication

AI & Database

  • Google Gemini AI - Advanced AI for health assistance
  • Drizzle ORM - Type-safe database operations
  • PostgreSQL - Robust database system
  • Neon Database - Serverless PostgreSQL

Development Tools

  • Vite - Fast build tool and dev server
  • ESBuild - JavaScript bundler
  • Drizzle Kit - Database migrations
  • Zod - Schema validation

๐Ÿš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn
  • PostgreSQL database
  • Google Gemini API key

Installation

  1. Clone the repository

    git clone <repository-url>
    cd health-chabot
  2. Install dependencies

    npm install
  3. Environment Setup Create a .env file in the root directory:

    # Google Gemini AI API Key (Required for AI chat)
    GEMINI_API_KEY=your_gemini_api_key_here
    
    # Database Configuration (Optional for demo)
    DATABASE_URL=your_postgresql_connection_string
    
    # Server Configuration
    NODE_ENV=development
    PORT=5000

    Get your Google Gemini API Key:

    1. Visit Google AI Studio
    2. Sign in with your Google account
    3. Click "Get API Key" and create a new key
    4. Copy the key to your .env file
  4. Database Setup

    npm run db:push
  5. Start Development Server

    npm run dev
  6. Access the Application Open your browser and navigate to http://localhost:5000

Production Build

# Build the application
npm run build

# Start production server
npm start

๐Ÿ“ Project Structure

health-chabot/
โ”œโ”€โ”€ client/                 # Frontend React application
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Reusable UI components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ui/        # Base UI components (Radix UI)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ChatInterface.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ SymptomChecker.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ pages/         # Application pages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ chat.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ landing.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/         # Custom React hooks
โ”‚   โ”‚   โ”œโ”€โ”€ lib/          # Utility libraries
โ”‚   โ”‚   โ””โ”€โ”€ main.tsx      # Application entry point
โ”œโ”€โ”€ server/                # Backend Express application
โ”‚   โ”œโ”€โ”€ index.ts          # Server entry point
โ”‚   โ”œโ”€โ”€ routes.ts         # API route handlers
โ”‚   โ””โ”€โ”€ storage.ts        # Database operations
โ”œโ”€โ”€ shared/               # Shared types and schemas
โ”‚   โ””โ”€โ”€ schema.ts         # Database schemas and types
โ”œโ”€โ”€ package.json          # Dependencies and scripts
โ”œโ”€โ”€ vite.config.ts        # Vite configuration
โ”œโ”€โ”€ tailwind.config.ts    # TailwindCSS configuration
โ””โ”€โ”€ tsconfig.json         # TypeScript configuration

๐Ÿ”ง API Endpoints

Chat & AI

  • POST /api/chat - Send chat message to AI assistant
  • POST /api/analyze-image - Analyze uploaded health images
  • POST /api/analyze-symptoms - Analyze user symptoms
  • POST /api/transcribe-audio - Convert voice to text

Health Services

  • GET /api/medications/search - Search medication information
  • POST /api/health-centers/search - Search healthcare facilities
  • POST /api/find-health-centers - Find nearby health centers

Reminders

  • GET /api/reminders - Get user reminders
  • POST /api/reminders - Create new reminder
  • PATCH /api/reminders/:id - Update reminder
  • DELETE /api/reminders/:id - Delete reminder

๐ŸŒ Supported Languages

  • English ๐Ÿ‡ฌ๐Ÿ‡ง
  • เคนเคฟเค‚เคฆเฅ€ (Hindi) ๐Ÿ‡ฎ๐Ÿ‡ณ
  • เฆฌเฆพเฆ‚เฆฒเฆพ (Bengali) ๐Ÿ‡ง๐Ÿ‡ฉ
  • เฎคเฎฎเฎฟเฎดเฏ (Tamil) ๐Ÿ‡ฎ๐Ÿ‡ณ
  • เฐคเฑ†เฐฒเฑเฐ—เฑ (Telugu) ๐Ÿ‡ฎ๐Ÿ‡ณ
  • เคฎเคฐเคพเค เฅ€ (Marathi) ๐Ÿ‡ฎ๐Ÿ‡ณ

๐ŸŽฏ Target Audience

  • Rural Communities: Accessible healthcare information for underserved areas
  • Semi-Urban Areas: Bridge the gap between rural and urban healthcare
  • Multilingual Users: Native language support for better understanding
  • Mobile-First Users: Optimized for smartphone usage
  • Healthcare Seekers: General health information and guidance

โš ๏ธ Important Disclaimers

  • Not a Medical Diagnosis: This application provides general health information only
  • Professional Consultation: Always consult qualified healthcare professionals for medical advice
  • Emergency Situations: For medical emergencies, call 108 or visit the nearest hospital
  • Data Privacy: User health data is handled with strict privacy measures
  • AI Limitations: AI responses should not replace professional medical judgment

๐Ÿ”ง Troubleshooting

Common Errors and Solutions

1. Build Directory Error

Error: Could not find the build directory

Solution: Run npm run build before starting the server

2. Port Already in Use

Error: listen EADDRINUSE: address already in use :::5000

Solution:

# Find and kill the process using port 5000
netstat -ano | findstr :5000
taskkill /PID [process_id] /F

# Or use a different port
set PORT=3000 && npm run dev

3. Google API Authentication Error

ApiError: PERMISSION_DENIED

Solution:

  1. Get a valid Google Gemini API key from Google AI Studio
  2. Add it to your .env file
  3. Restart the server

4. Windows Socket Error

Error: listen ENOTSUP: operation not supported on socket

Solution: This is fixed in the current version

Demo Mode

If you don't have a Google Gemini API key, the app runs in demo mode with basic functionality.

๐Ÿ”’ Security & Privacy

  • Data Encryption: All data transmission is encrypted
  • User Privacy: No personal health data is stored permanently
  • Secure Authentication: Firebase-based user authentication
  • API Security: Protected API endpoints with proper validation
  • File Upload Security: Secure file handling with type validation

๐Ÿš€ Deployment

Environment Variables

GEMINI_API_KEY=your_gemini_api_key
DATABASE_URL=your_database_connection_string
NODE_ENV=production
PORT=5000

Build Commands

# Development
npm run dev

# Production build
npm run build
npm start

# Type checking
npm run check

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ“ž Support

For support and questions:

  • Emergency: Call 108 (India)
  • General Health: Use the chat interface
  • Technical Issues: Create an issue in the repository

๐Ÿ™ Acknowledgments

  • Google Gemini AI for advanced language processing
  • Radix UI for accessible component primitives
  • TailwindCSS for utility-first styling
  • React Community for excellent tooling and libraries
  • Indian Healthcare Community for inspiration and guidance

๐Ÿฅ Swasthik - Bridging Healthcare Gaps with AI Technology ๐Ÿฅ

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages