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
- About The Project
- The Problem
- Screenshots
- Architecture
- Tech Stack
- Features
- Getting Started
- Environment Variables
- Database Setup
- Project Structure
- API Reference
- Contributing
- Feature Roadmap
- License
- Contact
- Acknowledgements
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.
| 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.
┌─────────────────────────────────────────────────────────────────┐
│ 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) │
│ └───────────┘ │ └───────────────┘
└─────────────────┘
User Request
│
▼
┌──────────┐ ┌──────────────┐ ┌─────────────┐
│ Next.js │───▶│ Middleware │───▶│ Page/API │
│ Router │ │ (Auth Check) │ │ Handler │
└──────────┘ └──────────────┘ └──────┬──────┘
│
┌──────────────────────┬┘
▼ ▼
┌─────────────┐ ┌──────────────┐
│ Prisma ORM │ │ OpenStreetMap│
│ (Database) │ │ APIs │
└─────────────┘ └──────────────┘
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 │
└──────────────┘
| Technology | Purpose |
|---|---|
| React Framework (App Router) | |
| UI Library | |
| Type Safety | |
| Styling | |
| Component Library | |
| Data Visualization | |
| Icons |
| Technology | Purpose |
|---|---|
| Authentication Framework | |
| Database ORM | |
| Database | |
| Schema Validation | |
| Password Hashing |
| Technology | Purpose |
|---|---|
| Hospital Geolocation | |
| Navigation Links | |
| Email Service | |
| Rate Limiting |
| Technology | Purpose |
|---|---|
| Serverless PostgreSQL | |
| Code Linting | |
| Dev Server Bundler |
| 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 |
- 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
- Node.js >= 18.x
- npm >= 9.x (or yarn/pnpm/bun)
- PostgreSQL database (or a Neon account)
- Google OAuth credentials (Google Cloud Console)
- GitHub OAuth credentials (GitHub Developer Settings)
# 1. Clone the repository
git clone https://github.com/<your-username>/arogya-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 devOpen http://localhost:3000 in your browser.
npm run build
npm startCreate 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
.envfile. It is already included in.gitignore.
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
}# 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 initarogya-assam/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout (fonts, theme, providers)
│ ├── page.tsx # Landing page
│ ├── screen/
│ │ └── page.tsx # Anemia screening questionnaire
│ ├── result/
│ │ └── page.tsx # Screening results display
│ ├── hospitals/
│ │ └── page.tsx # Hospital finder (protected)
│ ├── dashboard/
│ │ └── page.tsx # Patient dashboard (protected)
│ ├── signin/
│ │ └── page.tsx # Sign in page
│ ├── signup/
│ │ └── page.tsx # Sign up page
│ ├── soon/
│ │ └── page.tsx # Coming soon page
│ └── api/
│ └── auth/
│ └── [...all]/route.ts # Better Auth API handler
│
├── components/
│ ├── landing/ # Landing page components
│ │ ├── navbar.tsx # Navigation header
│ │ ├── hero.tsx # Hero section
│ │ ├── problem.tsx # Problem statement
│ │ ├── solution.tsx # Solution showcase
│ │ ├── faq.tsx # FAQ accordion
│ │ └── footer.tsx # Footer with contact info
│ └── ui/ # shadcn/ui components
│ ├── button.tsx
│ ├── card.tsx
│ ├── input.tsx
│ └── ...
│
├── lib/ # Utility & config modules
│ ├── auth.ts # Better Auth server config
│ ├── auth-client.ts # Better Auth client config
│ ├── db.ts # Prisma client singleton
│ ├── openstreetmap.ts # Hospital geolocation API
│ ├── password.ts # Bcrypt hash/compare
│ ├── token.ts # Verification token generator
│ ├── validators.ts # Zod schemas
│ └── utils.ts # Class name utility
│
├── hooks/
│ └── use-mobile.ts # Mobile viewport detection
│
├── prisma/
│ └── schema.prisma # Database schema
│
├── types/
│ └── bcrypt.d.ts # Type declarations
│
├── middleware.ts # Route protection middleware
├── package.json
├── tailwind.config.ts
├── tsconfig.json
└── next.config.ts # Next.js config (Turbopack)
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 |
| 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 |
Contributions make the open-source community an incredible place to learn, inspire, and create. Any contribution you make is greatly appreciated.
- Fork the repository
- Clone your fork
git clone https://github.com/<your-username>/arogya-assam.git
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes and commit
git commit -m "feat: add amazing feature" - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
We follow Conventional Commits:
| Prefix | Usage |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
style: |
Formatting, no code change |
refactor: |
Code refactoring |
test: |
Adding tests |
chore: |
Maintenance tasks |
- Use TypeScript for all new files
- Follow existing code style and patterns
- Use shadcn/ui for new UI components
- Write meaningful commit messages
- Test your changes locally before submitting a PR
- Keep PRs focused — one feature/fix per PR
Looking for something to work on? Here are features we'd love help with:
- Add loading skeleton for landing page
- Improve form accessibility (ARIA labels)
- Add more FAQ questions
- Dark mode toggle improvements
- Add Assamese translations for hospital finder page
- Patient Medical Records — Store and view screening history
- PDF Report Generation — Download screening results as PDF
- PWA Support — Full offline capability with service worker
- SMS Notifications — Send results via SMS for non-smartphone users
- Admin Dashboard — Analytics for ASHA workers and health officials
- Multi-language — Add Hindi, Bengali, and other regional languages
- Screening History Chart — Recharts-based visualization of past screenings
- AI Health Assistant — Chatbot for health queries using LLM
- Telemedicine Chat — Real-time chat with hospital staff
- Appointment Booking — Schedule visits with nearby hospitals
- Blood Bank Finder — Locate blood banks with availability
- Emergency SOS — One-tap emergency services with location sharing
- ASHA Worker Portal — Dedicated portal for community health workers
- Government Health API Integration — Connect with NHA/ABDM APIs
- Wearable Device Integration — Sync with health monitoring devices
- 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
Distributed under the MIT License. See LICENSE for more information.
MIT License
Copyright (c) 2025 Arogya Assam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Project Maintainer: Yash Sharma
Project Link: https://github.com/your-username/arogya-assam
- Next.js — React framework
- Better Auth — Authentication
- Prisma — Database ORM
- shadcn/ui — UI components
- OpenStreetMap — Geolocation data
- Tailwind CSS — Utility-first CSS
- Lucide Icons — Beautiful icons
- Neon — Serverless PostgreSQL
- Recharts — Charting library
- Vercel — Deployment platform
Built with ❤️ for the people of Assam
⭐ Star this repo if you found it useful!