Back to projects

Medical Innovation Finder (Next.js + AI)

Built and run a live web app for a client that gathers new medical research, clinical trials and regulatory approvals from trusted public sources into one searchable dashboard, with fact-checked AI summaries and scheduled daily updates.

Impact

Delivered a live, production web app for a client, owned end to end from build to operation.
Kept AI costs predictable (about $0.0009 a summary) with accuracy checks built in.

The client wanted one place to follow new medical innovations without checking a dozen sites. Research papers, preprints, trials and approvals from the FDA, MHRA and EMA all publish in different formats and on different schedules.

  • Relevant updates were spread across many sources (PubMed, Europe PMC, bioRxiv, medRxiv, ClinicalTrials.gov, regulators, news).
  • The same paper often appears in several sources, so a naive feed fills up with duplicates.
  • Papers get retracted long after publication, and a feed that never rechecks keeps showing them.
  • AI summaries of medical content are only useful if they're accurate, and the running cost has to stay small and predictable.
  • Aggregate the sources into one feed with search, filters, saved items and shareable collections.
  • Keep data fresh automatically on a schedule, without hitting third-party rate limits.
  • Show short AI summaries only after they've been checked against the source.
  • Run it as a production service: monitored, cost-capped and cheap to operate.
  • Next.js 15 (App Router, TypeScript) on Vercel, with API routes for the feed, search and scheduled jobs.
  • PostgreSQL on Neon via Prisma, with Postgres full-text search; Upstash Redis for caching and per-IP rate limits.
  • One crawler per source behind a shared interface; duplicates across sources are merged into one record.
  • Vercel schedules run a daily refresh, a daily retraction check and an hourly AI summary job.
  • AI summaries use Claude Haiku, with a second model call fact-checking each one before it's shown.
  • Feature branch → pull request → CI: dependency audit, lint (zero warnings), type-check and tests.
  • Every PR gets a Vercel preview deployment with its own Neon database branch.
  • Database migrations are applied before merging any code that depends on them.
  • Merging to main deploys to production automatically.
Cache third-party API responses (6-hour TTL)
Data can be a few hours old, but the app never hammers the sources or hits their rate limits.
Rotate topic searches across days and cap AI summaries per day
Each topic refreshes every few days rather than daily, but AI spend stays at roughly $3/month.
Fact-check every AI summary before showing it
A second model call per summary and some summaries withheld, but readers only see summaries that match the source.
Only use sources whose terms clearly allow it
Some useful sources are left out for now, but the app stays on the right side of licensing.
  • Secrets live in platform environment variables, never in the repo.
  • Per-IP rate limits on read and write endpoints.
  • CI fails on high or critical production dependency advisories.
  • AI summaries carry a clear "not medical advice" note, and each source is credited.
  • An external uptime monitor watches a health endpoint that fails if the database is down or data is over 30 hours old.
  • The daily refresh has a time budget so one slow source can't overrun the function limit.
  • Rate limiting fails open if Redis is unavailable, so a cache outage doesn't take the site down.
  • Retracted papers are flagged daily and pulled from the feed, with a notice kept on their page.
  • Live in production with automated daily updates across research, trials, regulatory approvals and news.
  • A full topic-search day stores around 500 new items in about 11 seconds.
  • AI summaries stop exactly at the daily cap, keeping spend within budget.
  • Review real AI costs after the first weeks in production.
  • Tighten the fact-checker on subtle errors.
  • Add more sources once their terms of use are clear.