r/QuantifiedSelf • u/BloodyJey • 20h ago
Woke up with a random hip infarction at a young age, spent time in the hospital, and ended up building BioStack: a self-hosted home for all my labs, scans, and watch data
galleryHey r/QuantifiedSelf,
A while ago I woke up one random morning with brutal pain in my leg. At first I brushed it off and figured I just slept weird or pulled something. Every single step hurt like hell, I still tried to walk it off for a bit, and eventually realized this wasn't going away and went to the hospital.
The doctors told me I'd had an infarction in my hip joint (avascular necrosis), meaning blood supply cut off and bone tissue around there started dying. Honestly, I didn't even know a joint could have an infarct. I had to be admitted right away, looking at roughly a year of treatment and recovery.
Lying in that hospital bed, one thought kept bugging me: I actually try to take care of myself. I get blood work done, eat decently, live a pretty normal life, and yet this happens out of nowhere. Meanwhile, all my past blood tests, ultrasound reports, hospital papers, and watch data were scattered across random PDFs, messengers, and folders. I wanted one place to hold everything about my body and be able to ask my own AI questions (like what patterns I'm missing, what might be behind certain issues, or what to ask my doctor next) without re-explaining a million things every time, and definitely without uploading my medical history to some random cloud chatbot.
That's how BioStack started, and I finally cleaned it up to open-source under MIT: https://github.com/Green-Blood/biostack
What it actually does right now:
- Keeps your hospital stays, doctor visits, lab reports, and medication/supplement courses on one timeline, with longitudinal charts, reference bands, and before/after course diffs.
- Tracks organ ultrasounds over the years (thyroid, kidneys, liver, etc.) so you can see scan-to-scan changes instead of digging through old PDFs.
- Pulls in Apple Health & Samsung Health ZIP exports (or phone sync webhooks): sleep stages, resting HR, HRV, SpO2, and steps against your own 30-day baseline.
- Runs time-lagged correlation checks locally on your own logs (supplements, caffeine, air pressure, sleep, symptoms) and builds a printable one-page
/doctorsummary before appointments. - Local math first, your own AI second: Tabular lab PDFs and ultrasound measurements parse locally with rules. When you do want AI summaries or Q&A, it builds a compact structured snapshot from your SQLite DB and talks to local Ollama / LM Studio (
AI_PROVIDER=openai_compat) or your own Gemini/OpenAI key.
Stack is FastAPI + SQLite + Next.js (single SQLite file + data/ folder, one-click full ZIP backup/restore).
If you want to poke around with synthetic data without touching anything, there's an isolated demo compose:
(opens at http://127.0.0.1:3000)
Still actively building this while recovering. If you try it out, let me know what breaks or what you'd want added next (Garmin/Oura imports, family profiles, custom lab PDF formats, etc.).