Project Info
Inspiration
: The Intake Bottleneck Imagine a patient in rural India who simply feels unwell. Right now, that patient's reality is a bus ride, lost wages, and a full day of travel just for a ten-minute consultation. Care should begin with a conversation, not a bus ride. We looked at rural India and realized that the healthcare system doesn't just break at the diagnosis but it breaks at the intake. For hundreds of millions of people, a ten-minute consult costs a full day of travel and lost wages, so care is deferred until it becomes an emergency. Existing text-first apps exclude low-literacy users, and when patients finally see a doctor, their story gets lost in translation. We were inspired to build a system that patiently listens to a frightened person's rambling account and translates it into a structured, clinician-ready format.
What it does
: The Continuous Care Loop Nirog is a comprehensive rural tele-health ecosystem that connects patients, doctors, and pharmacies in one continuous, seamless loop. The Intake: It starts with ARIA, a live, 3D AI nurse who talks to patients in their native language using voice recognition. The Handover: ARIA distills the conversation into a 30-second SBAR (Situation, Background, Assessment, Recommendation) document for the doctor. The Consult: Using an atomic "pool-and-claim" queue, the system connects the patient to an on-call doctor for a video, audio, or chat consultation. The Fulfilment: Prescriptions are geographically routed to a verified partner pharmacy for local delivery, and the entire encounter is auto-filed to the family’s unified ABHA health vault.
How we built it
: A Serverless, Secure Chassis We managed this product end-to-end with a focus on a thin client backed by a heavy, secure data infrastructure. Frontend: The web platform is built on Next.js 16 and React 19, utilizing the App Router. The mobile reference is built natively on Expo SDK 54, utilizing 14 real Expo modules for audio, blur, and location. AI Backend: We used a stateless AWS Lambda architecture utilizing Amazon Bedrock (gpt-oss-120b) for reasoning and Voxtral for speech-to-text. The Retriever: To diagnose accurately, we built a custom Hybrid RAG search over 13,144 conditions using a 512-d Titan V2 vector index. Database & Security: The entire core runs on Supabase (Auth, Postgres, Storage, Realtime). We implemented rigorous PostgreSQL Row-Level Security (RLS) to ensure patient data is consent-gated and strictly isolated.
Challenges we ran into
: The Zebra Problem & Edge Resilience The "Zebra Problem" in Vector Search: When we first used pure cosine similarity for our AI, it failed wildly. Because rare diseases share similar descriptive words with common ones, the AI ranked rare OMIM syndromes above a common migraine. We had to engineer a custom scoring algorithm blending BM25 (weighted 0.6) and cosine (weighted 0.4), multiplied by a prevalence prior to ensure base clinical rates were respected. Voice Capture on Android: Getting a live transcript while the user was still speaking was brutal. Android's MediaRecorder creates incomplete containers that can't be decoded mid-sentence. We solved this by moving the microphone into a WebView using getUserMedia to stream continuous PCM audio directly to our backend. WebRTC on Flaky Networks: Building peer-to-peer video for rural networks resulted in "connected but no media" errors. We had to build a custom /api/ice route to inject STUN/TURN configurations and buffer ICE candidates over Supabase Realtime to ensure the media connected properly.
Accomplishments we're proud of
: True Product Execution We are incredibly proud that this is a shipped, functional architecture, not just a chatbot wrapper. Real-time 3D on Budget Devices: We successfully optimized ARIA's real-time lip-sync to run dynamically inside a WebView on a standard ₹10k Android phone. Zero-Signal Resilience: We bundled a highly compressed (0.57 MB) offline directory of 10,700+ verified Indian facilities. Using a local haversine scan, the app can instantly route patients to the nearest hospital even with zero network bars. Strict Privacy Boundaries: We successfully engineered the pharmacy console so that dispensers only receive the medication lines and a delivery snapshot, they are entirely blocked from accessing the patient's clinical chart or AI intake notes.
What we learned
: Data Intelligence & Clinical Honesty We learned that raw data analytics and massive LLMs are not enough for healthcare; context is everything. We realized that a model that only reports what it found is dangerous; an AI that explicitly reports what it failed to establish is actually useful to a doctor. We learned to hardcode our emergency escalation (using 40 regex rules) before the LLM even sees the text, because AI should not be making life-or-death triage decisions. Finally, we learned that user experience dictates trust hiding 2 to 8 seconds of server latency behind ARIA murmuring "mm-hm" made the difference between a robotic delay and a humane conversation.
What's next
: The Path to Production Nirog is currently a highly robust architectural demo, and our next steps are entirely focused on clinical governance and production readiness. Clinical Validation: We will integrate the AI pipeline with strict human-in-the-loop safeguards and undergo formal medical review. Infrastructure Hardening: We plan to deploy managed, self-hosted TURN servers for bulletproof rural video calling and implement Supabase Realtime channel authorization to lock down call rooms. Pharmacy Operations: We will transition the pharmacy onboarding from "auto-verify" to a dedicated admin console for human verification of drug licenses and pharmacist certificates.
Nirog — Doctor Web Portal
The doctor-facing web application for the Nirog Care Platform — a continuous telehealth platform for rural India. It pairs with the existing patient mobile app (Expo) and gives clinicians a responsive workspace to review AI intake, run consultations, and file care plans.
Built from the platform pitch (output/pdf/Nirog_Care_Platform_Team_Pitch.pdf):
identity, consent-driven records, ARIA (AI intake) handover, and a safe path to
real teleconsultation.
How Codex and GPT-5.6 were used
Codex powered by GPT-5.6 was used as the primary engineering collaborator throughout Nirog’s development—not merely for isolated code completion.
Codex helped us:
- Translate the rural-care product concept into an end-to-end care loop: ARIA intake → doctor review → consultation → care plan → fulfilment → follow-up.
- Build and refine the Expo/React Native patient application and the Next.js doctor portal.
- Design the shared clinical data model, Supabase authentication, consent-scoped access, Row-Level Security policies and immutable audit trail.
- Implement ARIA’s conversational intake, AWS-backed AI services, speech features, patient records, nearby-care discovery and teleconsultation workflows.
- Diagnose Android build, authentication, navigation, WebRTC, asset, animation and deployment issues using live terminal, browser and desktop-app inspection.
- Review and correct privacy and authorization problems discovered during end-to-end testing.
- Run TypeScript checks, inspect runtime behaviour, test key patient/doctor workflows and prepare the APK, documentation and submission materials.
- Iterate on interaction design, accessibility, error states and the “Quiet Glass” clinical interface.
Codex was used agentically: it inspected the real codebase, edited implementation files, ran commands, examined failures, verified fixes and continued iterating until the workflows worked together. GPT-5.6 supplied the reasoning needed to connect product requirements, clinical safety, mobile engineering, backend security and deployment into one coherent system.
All final product decisions were reviewed by the team. Nirog is currently a demonstration using simulated data; real clinical deployment would require specialist medical, legal, DPDP and ABDM review.
The care loop
ARIA intake → Doctor review → Consult → Care plan → Fulfilment → Follow-up
(voice) (red flags) (a/v/chat) (Rx+notes) (meds/tests) (reminders)
The north-star metric is resolved care episodes — not logins or AI messages.
Tech stack
| Layer | Choice |
|---|---|
| Framework | Next.js 16 (App Router, RSC, Server Actions, Turbopack) |
| Language | TypeScript (strict) |
| Styling | Tailwind CSS v4 + a bespoke "Quiet Glass" design system (src/app/globals.css) |
| UI | Hand-built shadcn-style primitives (src/components/ui) + lucide-react |
| Motion | Motion (Framer Motion) — scroll-scrubbed landing |
| Auth | Supabase Auth (@supabase/ssr, cookie sessions) — doctor sign-in, JWT identity |
| Validation | Zod |
| Data | Swappable source: authenticated Supabase (RLS-enforced, default) ⇄ in-memory mock ⇄ Prisma |
| Security | Row-Level Security on every table + Storage bucket, gated by a consent function |
One shared API contract, three backends
The portal never touches a database directly — it calls NirogDataSource
(src/lib/data/source.ts). Three implementations satisfy it:
supabase-source.ts— authenticated Supabase client; every query runs as the signed-in doctor so RLS enforces access in the database (default).mock-source.ts— realistic in-memory data, zero setup.prisma-source.ts— Postgres via Prisma (service role).
Toggle with NIROG_DATA_SOURCE=supabase | mock | db.
Security model (Supabase-native)
- Auth: doctors sign in via Supabase Auth;
Doctor.authUserIdlinks the profile toauth.users. Middleware refreshes the session and guards/portal. - RLS: enabled on every table. A
current_doctor_id()function mapsauth.uid()→ the doctor, andpatient_accessible()gates patient data by active consent or queue membership. The anon/public API returns nothing. Policies live insupabase/policies.sql. - Storage: private
patient-documentsbucket, files at<patientId>/<file>, withstorage.objectspolicies using the same consent function. Uploads/downloads use short-lived signed URLs. - Prisma manages the schema (
db push) and seeding (service role, which bypasses RLS). The seed also provisions the demo doctor's Supabase Auth user.
Quick start (mock data — no database)
pnpm install
# an .env is already provided for the demo; otherwise: cp .env.example .env
pnpm dev # http://localhost:3000
Open http://localhost:3000 for the scroll-world landing, then Enter workspace.
Demo doctor: ananya.rao@nirog.health · nirog-demo
Backend: Supabase (live)
This project is connected to a Supabase Postgres project (nirog-care,
region ap-south-1 / Mumbai). .env holds the pooled DATABASE_URL (app,
port 6543) and the session DIRECT_URL (migrations, port 5432), and
NIROG_DATA_SOURCE=db. Nothing in the UI changed — the same NirogDataSource
contract now resolves to prisma-source.ts against Supabase.
Useful commands:
pnpm prisma db push # sync schema.prisma → Supabase
pnpm db:seed # (re)load Dr. Rao, patients, ARIA handovers, queue
pnpm db:studio # browse the live data in Prisma Studio
To run fully offline instead, set NIROG_DATA_SOURCE=mock (no DB needed), or
point DATABASE_URL/DIRECT_URL at local Postgres via pnpm db:up (docker).
The seed hashes the demo password with bcrypt, so login works identically in
every mode.
What's inside
src/
app/
page.tsx Scroll-world landing (hero → care world → workspace → trust)
(auth)/login/ Doctor sign-in (split brand panel + credentials form)
portal/
layout.tsx Dark icon rail + topbar + mobile tab bar
page.tsx Today — stats, live triage queue, ARIA spotlight, trust log
patients/ Consent-scoped patient list + full chart
consult/[queueId]/ Consultation: mock a/v stage + care-plan capture
audit/ Immutable trust log (who / what / why)
settings/ Verified identity, security, languages, data source
actions.ts Server actions: accept handover, file encounter (Zod-validated)
components/
landing/ Scroll-scrubbed journey + dioramas built from real UI
portal/ Queue, ARIA handover, clinical vocabulary, consult
ui/ Quiet Glass primitives (button, card, badge, avatar, input)
brand/ Logo / diagnostic mark
lib/
domain/ Shared types + clinical labels (the contract)
data/ source.ts + mock-source.ts + prisma-source.ts + seed.ts
auth.ts, auth.config.ts NextAuth v5 (split for edge-safe middleware)
prisma/schema.prisma Identity, care relationships, consent, audit, clinical
Design system — "Quiet Glass"
Apple/iOS-derived clinical palette from the pitch: calm canvas, white panels, hairline borders, blue primary, purple for ARIA, and semantic triage colours (red / amber / green). Full light + dark themes (dark supports night-shift clinicians). Clinical figures use tabular numerals.
The scroll-world landing
The landing is a scroll-scrubbed "fly through the care world" — a continuous camera dive through five dioramas (Intake → Triage → Consult → Care plan → Continuity), each built from the real product UI so the world is made of the same material as the workspace.
Note on Higgsfield video: the
scroll-worldskill can replace the designed dioramas with AI-generated cinematic video clips (Higgsfield). That path needs Higgsfield credits, which weren't available at build time, so this ships the credit-free designed version. The section structure insrc/components/landing/scroll-journey.tsxis ready to accept video clips per scene when credits are added.
Safety & scope
This is a product/architecture demo on simulated data. Real clinical deployment requires the pitch's non-negotiables (step-up auth for prescribing, encrypted documents, break-glass audit, DPDP + ABDM review) and specialist legal and medical sign-off. ARIA output is always shown as unverified until a clinician accepts it.
Analysis
View
Metric
- 21
- 17
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- Next.jsIn code
- PythonIn code
- ReactIn code
- SQLIn code
- SupabaseIn code
- Tailwind CSSIn code
- TypeScriptIn code
- GoClaimed
8 of 9 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- Claude CodeCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
850 KB
Source files
137
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
crusheR-058/nirog-care
155 files · 1.2 MB · @ b4916f3
Structure
Interface
86 files · 55%Screens, components and styles rendered to the user.
API & routing
2 files · 1%Request entry points: routes, handlers and controllers.
Application logic
28 files · 18%Domain rules, services and shared utilities.
Data & schema
12 files · 8%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- TypeScript67%
- YAML19%
- Python4%
- Markdown4%
- SQL4%
- CSS1%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
package.json
npm · 27- @prisma/client
- @radix-ui/react-slot
- @supabase/ssr
- @supabase/supabase-js
- bcryptjs
- class-variance-authority
- clsx
- date-fns
- lucide-react
- motion
- next
- react
- react-dom
- tailwind-merge
- zod
- +12 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.