Inspiration

People on in-center dialysis travel to treatment about three times a week, and missing sessions is dangerous. For them, and for anyone who relies on step-free transit or a particular hospital, one broken link in the route (an elevator outage, a flooded road, a storm warning) can cut off care. That information is scattered across transit feeds, weather alerts, facility phone lines and word of mouth. We wanted one place that collects the signals and says plainly what is known and what is not: the last line before a missed treatment.

What it does

LASTLINE is a privacy-first critical-service access platform.

  • Real map of US care. Plots 7,443 dialysis facilities (131,946 stations) and 5,283 hospitals from the official CMS directories.
  • Live alerts. Matches active National Weather Service alerts to the facilities in the affected counties.
  • Honest workflow. For any alert, or any simulated outage, it walks through four steps: the signal with its official source, an honest status ("the alert is real; facility impact is unknown"), who could be affected with the nearest alternatives, and an AI-drafted briefing that a human approves or rejects.
  • Real AI at runtime. An NVIDIA Nemotron model served by Nebius Token Factory drafts the coordinator brief from aggregate facts only.
  • Anonymous reporting. Reports get a private tracking token. They start as "community reported" and stay unverified until evidence supports them, and the public view never shows report text or location.

The simulated outage and the Approve button are demonstrations. Nothing is sent to anyone.

How we built it

  • Web: Next.js 15 and React 19 with Leaflet, drawing about 12,700 points on one shared canvas.
  • API: FastAPI on Vercel's Python runtime, with Supabase Postgres/PostGIS for reports.
  • Data pipeline: A standard-library Python script joins the CMS dialysis and hospital listings with US Census ZIP centroids and county FIPS codes. Alerts are matched to facilities through the NWS SAME geocodes, which are county codes.
  • AI: A rate-limited public endpoint holds the Nebius key server-side, accepts only validated aggregate counts and facility names, and fails closed if the model is not configured.
  • Distance: Radius searches use the haversine formula, with $R = 3958.8$ miles:

$$d = 2R\arcsin\sqrt{\sin^2!\tfrac{\Delta\varphi}{2} + \cos\varphi_1\cos\varphi_2\sin^2!\tfrac{\Delta\lambda}{2}}$$

Challenges we ran into

  • No coordinates in CMS data. We placed facilities at their ZIP-code centres and disclosed that on the page.
  • Linking alerts to facilities. We needed county codes on both sides. Matching county names to FIPS codes reached 99.7%.
  • Not overclaiming. A weather alert is not proof a facility failed. We designed every screen around that distinction.
  • Real bugs on the way. Highlight layers created a second canvas that swallowed clicks. Vercel refused to deploy a vulnerable Next.js version. Supabase's direct connection is IPv6-only and unreachable from Vercel, so we switched to the pooler. CMS blocked a default Python client.
  • A public AI endpoint spends real credits. We added strict input limits and rate limiting.

Accomplishments that we're proud of

  • Real data end to end: official CMS directories, live NWS alerts and a live model call, running in production.
  • The product's central idea is visible in the interface: status never claims more than the evidence supports, and a human decides.
  • Tests cover the matching logic and the AI endpoint's limits, and the whole system runs on Vercel and Supabase.

What we learned

  • Trust is a product feature. Wording like "unknown" and "draft, not a fact" matters as much as the algorithm.
  • Open government data is powerful but needs careful joining, and its limits (directory listing is not live capacity) must be stated.
  • A public AI feature needs guardrails from day one.

What's next for LastLine

  • Street-level geocoding and pharmacy data, if an open source becomes available.
  • Transit elevator-outage feeds, starting with a pilot city.
  • A persistent coordinator console with audit trails and approved, consent-based notifications.
  • Partnerships with dialysis providers and patient advocates to validate it with the people it is for.

Built With

Share this project:

Updates

Submission history