Skip to content

RatLoopz/sahidawa-india

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4,031 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GSSoC 2026 MIT License PRs Welcome 22 Languages Cloudinary CI Status

🩺 SahiDawa — सही दवा

Open-Source Medicine Safety Infrastructure for Bharat

Scan a medicine. Detect safety risks. Stay ahead of recalls.

Built for Bharat. Not just India.


Report a Bug · Request a Feature · Join Discord · Read the Docs


🔗 Quick Links

Table of Contents


🚨 The Problem We're Solving

India has a three-layer healthcare crisis that requires dedicated safety infrastructure:

Problem Scale Current Solution
12–25% of medicines in India are fake or substandard 1.4 billion people at risk ❌ None — no citizen-facing verifier exists
65% of population is in rural areas with almost no qualified doctor 900M+ people ❌ eSanjeevani exists but requires English + stable internet
22 official languages — health info mostly in English/Hindi only 500M+ non-Hindi speakers ❌ No voice-first multilingual health app

Real incident: In July 2025, Delhi Police busted a counterfeit medicine ring supplying fake Johnson & Johnson and GSK medicines — made of chalk powder and starch — all the way into government hospitals. Patients had zero way to verify these medicines before consuming them.

SahiDawa fixes this. For free. Forever. Open source.


✨ What SahiDawa Does

SahiDawa operates as a flagship counterfeit intelligence network, prioritizing safety and awareness over generic price discovery.

💡 The Core Workflow (Counterfeit Intelligence)

  • 📱 Scan & Verify ➔ Check batch data against CDSCO database.
  • 🚨 Recall & LASA Risk ➔ Identify active regulatory alerts or look-alike/sound-alike risks.
  • 📸 Report Fakes ➔ Citizen reporting of suspicious medicines.
  • 🗺️ District Heatmap ➔ Aggregate counterfeit reports to build public awareness.
  • 📢 Alert ➔ Autonomous district-level safety notifications.

Core Features (Currently in active development)

Feature Description Status
🔍 Medicine Scanner Scan barcode/QR → verify against CDSCO database 🚧 Building
🖼️ AI Image Analysis Cloudinary-powered packaging comparison (real vs fake visual) 🔜 Planned
🗣️ Voice Health Assistant Symptoms in 22 Indian languages via Whisper + Sarvam AI 🔜 Planned
🗺️ Pharmacy & ASHA Map Verified Jan Aushadhi stores + ASHA workers via PostGIS 🔜 Planned
📊 Counterfeit Heatmap Community-reported fake medicines aggregated by district 🔜 Planned
🤖 CDSCO Alert Agent Autonomous agent monitoring CDSCO drug recalls every 6h 🔜 Planned
📶 Offline-First PWA Works without internet after first load (Workbox) 🔜 Planned
🆓 100% Free No ads, no premium plan, no data sold. Ever. ✅ Always

🏗️ Architecture

Major architectural decisions (Turborepo, Supabase, Redis, LangGraph, Next.js, and more) are documented as Architecture Decision Records (ADRs). Start with the ADR index and the foundational ADR 0006 — Record Architecture Decisions for the "why" behind our tech stack.

flowchart TD
    A[Rural Citizen / Patient] -->|Scan Barcode / Voice Input| B[Next.js PWA Client]
    B -->|API Request| C[Node.js Express API]
    C <-->|Verify Data| D[(Supabase PostgreSQL)]
    C <-->|Cache| E[(Redis Cache)]
    B -->|Media Uploads| F[Python FastAPI Service]
    F -->|Process Voice| G[Whisper ASR]
    F -->|Analyze Image| H[OpenCV / TF Lite]
    F -->|Medical Triage| I[Sarvam AI / LangChain]
    I --> C
    J[LangChain CDSCO Poller] -->|Fetch Recalls| K[CDSCO Portal]
    J -->|Update Alerts| D
Loading

🛠️ Tech Stack

Frontend

Backend

AI / ML

Database & Storage

  • PostgreSQL + PostGIS — Primary DB + geo queries
  • pgvector — Vector search for RAG
  • Supabase — Managed Postgres (free tier for dev)
  • Cloudinary — Medicine photo storage + image analysis (GSSoC 2026 bounty partner)

Infrastructure


🗺️ Roadmap & Phases

Phase 1 — Foundation & Core Scanner (Pre-GSSoC / Early May)

  • Project scaffolding (Next.js + TypeScript + Tailwind)
  • CDSCO drug database scraper + PostgreSQL schema
  • Barcode/QR scanner UI (ZXing)
  • Medicine lookup REST API
  • Supabase integration
  • GitHub Actions CI pipeline
  • English UI with i18n setup

Phase 2 — Map + Multilingual + Offline (Coding Begins - Mid May)

  • PostGIS pharmacy + ASHA worker map (Leaflet.js)
  • i18n system — 22 Indian language JSON files
  • Cloudinary photo upload integration
  • Offline PWA (Workbox cache strategies)
  • FastAPI ML microservice scaffolding
  • Redis caching for drug lookups
  • OpenCV.js packaging geometry detection

Phase 3 — AI Health Assistant + Agents (Main Contribution Period - June)

  • TF Lite medicine image classifier
  • Whisper ASR voice input (22 languages)
  • Sarvam AI + LangChain RAG health assistant
  • CDSCO drug alert monitoring agent (LangChain)
  • Counterfeit heatmap + D3.js visualization
  • Push notification system for district alerts

Phase 4 — Polish, Security & Launch (Final Evaluations - July)

  • WCAG 2.1 accessibility audit
  • Lighthouse CI (target 90+ score)

Running Lighthouse CI Locally

To test performance audits on your local machine before pushing:

  1. Install the CLI globally: npm install -g @lhci/cli
  2. Build the web app: cd apps/web && npm run build
  3. Run the audit: lhci autorun (inside apps/web)

This will start a local server, run Lighthouse tests against it, and report the scores directly in your terminal.

  • Docker Compose for self-hosting
  • OpenAPI/Swagger documentation
  • ABHA health card integration (optional)
  • Public launch

🚀 Getting Started

Prerequisites

Software Minimum Version
Node.js 20+
Python 3.10+
Docker (optional) 24+

Clone the Repository

git clone https://github.com/RatLoopz/sahidawa-india.git
cd sahidawa-india

Configure Environment

cp .env.example apps/web/.env.local

Update the environment variables before running the project.

Install Dependencies

cd apps/web
npm install

Run the Development Server

npm run dev

Open http://localhost:3000 in your browser.



| Command | Description |
|---------|-------------|
| `npm install` | Install project dependencies |
| `npm run dev` | Start the development server |
| `npm run build` | Build the project for production |
| `npm run lint` | Run lint checks |


### ⚠️ Troubleshooting npm install Failures

If you encounter `No matching version found` errors while running `npm install`, it may be caused by the canary package versions used in this project.

Try running:

```bash
npm install --legacy-peer-deps

or:

npm install --force

If the issue still persists, you may temporarily downgrade package versions locally to get the project running on your machine.

⚠️ Important: Do not commit modified package.json or package-lock.json files created during local downgrades. Revert those changes before pushing your PR.

Full Stack with Docker

# Clone and start everything
git clone https://github.com/RatLoopz/sahidawa-india.git
cd sahidawa-india

cp .env.example .env
# Edit .env with your keys

docker compose up --build
# Frontend:  http://localhost:3000
# API:       http://localhost:4000
# ML service: http://localhost:8000
# API Docs:  http://localhost:4000/api/docs

Manual Backend Setup

# Ensure environment variables are set at the project root
cp .env.example .env
# Edit .env with your keys

# Start API Server
cd apps/api
npm install
npm run dev
# API Docs: http://localhost:4000/api/docs

ML Service (Python)

For detailed setup instructions, see: ML Setup Guide

For local setup instructions, see: Local Setup Guide

For Docker setup instructions, see: Docker Setup Guide

For production deployment and environment variables, see: Deployment Setup Guide

Quick start:

cd apps/ml

Unix/Linux/macOS

python -m venv venv
source venv/bin/activate

Windows PowerShell

python -m venv venv
.\venv\Scripts\Activate.ps1

Windows Command Prompt

python -m venv venv
venv\Scripts\activate.bat

After activating the virtual environment, install the dependencies and start the service:

pip install -r requirements.txt
uvicorn main:app --reload --port 8000

📁 Project Structure

The repository is organized as a monorepo with separate applications for the frontend, backend, and machine learning services.

sahidawa-india/
├── apps/
│   ├── web/                    # Next.js PWA frontend
│   │   ├── app/                # App Router pages
│   │   ├── components/         # Reusable UI components
│   │   ├── lib/                # Utilities, API clients
│   │   ├── messages/           # i18n JSON files (22 languages)
│   │   │   ├── en.json
│   │   │   ├── hi.json
│   │   │   ├── ta.json
│   │   │   └── ...             # one file per language
│   │   └── public/             # Static assets
│   ├── api/                    # Node.js + Express API
│   │   ├── src/
│   │   │   ├── routes/         # API route handlers
│   │   │   ├── services/       # Business logic
│   │   │   ├── middleware/     # Auth, rate limiting
│   │   │   └── db/             # Database models + migrations
│   │   └── tests/
│   └── ml/                     # Python FastAPI ML service
│       ├── routers/            # ML API endpoints
│       ├── models/             # TF Lite models
│       ├── services/           # Whisper, OpenCV, LangChain
│       └── agent/              # CDSCO monitoring agent
├── packages/
│   └── shared/                 # Shared TypeScript types
├── data/
│   └── seeds/                  # CDSCO drug database seeds
├── docs/                       # Project documentation
├── .github/
│   ├── workflows/              # GitHub Actions CI/CD
│   ├── ISSUE_TEMPLATE/         # Bug report, feature request templates
│   └── PULL_REQUEST_TEMPLATE.md
├── docker-compose.yml
├── docker-compose.prod.yml
└── README.md

🤝 Contributing

We love contributions! SahiDawa is built entirely by the community.

👉 Read the CONTRIBUTING.md before submitting your first PR.

🤝 Before Opening a Pull Request

  • Sync your fork with the latest main branch.
  • Create a new feature branch for your changes.
  • Follow the project's coding conventions.
  • Run linting and tests before submitting.
  • Update documentation if your changes affect usage

Quick contribution guide

  1. Check open issues — look for good-first-issue label
  2. Comment on the issue saying you want to work on it
  3. Fork → branch → code → test → PR
  4. A maintainer will review within 24 hours

What can I contribute?

Skill Level What to pick
🟢 Beginner Language translations (messages/*.json), UI components, documentation, database seed data
🟡 Intermediate Barcode scanner, pharmacy map, Cloudinary integration, i18n wiring, API routes
🔴 Advanced Image classifier, Whisper ASR, LangChain RAG, CDSCO agent, PostGIS queries

🌏 Supported Languages

SahiDawa aims to support all 22 Indian scheduled languages. (We are just getting started! Help us translate.)

Language Status Contributor
English 🚧 In Progress Core Team
Hindi (हिन्दी) 🚧 In Progress
Tamil (தமிழ்) 🚧 In Progress
Telugu (తెలుగు) ✅ Complete GSSoC 2026
Kannada (ಕನ್ನಡ) ✅ Complete GSSoC 2026
Malayalam (മലയാളം) 🔜 Open
Bengali (বাংলা) 🚧 In Progress
Gujarati (ગુજરાતી) 🚧 In Progress
Marathi (मराठी) 🚧 In Progress
Punjabi (ਪੰਜਾਬੀ) 🚧 In Progress
Odia (ଓଡ଼ିଆ) 🚧 In Progress
Assamese (অসমীয়া) 🔜 Open
Urdu (اردو) 🚧 In Progress
Sanskrit (संस्कृत) 🚧 In Progress
Maithili 🔜 Open
Kashmiri 🔜 Open
Konkani 🔜 Open
Sindhi 🔜 Open
Dogri 🔜 Open
Bodo 🔜 Open
Manipuri 🔜 Open
Santali 🔜 Open

📊 Data Sources (All Free & Public)

Source Used For
CDSCO Master medicine database — batch numbers, manufacturers, drug alerts
Jan Aushadhi Portal Generic medicine store locations across India
PMJAY Hospital Locator Ayushman Bharat empanelled hospitals
OpenStreetMap / Overpass API Pharmacy locations, routing
NHP — National Health Portal Drug monographs for RAG health assistant

🏆 GSSoC 2026

This project is participating in GirlScript Summer of Code 2026 under both:

  • 📂 Open Source Track — 10 labeled issues (Coming Soon) for all skill levels
  • 🤖 Agents for India Track — CDSCO autonomous alert agent (Coming Soon)

We are also a Cloudinary Bounty Partner project — contributors who build features using Cloudinary's Media API earn bonus GSSoC leaderboard points.


💬 Community


❓ FAQ

Is SahiDawa free?

Yes. SahiDawa is completely free and open source.

Can I contribute without writing code?

Absolutely! You can contribute by improving documentation, translating content, testing features, reporting bugs, or suggesting enhancements.

How do I report a bug?

Open a new issue using the Bug Report template available in this repository.

⭐ Support the Project

If you find SahiDawa useful, consider supporting the project by:

  • ⭐ Starring the repository
  • 🍴 Forking the project
  • 🐞 Reporting bugs
  • 💡 Suggesting new features
  • 🤝 Contributing code or documentation

📜 License

SahiDawa is licensed under the MIT License — free to use, modify, distribute, and deploy.

See LICENSE for full text.

👥 Contributors

Thank you to all the incredible people who have contributed to making SahiDawa a reality! 🙌

SahiDawa Contributors

🙏 Acknowledgements

  • GirlScript Foundation for GSSoC 2026
  • CDSCO for the public drug database
  • Sarvam AI for Indian language models
  • Cloudinary for media infrastructure & GSSoC bounty partnership
  • Every contributor who believes healthcare is a right, not a privilege

❤️ Why Open Source?

Healthcare accessibility should not depend on income, location, or language.

SahiDawa is community-driven and built to remain free forever.

Built with ❤️ for 1.4 billion Indians

If this project helps even one person avoid a fake medicine, it was worth it.

About

SahiDawa is an open-source platform that helps citizens verify medicines, find trusted pharmacies, and report suspicious drugs — designed for low-bandwidth environments and multilingual access across India.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages