The visit flow is audio/typed input -> transcript text -> facts -> doctor review -> red-flag rules -> Kannada plan preview -> doctor confirmation -> delivery record/preview.
The web stack is Next.js 16 (App Router) + React 19 + TypeScript.
Pages are server-rendered, server actions handle most data mutations, and audio upload uses POST /api/audio.
Authentication uses HMAC-signed session cookies and bcrypt password hashes.
Staff roles are platform_admin, phc_admin, and doctor, with server-side checks.
Patients are records with no account.
Uploaded audio files are stored under DATA_DIR/storage and served via authenticated /api/audio.
Demo clips under public/demo/ are static assets.
Typed input still works.
Kannada playback uses browser speechSynthesis (lang="kn-IN") where available.
The SwasthVaani Patient App is an offline-ready companion app with an upcoming mobile release.
The patient app simulation at Step 3 and /patient includes playable Kannada audio, medicine cards, the floating doctor-grounded Kannada assistant (ಸಹಾಯಕಿ), and POST /api/patient/reply pushing live replies into /doctor/inbox.
Facts, provenance chips, and care plans are stored in the database.
Seeded demo facts also exist.
Replay plays the linked audio segment, not exact word-level timestamps.
Native offline Android/iOS companion app packaging is an upcoming roadmap release; the demo simulates the patient phone surface in-browser.
The confirmation gate, red-flag rules, audit/deletion behavior for sent visits, delivery records, reminders, and support codes exist in code/DB.
The app should not make up facts.
In this demo, facts come from rule-based extraction over the transcript, from seeded demo data, or from doctor actions; verify behavior before making stronger claims.
Keep recorded audio linked to facts where audio exists.
Require an explicit confirmation step before marking a plan sent.
Catch red-flag symptoms with deterministic transcript rules.
Keep the doctor workflow understandable in a short visit.
No ambient AI voice scribe in this demo.
No multi-language MVP beyond Kannada; other languages are not designed for yet.
A translation gives words, not replayable evidence.
The demo focuses on review, confirmation, and patient-facing plan preview, not ambient scribing.
Any comparison to NHA/EkaCare should include a specific source before being used as a strong claim.
The source chip becomes a label with nothing behind it when typed summaries have no audio.
The cited JMIR Formative Research, 2025, and peer-reviewed study, 2024, report voice assistants preferred by older, lower-education, chronic-condition users.
Add DOI/URL before external submission if possible.
Consultations can be very short, leaving little time for a second explanation; replace this estimate with a named study and setting.
Public reporting describes NHA selecting EkaCare for ambient scribe work; verify with a primary source URL before using as a strong claim.
Bhasha-Abhijnaanam, arXiv 2512.10967, Dec 2025, is cited for code-mixed Kannada-English as a distinct recognition problem; verify exact venue/placement details before external submission.
speechSynthesis lang kn-IN is best-effort; replay is available when a segment has stored audio, while typed segments may have no audio.
PGlite is sufficient for demo/single-machine use but is not suited for multi-clinic concurrent writes.
This needs careful review before production use.
approveAndSend checks care_plans.confirmed_by_patient via canSendCarePlan.
In demo, confirmation is doctor attestation, not patient voice capture or plan-version binding.
Demo data is stored locally under DATA_DIR (Docker: /data).
No Telegram network send in demo.
Retention, backup/restore, and third-party egress policies are not production-ready.
The Phase 1 visit-completion target is measured as the timestamp delta from visit created to care plan marked sent.
The patient-comprehension target uses a post-visit callback with a defined script covering medicine, timing, and warning sign.
The provenance target can be checked with the DB constraint/check that source is NOT NULL on facts.
The confirmation-integrity invariant is that approveAndSend rejects unless confirmed_by_patient is true.
The red-flag recall target is assessed with a scripted test suite against redflags.ts using a defined phrase set.
The cost estimate is $0 on an existing laptop; small VPS cost varies by provider.
Small VPS per clinic cluster; estimate pending workload measurement.
Managed Postgres cost varies if adopted.
Self-hosted or paid API speech cost depends on deployment choice.
Browser-native speech synthesis is available where supported; device quality varies.
Telegram/WhatsApp API costs depend on the chosen channel and volume.
Local disk audio size per visit depends on recording length/format; object-storage cost depends on retention and volume.
Phase 1 demo is designed for no paid API/cloud-credit requirement.
Validate all cost and resource estimates before external commitments.
The Docker named volume swasthvaani-data mounts /data.
All passwords are swasth123.
The seed script creates demo accounts on first run and is idempotent; re-running docker compose up --build is safe.
For a clean reset, use docker compose down -v.
This repo is a local demo with preview-only delivery and doctor attestation.
Clinical deployment would require a separate consent/delivery design, verified egress, secret management, access-control review, backup/restore testing, and clinical safety review.
The demo runs on any machine that runs Docker and Docker Compose v2; it is expected on Linux and macOS, and on Windows via WSL2.
No GPU, no external paid service, no required API key for the demo.
Node 22+ is relevant only for development tooling; the app runtime requires Docker because of the /.dockerenv guard.
I built SwasthVaani for the Scaler × Wispr Flow Hackathon, 2026 — Healthcare track.
The database default is Embedded PGlite (Postgres in WASM) by default.
The database uses Raw SQL, no ORM.
Schema auto-migrates and seeds on first run.
In Docker, DATA_DIR=/data, database persists to /data/pg, audio to /data/storage, and session secret to /data/.session_secret.
Two Docker services (app on port 3000, asr on internal port 8000 / host 8010).
docker compose up --build starts everything with zero API keys.
Recording a patient answer sends the clip to the local asr service: whisper-small-vaani-kannada (CTranslate2 int8) transcribes Kannada, NLLB-200 int8 translates it to English, and a rule layer normalises rural and code-mixed clinical Kannada.
Facts come from rule-based extraction over the transcript (src/lib/extractor.ts), not from a model.
Typed input or 3 scripted Kannada demo lines, used as a fallback when the ASR container is unavailable.
Interactive SwasthVaani Patient App simulation (/patient & Step 3), live patient replies saved to inbound_messages with danger-flag detection, and offline doctor-grounded Kannada assistant (ಸಹಾಯಕಿ).
Red-flag rules are word-matching over the transcript, so a poor transcript can miss a flag.
RLS is enabled with no policies; server role bypasses RLS.
Active control is code-scoped queries and role checks.
Optional external Postgres via DATABASE_URL is experimental (migration/seed/TLS/backup behavior needs review before production use).
Backups should include the full DATA_DIR.
Copying a live database directory can be inconsistent; prefer stopping the container or taking a consistent DB export before backup.
The Phase 1 visit completion target is <=5 min median (target).
The Phase 1 patient comprehension target is >=80% can repeat key instructions (target).
The Phase 1 provenance target is 100% of stored facts have a source chip.
The Phase 1 confirmation target is 0 plans marked sent without confirmation.
The Phase 1 red-flag recall target is >=90% on seeded red-flag phrases (target).
The roadmap describes an initial 2-3 clinics near Tumakuru with ~10-20 patients, followed by 10-15 clinics, 50+ doctors, and shared PHC admin, then a wider public-health rollout.
Phase 2/3 targets should define denominators, collection windows, attribution method, and incident taxonomy before being treated as commitments.
The cited study is Douglass et al., BMC Health Services Research, 2022, n=106.
The study reports: 53.64% of patients had >=1 discrepancy; pharmacist-led follow-up resolved them.
I built SwasthVaani as a Kannada-first voice clinical desk and offline-ready patient companion app for rural Primary Health Centres. Its tagline is “Your words, our care.” The project aims to help patients understand and remember doctors’ instructions through a traceable Kannada record, replayable linked audio, and a Kannada care-plan preview before the doctor confirms and sends the plan.
SwasthVaani is a TypeScript repository on @Kiran-bioinfo’s GitHub with 1 star; it started 2026-11 and was last updated 2026-11.
git clone https://github.com/Kiran-bioinfo/SwasthVaani.git
cd SwasthVaani
docker compose up --build
After starting the app, open http://localhost:3000.
The app also starts outside Docker with an embedded database for local development, and requires no API keys, .env file, or billing account. An optional DATABASE_URL can point to external Postgres, which is experimental.
Kannada speech-to-text and Kannada-to-English translation run locally in the asr service using ARTPARK-IISc/whisper-small-vaani-kannada and NLLB-200, with CTranslate2 int8 on CPU and no API key.
By default, the Kannada speech and translation models are not baked into the image; the asr container downloads them in a background thread on first start and caches them in the hf-cache volume.
The web app is usable immediately and /health reports ready, but a recording attempted before model warm-up completes returns a “still warming up” message.
docker compose build --build-arg BAKE_MODELS=1 asr
For a stage demo where the very first recording must be instant, bake the models into the asr image.
The demo seeds one clinic, four staff accounts, three patients, one finished visit, and three patient inbox replies, including one danger-flagged message.
The sign-in form is prefilled with dr.arjun / swasth123.
Other demo account names are shown as non-interactive chips.
The demo accounts are dr.arjun (doctor), dr.meena (doctor), phc1042 (PHC admin), and admin (platform admin); all use the password swasth123.
The demo visit VS-20261125-0001 contains three demo audio segments, and its visit list shows only the signed-in doctor’s own visits.
Demo clips in public/demo/ are synthetic Kannada speech generated for the demo.
The system turns a recorded consultation into an English briefing; facts can be marked as heard from the patient, inferred, or added by the doctor. When linked audio exists, Replay plays that segment.
A doctor sees facts. A patient sees a plan. Linked audio supports review where it exists.
I see a risk that a text summary can flatten the patient out of the record.
The project describes the English briefing as replaying the patient’s own audio on every line.
At visit end, the doctor plays the care plan in Kannada on a phone preview and records confirmation before marking the plan sent.
In this demo, confirmation is a doctor attestation (“She confirmed by voice”), not patient voice capture or phone-number verification; OTP/number verification is not implemented.
The phone preview shows a simple confirmation button.
Sending stays locked until the doctor records confirmation and all red flags are acknowledged.
The Patient App is an offline-ready companion app described as an upcoming mobile release and live-simulated in the demo at http://localhost:3000/patient.
The Patient App simulation includes a playable Kannada voice plan, doctor-entered medicine cards, warning signs, one-tap confirmation, live patient replies sent to /doctor/inbox, and a floating Kannada Care Assistant (ಸಹಾಯಕಿ) grounded strictly in the doctor’s saved visit notes.
Fixed word-matching rules check Kannada and English transcript text for chest pain, breathlessness, and burning on passing urine; they use no model and can miss symptoms that were never transcribed.
The app does not generate diagnoses or medicine suggestions; medicine cards show doctor-entered or seeded medicines.
RLS is enabled with no policies, the server role bypasses RLS, and clinic/doctor scoping in application code is the active access control.
The doctor inbox shows seeded and live Patient App replies with automatic red-flag danger highlighting.
Support lookup locates clinic, staff, patient, or visit records by short code while redacting patient names. Visit URLs use visit codes, and older UUID visit links still resolve.
Adding a doctor at /phc or opening a clinic at /platform immediately displays a confirmation banner with the newly assigned staff or clinic code and username ready for sign-in.
Deleting a fact removes it from the active briefing; sent visits keep an audit trace, while pre-send draft edits may not retain the same audit record.
The README labels its baseline as context, not a measured baseline for this repository, and says evidence for medication-communication risk should be cited carefully before external use.
The project frames the problem as a language and literacy mismatch in short rural PHC consultations: patients may mix Kannada with English terms such as sugar, BP, tablet, and fever, while advice may be spoken and then recorded in English. I should keep that problem framing distinct from measured outcomes; the supplied README reports no measured clinical outcomes. External Postgres is experimental, and the supplied material does not detail its operational risks.