← Back to portfolio

Meducate API

Medical Data REST API — Case Study

meducateapi.com — currently under development
.NET 10Blazor ServerPostgreSQLSemantic KernelHangfireRailway

The Problem

Medical reference data from sources like MedlinePlus (U.S. National Library of Medicine, 2,000+ health topics) and PubMed is unstructured and inconsistent — each source uses different formats, update cycles, and access methods. A single condition like Type 2 Diabetes might appear across multiple providers with conflicting field names, missing symptoms, or outdated treatment info. Developers building health education tools end up writing brittle scrapers and hand-rolled parsers that break every time an upstream source changes, duplicating effort that could be solved once at the infrastructure level.

Architecture & Tech Decisions

Meducate follows Clean Architecture across four layers — Domain, Application, Infrastructure, and Presentation — so the data providers, LLM processor, and persistence layer can each be replaced independently. It ships as a .NET 10 monolith deployed on Railway, keeping operational complexity low while the product is in its early stage.

  • LLM ingestion pipeline — Hangfire runs two daily jobs: a TopicDiscoveryJob at 2 AM UTC fetches new topics from MedlinePlus and PubMed, then an LLM classification step (Semantic Kernel + OpenAI GPT-4) assigns each topic an ICD-10 category (one of 24 standardised medical categories) and a type (Disease, Drug, Procedure, Symptom, etc.). A second extraction pass pulls out structured fields — summary, symptoms, causes, treatments, and citations — before a quality-control stage handles synonym merging and field validation. Existing topics are re-processed at 3 AM UTC so the data stays current. Semantic Kernel was chosen over direct SDK calls because it provides prompt orchestration and makes it easy to swap models or add prompt filters without touching business logic.
  • Blazor Server dashboard — The developer portal uses passwordless magic-link authentication (emails sent via Resend API) with cookie-based sessions. Users create an organisation, generate up to 5 API keys, and monitor usage through a real-time dashboard. Keeping the front-end in Blazor means the entire stack is C# with shared models between the API and UI.
  • PostgreSQL + EF Core — All normalised medical data, user accounts, organisations, and usage metrics live in PostgreSQL 16 via Entity Framework Core (Npgsql). Hangfire also uses PostgreSQL-backed persistence, meaning background jobs survive restarts and failures can be retried from the built-in dashboard.
  • Minimal API surface — The public API exposes topic endpoints (/api/topics, /api/topics/search, /api/topics/{name}) with API-key auth via X-Api-Key header and two-tier rate limiting: 60 requests/min per key plus a configurable daily cap with 80% usage alerts. Response schemas adapt to topic type — a Disease returns symptoms, causes, and treatments, while a Symptom returns related symptoms, associated conditions, and management. Topics that are removed by all upstream providers are automatically removed from the API.

Outcome

Meducate currently ingests and classifies 2,000+ health topics from MedlinePlus and PubMed, each with structured summaries, symptoms, causes, treatments, and citations — all classified under ICD-10 categories and refreshed daily without manual intervention. The developer portal provides self-service onboarding: request a magic link, create an organisation, generate an API key, and start querying structured medical data in minutes.