← Back to work

LifeLine

Real-time hyperlocal blood emergency matching platform that replaces slow, chaotic phone call broadcasts with an automated, concurrency-safe matching network.

Node.js / Express Redis (SET NX PX) MongoDB Atlas ($geoNear) PostgreSQL + Prisma OpenRouter AI Socket.io

The Problem & Real-World Impact

In emergency healthcare, families lose critical hours manually broadcasting blood requests across WhatsApp groups with no coordination, leading to duplicate outreach, fake leads, and double-booked donors.

LifeLine solves this by combining natural-language AI parsing, sub-100ms geospatial donor search, and single-threaded Redis atomic distributed locking to guarantee zero double-booking race conditions under high concurrency.

Key Technical Architecture Highlights

Live Concurrency Pipeline & Mutex Visualizer

Watch 20 concurrent hospital threads race to acquire an atomic distributed lock (SET NX PX 900000) for donor don_8f91a in real time:

LOCK: IDLE (RELEASED)
CONCURRENCY: 20 THREADS
CONFLICTS: 0 REJECTED
SAFETY: 0 RACE CONDITIONS
redis-cli --cluster monitor (SET NX PX 900000)
$ Ready — click "Trigger 20 Concurrent Donor Claims" to execute distributed mutex test.

Verified System Benchmarks

0 Double-bookings under 20 concurrent requests
< 100 ms MongoDB $geoNear 50km donor search
8,000 ms AI parsing timeout ceiling (regex fallback <2ms)
15 min Auto-release reservation lock window (900s TTL)

Tech Stack Breakdown

Frontend Studio

React 18, TypeScript, Vite, Tailwind CSS v3, React Router v6, Lucide React, Framer Motion, Sonner toasts.

Backend Core

Node.js, Express.js, Socket.io, JWT, bcrypt, express-validator, Helmet, Morgan, cookie-parser.

Polyglot Persistence

MongoDB Atlas ($geoNear 2dsphere), Redis / Upstash (SET NX PX locks), PostgreSQL + Prisma ORM (relational audit logs).

AI & Resilience

OpenRouter API (GPT-4o-mini strict JSON mode), 8s AbortController timeout, deterministic regex fallback parser.