Skip to content

YASHSHARMAOFFICIALLY/Argoya_Assam

Repository files navigation

🩺 Arogya Assam

Smartphone-Based Anemia Screening for Rural Assam

Next.js TypeScript Tailwind CSS PostgreSQL Prisma License: MIT

Empowering ASHA workers with a free, offline-capable anemia screening tool that delivers results in under 5 minutes.

Live Demo · Report Bug · Request Feature · Contributing


Table of Contents


About The Project

Arogya Assam is a healthcare platform built to tackle the silent crisis of anemia in rural Assam, India. Designed for ASHA (Accredited Social Health Activist) workers, it provides a WHO-aligned symptom-based screening tool accessible from any smartphone — no internet required for screening.

Patients can also locate nearby hospitals using pincode-based search powered by OpenStreetMap, and access their results through a secure, authenticated portal.

Mission: Make anemia screening accessible, free, and fast for every village in Assam.


The Problem

Statistic Detail
50%+ Women in Assam are anemic (NFHS-5)
67% Children under 5 are anemic
Limited Access to diagnostic labs in rural areas
Low Awareness about anemia symptoms

Traditional screening requires blood tests, lab equipment, and trained technicians — resources scarce in rural Assam. Arogya Assam bridges this gap with a digital-first, symptom-based approach.


Screenshots

Landing Page

Landing Page

Anemia Screening Tool

Screening Tool

Hospital Finder

Hospital Finder

Authentication

Sign In Sign Up
Sign In Sign Up

Mobile View

Home Screening Results
Mobile Home Mobile Screening Mobile Results

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         CLIENT (Browser)                        │
│                                                                 │
│  ┌──────────┐  ┌──────────┐  ┌──────────┐  ┌───────────────┐    │
│  │ Landing  │  │ Screening│  │   Auth   │  │   Hospital    │    │
│  │  Page    │  │   Tool   │  │  Pages   │  │   Finder      │    │
│  └──────────┘  └──────────┘  └──────────┘  └───────────────┘    │
│       │              │             │               │            │
└───────┼──────────────┼─────────────┼───────────────┼────────────┘
        │              │             │               │
        ▼              ▼             ▼               ▼
┌─────────────────────────────────────────────────────────────────┐
│                      NEXT.JS 16 SERVER                          │
│                                                                 │
│  ┌─────────────────────────────────────────────────────────┐    │
│  │                    Middleware Layer                     │    │
│  │            (Route Protection & Auth Guards)             │    │
│  └─────────────────────────────────────────────────────────┘    │
│                              │                                  │
│  ┌──────────────┐  ┌────────┴────────┐  ┌──────────────────┐    │
│  │  Better Auth │  │   API Routes    │  │  Server Actions  │    │
│  │   Handler    │  │  /api/auth/*    │  │                  │    │
│  └──────┬───────┘  └────────┬────────┘  └─────────┬────────┘    │
│         │                   │                     │             │
└─────────┼───────────────────┼─────────────────────┼─────────────┘
          │                   │                     │
          ▼                   ▼                     ▼
┌──────────────────┐  ┌───────────────┐  ┌─────────────────────┐
│   PostgreSQL     │  │  OpenStreetMap│  │   External Auth     │
│   (Neon DB)      │  │  Nominatim +  │  │  ┌───────┐ ┌──────┐ │
│                  │  │  Overpass API │  │  │Google │ │GitHub│ │
│  ┌────────────┐  │  └───────────────┘  │  │ OAuth │ │OAuth │ │
│  │   Users    │  │                     │  └───────┘ └──────┘ │
│  │ Sessions   │  │  ┌───────────────┐  └─────────────────────┘
│  │ Accounts   │  │  │    Resend     │
│  │Verification│  │  │ (Email API)   │
│  └────────────┘  │  └───────────────┘
└──────────────────┘

Request Flow

User Request
     │
     ▼
┌──────────┐      ┌──────────────┐    ┌─────────────┐
│ Next.js  │ ───> │  Middleware  │───>│  Page/API   │
│  Router  │      │ (Auth Check) │    │   Handler   │
└──────────┘      └──────────────┘    └──────┬──────┘
                                             │
                    ┌───────────────────────┬┘
                    ▼                       ▼
             ┌─────────────┐      ┌──────────────┐
             │  Prisma ORM │      │ OpenStreetMap│
             │  (Database) │      │     APIs     │
             └─────────────┘      └──────────────┘

Screening Algorithm Flow

Start Screening
       │
       ▼
┌──────────────┐
│  10 Clinical │
│  Questions   │
│  (EN + AS)   │
└──────┬───────┘
       │
       ▼
┌──────────────┐
│ Risk Score   │
│ Calculation  │
│  (0 - 100)   │
└──────┬───────┘
       │
       ├── Score ≤ 30  ──▶ 🟢 Low Risk
       │
       ├── Score 31-60 ──▶ 🟡 Medium Risk
       │
       └── Score > 60  ──▶ 🔴 High Risk
                               │
                               ▼
                        ┌──────────────┐
                        │ Recommend    │
                        │ Nearby       │
                        │ Hospitals    │
                        └──────────────┘

Tech Stack

Frontend

Technology Purpose
Next.js React Framework (App Router)
React UI Library
TypeScript Type Safety
Tailwind Styling
Shadcn Component Library
Recharts Data Visualization
Lucide Icons

Backend

Technology Purpose
Better Auth Authentication Framework
Prisma Database ORM
PostgreSQL Database
Zod Schema Validation
Bcrypt Password Hashing

Services & APIs

Technology Purpose
OpenStreetMap Hospital Geolocation
Google Maps Navigation Links
Resend Email Service
Upstash Rate Limiting

DevOps & Tooling

Technology Purpose
Neon Serverless PostgreSQL
ESLint Code Linting
Turbopack Dev Server Bundler

Features

Core Features

Feature Description Status
Anemia Screening 10-question WHO-aligned symptom assessment ✅ Live
Bilingual Support English + Assamese (অসমীয়া) ✅ Live
Risk Scoring Clinical scoring algorithm (0-100 scale) ✅ Live
Hospital Finder Pincode-based nearby hospital search ✅ Live
Navigation Google Maps integration for directions ✅ Live
Authentication Email/password + Google & GitHub OAuth ✅ Live
Responsive Design Mobile-first UI for smartphone users ✅ Live
Offline Screening Screening works without internet ✅ Live

Screening Questions Include

  • Age group classification
  • Fatigue level assessment (1-5 scale)
  • Breathlessness detection
  • Dizziness/lightheadedness check
  • Pica/unusual cravings indicator
  • Heart palpitation assessment
  • Pallor severity (none/mild/severe)
  • Iron-rich food intake frequency
  • Menstrual bleeding assessment
  • Recent blood loss history

Getting Started

Prerequisites

Installation

# 1. Clone the repository
git clone https://github.com/YASHSHARMAOFFICIALLY/Argoya_Assam.git
cd arogya-assam

# 2. Install dependencies
npm install

# 3. Set up environment variables
cp .env.example .env
# Edit .env with your credentials (see Environment Variables section)

# 4. Set up the database
npx prisma generate
npx prisma db push

# 5. Start the development server
npm run dev

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

Build for Production

npm run build
npm start

Environment Variables

Create a .env file in the root directory with the following variables:

# ──────────────── Database ────────────────
DATABASE_URL="postgresql://user:password@host:5432/arogya_assam"

# ──────────────── Authentication ────────────────
BETTER_AUTH_SECRET="your-secret-key-min-32-chars"
BETTER_AUTH_URL="http://localhost:3000"

# ──────────────── Google OAuth ────────────────
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"

# ──────────────── GitHub OAuth ────────────────
GITHUB_CLIENT_ID="your-github-client-id"
GITHUB_CLIENT_SECRET="your-github-client-secret"

# ──────────────── Email (Optional) ────────────────
RESEND_API_KEY="your-resend-api-key"

# ──────────────── App URLs ────────────────
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_BETTER_AUTH_URL="http://localhost:3000"

Important: Never commit your .env file. It is already included in .gitignore.


Database Setup

Schema Overview

model User {
  id            String    @id
  name          String
  email         String    @unique
  emailVerified Boolean
  image         String?
  sessions      Session[]
  accounts      Account[]
}

model Session {
  id        String   @id
  token     String   @unique
  expiresAt DateTime
  ipAddress String?
  userAgent String?
  userId    String   → User
}

model Account {
  id           String  @id
  provider     String         // google, github, credential
  accessToken  String?
  refreshToken String?
  userId       String  → User
}

model Verification {
  id         String   @id
  identifier String
  value      String
  expiresAt  DateTime
}

Database Commands

# Generate Prisma client
npx prisma generate

# Push schema to database
npx prisma db push

# Open Prisma Studio (GUI)
npx prisma studio

# Create a migration
npx prisma migrate dev --name init

Project Structure

arogya-assam/
├── app/                          
│   ├── layout.tsx                
│   ├── favicon.ico                
│   ├── page.tsx                  
│   ├── loading.tsx                  
│   ├── globals.css                  
│   ├── screen/
│   │   └── page.tsx              
│   ├── result/
│   │   └── page.tsx              
│   ├── hospitals/
│   │   └── page.tsx              
│   ├── dashboard/
│   │   └── page.tsx              
│   ├── signin/
│   │   └── page.tsx              
│   ├── signup/
│   │   └── page.tsx              
│   ├── soon/
│   │   └── page.tsx              
│   ├── chat/
│   │   └── page.tsx              
│   ├── forgot-password/
│   │   └── page.tsx              
│   └── api/
│       └── auth/
│           └── [...all]/route.ts 
│
├── components/
│   ├── theme-provider.tsx
│   ├── landing/                  
│   │   ├── navbar.tsx            
│   │   ├── hero.tsx              
│   │   ├── problem.tsx           
│   │   ├── solution.tsx          
│   │   ├── mode-toggle.tsx          
│   │   ├── faq.tsx               
│   │   └── footer.tsx            
│   ├── shared/                  
│   │   ├── button.tsx               
│   │   └── design-system.tsx            
│   ├── layout/                      
│   │   └── navbar.tsx            
│   └── ui/                       
│       ├── button.tsx
│       ├── card.tsx
│       ├── input.tsx
│       └── ...
│
├── lib/                          
│   ├── auth.ts                   
│   ├── auth-client.ts            
│   ├── db.ts                     
│   ├── openstreetmap.ts          
│   ├── password.ts               
│   ├── token.ts                  
│   ├── validators.ts             
│   ├── email.ts             
│   └── utils.ts                  
│
├── hooks/
│   └── use-mobile.ts             
│
├── prisma/
│   └── schema.prisma             
│
├── public/
│   ├── types/
│   │   └── bcrypt.d.ts
│   ├── file.svg
│   ├── globe.svg
│   ├── icon-192x192.png
│   ├── icon-512x512.png
│   ├── manifest.json
│   └── window.svg  
│
├── .gitignore
├── components.json
├── Contributing.md
├── eslint.config.mjs
├── LICENSE
├── middleware.ts
├── next.config.ts
├── package-lock.json
├── package.json
├── postcss.config.mjs
├── prisma.config.ts
└── tsconfig.json              

API Reference

Authentication Endpoints

All auth routes are handled by Better Auth at /api/auth/*:

Method Endpoint Description
POST /api/auth/sign-up/email Register with email/password
POST /api/auth/sign-in/email Sign in with email/password
GET /api/auth/sign-in/social?provider=google Google OAuth
GET /api/auth/sign-in/social?provider=github GitHub OAuth
POST /api/auth/sign-out Sign out
GET /api/auth/session Get current session

OpenStreetMap Integration

Function Description
getPincodeCoordinate(pincode) Converts 6-digit Indian pincode to lat/lon
getHospotialsNearby(coords, radius) Queries Overpass API for hospitals within radius
formatHospitalData(hospitals, userCoords) Calculates distance & formats results
calculateDistance(lat1, lon1, lat2, lon2) Haversine formula for distance

Contributing

Read the Contribution Guidelines before contributing to the Project. Follow the below mentioned steps to contribute.

How to Contribute

  1. Fork the repository
  2. Clone your fork
    git clone https://github.com/YASHSHARMAOFFICIALLY/Argoya_Assam.git
  3. Create a feature branch
    git checkout -b feature/amazing-feature
  4. Make your changes and commit
    git commit -m "feat: add amazing feature"
  5. Push to your branch
    git push origin feature/amazing-feature
  6. Open a Pull Request

Commit Convention

Click Here to follow the commit conventions while committing code to this Project.

Code Guidelines

Click Here to read the Code Guidelines before contributing to the codebase.


Feature Roadmap

Click Here to see the features that contributors can work on.

Architecture Improvements

  • Add unit tests (Jest + React Testing Library)
  • Add E2E tests (Playwright)
  • Set up CI/CD pipeline (GitHub Actions)
  • Add rate limiting to API routes (Upstash Redis is ready)
  • Implement proper error boundaries
  • Add Sentry for error monitoring
  • Docker containerization

License

Distributed under the MIT License. See LICENSE for more information.


Contact

Project Maintainer: Yash Sharma

Project Link: Argoya_Assam

Deployed: argoya-assam


Acknowledgements


Star this repo if you found it useful!

About

A Health Application which used to Detect Anemia through Questinoarie without Lab test also it show you nearby hospital around you so that you dont have to search

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors