DEV Community

Cover image for My Girlfriend Manages Her Family's Health From a Plastic File. I Built Her SehatFile.
Ranbir Singh
Ranbir Singh

Posted on

My Girlfriend Manages Her Family's Health From a Plastic File. I Built Her SehatFile.

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend

What I Built

SehatFile — for my girlfriend, who handles all the health stuff in her family.

Every Indian home has a plastic file. Hers holds years of her family's medical reports — different labs, prescriptions in fading handwriting, none of it sorted, all of it important. Before every doctor visit, she's the one spreading it across the bed and digging through it. And then, in the 90-second consultation, the doctor asks the question nobody can answer precisely: "What medicines are they on, and since when?" Recently, the doctor re-ordered the same tests because she couldn't prove they'd already been done. The information existed. It just wasn't organized by person — so it might as well not have existed.

I built it for her.

She photographs each report once — lab slip or prescription, printed or handwritten, English or Hindi. SehatFile reads it, files it under the right person and date, pulls the medicines into a living medication list, and tracks the key values over time. Before the next appointment, one click generates a one-page doctor's brief: the conditions, the current medications, how the numbers have moved, and the exact questions to ask. She prints it and hands it to the doctor. Ninety seconds, finally used well.

I handed it over to her, and in her words, it's "really a lifesaver."

Demo

The demo shows the real thing: a stack of genuine reports from her family's plastic file, photographed and filed; the timeline building up; the medicine list populating itself; and the doctor's brief generating — the same brief she'll carry to the next appointment.

Code

https://github.com/Ranbir5ingh/sehatfile

Public repo, MIT licensed. README covers the one-command setup. The app runs fully offline once the model is pulled — there is deliberately no cloud component, and that's the point (see below).

How I Built It

Stack: Next.js 16 (App Router) + TypeScript + Tailwind CSS — one codebase, no separate backend. All server logic lives in Route Handlers under app/api/. The database is SQLite via node:sqlite — built into Node.js, zero dependencies, a single file on the machine.

The AI core is Gemma, and the architecture is built around a hard rule: no API route is allowed to touch the model directly. Everything goes through a HealthAI interface in lib/ai.ts with exactly two methods — extractReport(image) and generateBrief(record). Two implementations:

  • MockHealthAI (default) — realistic sample data in the exact same shapes, so the entire app works end-to-end with no model installed.
  • GemmaHealthAI — calls Gemma via Ollama's /api/generate with JSON mode. Switching providers is one env var: AI_PROVIDER=gemma. Zero code changes.

The extraction prompt is the most carefully written part of the project. Medical data punishes hallucination, so its prime directive is: read only what is actually visible; if handwriting is illegible, say so; never invent a value, a date, or a medicine name. Photos are downscaled client-side before they ever reach the model.

The brief prompt turns the structured record into the one-pager: patient snapshot, current medications, key values over time with trends in plain words, recent changes, and 3–5 specific, data-grounded questions for the doctor — explicitly instructed never to diagnose or suggest doses.

Why Does Open Innovation Matter?

This is the section the whole project stands on, so I'll be direct:

1. This tool cannot exist on a closed API. Nobody uploads their family's heart reports to someone else's server. Health data is the most sensitive data a family owns. A closed model would require piping all of it through a vendor's cloud — which means the families who need this most would never trust it. Open weights running locally aren't my preference here. They're the precondition.

2. Free forever isn't a pricing tier, it's the design. A family files reports for years; a parent's chronic illness is a decades-long paper trail. Per-report API billing would put a meter on the exact people who can least afford one. Gemma on the home computer costs nothing per report, forever.

3. It works where the internet doesn't. Small towns, hospital basements, homes with patchy connectivity — the app doesn't care, because nothing leaves the machine.

4. Multilingual without a pipeline. Indian medical documents mix printed English, handwritten English, and Hindi. An open multilingual model reads all three in one pass — no translation service, no OCR vendor, no extra bill.

5. It's inspectable. The prompts, the schema, the brief format — all in the repo. Any family, any clinic, any student can fork it and adapt the brief to their doctor. That's what open innovation actually means: the tool belongs to the people it serves.

Prize Categories

  • Best Use of Gemma — Gemma (vision + text, via Ollama) is the entire AI core: it reads the photographed reports and writes the doctor's brief, on-device.

Top comments (0)