Inspiration Nearly 1 in 3 Americans report not taking their medications as prescribed due to cost. At the same time, millions of dollars worth of unexpired, sealed medications are discarded every year by patients who no longer need them. We saw a direct, actionable connection — what if we could bridge those two groups through a trusted clinic network? MedBridge was born from the question: why can't unused medication reach someone who desperately needs it?

What it does MedBridge is a full-stack medication redistribution platform connecting donors, free clinics, and uninsured patients across Colorado:

Donors submit unused medications through a guided drop-off flow with AI-powered prescription and state ID verification via the Groq API Clinic pharmacists physically inspect donations through a secure admin portal, approving or rejecting each item before it enters live inventory Patients search for medications by name and zip code, upload their prescription and ID for AI verification, and reserve available supply — or join a verified waitlist if the medication isn't currently in stock A smart match engine automatically notifies waitlisted patients via email the moment a matching donation is approved, ranked by distance using Haversine geolocation Patients confirm pickup via a unique claim link, closing the loop on the dispensed transaction for pharmacist records How we built it Next.js 14 App Router for both frontend and API routes (fully serverless-compatible) JSON flat-file database (medbridge.json) with an in-memory cache layer — no native DB dependencies, runs anywhere Groq API (llama-4-scout-17b) for real-time vision-based document verification — prescription authenticity and government ID validation, run sequentially so every failure is attributed to the specific document HRSA federal database integration to seed and sync real Colorado Federally Qualified Health Centers (FQHCs) Haversine distance matching with a 300-mile statewide radius Resend / Twilio for patient notification emails and SMS Tailwind CSS for a clean, accessible dark-mode UI Challenges we ran into AI verification reliability: Google Gemini hit quota limits (limit: 0) mid-development, forcing a mid-sprint migration to Groq. We also discovered that parallel document verification lost error attribution — switching to sequential calls (Rx first, then ID) fixed the "which document failed?" problem Donor verification UX: Initially tried photo-based verification of medication packaging, but donors donating 100+ pills can't photograph every blister strip. We scrapped that and designed a pharmacist inspection queue instead — closer to how real programs like SIRUM work ID type integrity: Our JSON DB stores IDs as integers with strict === equality. Subtle type mismatches between JSON-parsed request bodies and stored integers caused silent failures in dispensing that took careful tracing through the call stack to diagnose Claim-to-portal sync: The patient claim route initially only set status: 'dispensed' without dispensed_at or dispensed_quantity, so the clinic's dispensed transactions panel never populated Accomplishments that we're proud of A complete, end-to-end medication lifecycle: donor drop-off → pharmacist inspection → AI-verified patient reservation → waitlist matching → dispensed transaction log Real federal clinic data (HRSA FQHCs) powering the network — not placeholder seed data Document verification that pinpoints which document failed with specific, actionable error messages A pharmacist queue that mirrors real-world regulated medication donation workflows What we learned Domain constraints matter more than tech choices. Medication redistribution has FDA REMS restrictions, expiry rules, quantity thresholds, and chain-of-custody requirements — the product decisions were driven by regulation, not preference Vision LLMs are powerful but brittle at the edges. Quota exhaustion, unexpected response formats, and confidence calibration all required defensive coding A simple flat-file database with careful in-memory caching is surprisingly production-capable for a focused, low-concurrency use case What's next for MedBridge Expand beyond Colorado to a full 50-state HRSA network HIPAA-compliant encrypted storage for verified patient documents Native mobile app for donors with camera-first drop-off flow Predictive demand forecasting — alerting clinics which drugs are most needed in their zip code Partnerships with pharmacies and hospital systems for bulk medication diversion programs DEA-compliant audit trail exports for clinic regulatory reporting

Built With

Share this project:

Updates