Skip to content
All work
27Medical intelligence platform2026

MedExplain AI

A healthcare workspace that explains medical reports with Gemini grounded in MedlinePlus and PubMed, then routes users to verified doctors — with consent, audit and privacy controls as first-class features.

3
User roles
20
Service modules
22
Migrations
RAG
Grounded answers
Role
Author
Year
2026
Status
Private
Type
Medical intelligence platform

01Overview

MedExplain AI takes a medical report a patient does not understand and explains it, then keeps the conversation going with thread-aware follow-ups, and connects them to a verified doctor when the answer needs one.

Three roles share the system. Patients upload reports, read analyses, chat and manage subscriptions. Doctors apply, get verified, and work appointments from their own dashboard. Admins manage users, doctors, reports, subscriptions, payments, coupons, analytics and audit logs.

The AI is deliberately constrained: Gemini is reached only through backend services, never from the browser, and answers are grounded with retrieval over imported MedlinePlus and PubMed content rather than left to the model's own recall.

02The problem

A model that confidently explains a blood panel is useful. A model that confidently invents one is dangerous, and from the patient's side the two are indistinguishable — which makes ungrounded generation the wrong tool for this domain no matter how good the prose is.

Putting an AI key in a frontend is the second failure. Any client-side call means the key is extractable and the prompt is editable, so the safety constraints exist only as long as nobody opens developer tools.

Health data raises the stakes on everything else. Consent, retention, export and deletion are not settings to add later; a platform holding uploaded medical reports without them should not be accepting uploads.

03Architecture

  1. 01

    RAG over trusted sources

    Medical knowledge is imported from MedlinePlus and PubMed and retrieved to ground answers. The model explains retrieved material rather than recalling it, which is the difference between a summary and a guess.

  2. 02

    AI behind the backend only

    Gemini is called from backend services. The browser never holds a key, never sees the system prompt, and cannot bypass the trusted-source context the answer is built on.

  3. 03

    Report pipeline

    Upload, validation, analysis, history and detail views — with upload validation on the way in, because a file-accepting endpoint on a health platform is the highest-value target in the system.

  4. 04

    Doctor marketplace

    Applications or admin-created accounts, a verification step, a doctor workspace, appointments and notifications. Verification is a state in the system, not a badge in a profile.

  5. 05

    Consent and privacy as features

    Consent records, privacy settings, notification preferences and billing-address controls are user-facing surfaces rather than implicit defaults buried in a terms page.

  6. 06

    Payments with a safe simulator

    OPay handles subscriptions, with a development simulator so the billing path can be exercised end to end without moving real money or depending on a sandbox being up.

04Key decisions

Decision 01

Ground it or do not ship it

Retrieval over MedlinePlus and PubMed costs an import pipeline and a retrieval step on every answer. In a medical context that is not optimisation — it is the reason the feature is defensible at all.

Decision 02

Audit logs beside RBAC

Role-based access controls who can reach a report. Audit logs record who did. On health data, the second question gets asked more often than the first.

Decision 03

Strict refresh cookies

Access tokens as bearers, refresh tokens in strict cookies. A stolen access token expires; a stolen refresh token in localStorage is an account.

Decision 04

Accessible motion, not decorative motion

Page entry, cards, dropdowns, toasts, loading and chat states all animate, but the motion communicates state on a platform used by anxious people reading bad news. It is timed to reassure rather than to impress.

05Stack

  • Node.js
  • Express
  • MySQL
  • Gemini API
  • Socket.IO
  • JWT
  • RBAC
  • OPay