Pulsely — the running system
Pulsely is the single system you build across the entire book. It is a connected-care platform: a lightweight ambulatory EHR (schedule visits, chart encounters, order labs and prescriptions) fused with remote patient monitoring (RPM/RTM/CCM device streams and critical-value alerts) and a revenue-cycle engine (submit claims, reconcile payments and denials) — all under HIPAA. It is deliberately rich enough to force every backend concept — reads and writes, transactions and money, timelines and search, realtime and async, and a trust boundary with real teeth — yet small enough to hold in your head.
One line: the single system you rebuild across the book — schedule a visit, chart an encounter, order a lab, monitor a vital, submit a claim, get paid.
You rebuild the same system at higher fidelity at each layer, so you feel why each abstraction exists by first living without it. The early Pulsely is intentionally unsafe — no audit trail, double-bookable slots, claims dual-written to the clearinghouse — and in healthcare "wrong" has teeth: a leaked chart is a reportable breach, a lost claim is unpaid work, a dropped critical lab is a patient safety event. You will later call your past self's choices "wrong" — that is the lesson.
Core domain (stable across the whole book)
- Patients — MRN, demographics, coverage, consents; multi-tenant across clinics/orgs.
- Providers & staff — clinicians, front desk, billers; roles that drive RBAC and minimum-necessary access.
- Appointments / scheduling — finite provider slots; the no-double-booking engine (finite inventory).
- Encounters / visits — the central aggregate and state machine: scheduled → arrived → in-progress → signed → billed.
- Charting — notes, vitals, problems (ICD-10), meds (RxNorm), allergies, results (LOINC), procedures (CPT); versioned and temporal.
- Orders — labs, prescriptions, referrals; async fulfillment through external partners.
- Claims / RCM — the money saga: 837 → clearinghouse → 835 → payment/denial → appeal.
- Eligibility — 270 → 271, a sync-feeling check over an async partner.
- Messaging — PHI over WebSockets between care-team members, fully auditable.
- Alerts — critical-value fan-out (a potassium result that can't wait).
- Audit / HIPAA log — immutable, append-only, first-class; logs every chart view, not just writes.
Why these: they cover the full backend spectrum — transactional integrity (no double-booking, exactly-once claims, concurrent charting), high-read temporal data (chart timelines, RPM streams), full-text + exact relevance (patient and clinical search), async workflows (orders, claims, eligibility), realtime (messaging, critical-value alerts), and identity/tenancy/audit (OIDC, RBAC, minimum-necessary, break-glass, RLS) — with a compliance boundary that makes correctness non-negotiable.
Evolution roadmap (one increment per part)
| Stage | After Part | What Pulsely becomes | Key ADR(s) you write |
|---|---|---|---|
| v0 — raw socket | I | A hand-rolled TCP server parsing HTTP/1.1 by hand — POST a vital, GET a patient — behind a TLS-terminating reverse proxy. No framework. | "Why a reverse proxy terminates TLS" |
| v1 — runtime + framework | II–III | The same contract, reimplemented in Node/NestJS: versioned, validated, keyset-paginated chart timelines, rate-limited REST; a signed inbound lab-result/eligibility webhook. | "Why keyset pagination"; "Webhook signature scheme" |
| persistence | IV | A modeled-then-built Postgres clinical core (patients/appointment_slots/encounters/clinical_orders), a Mongo RPM firehose, Redis for sessions/eligibility cache, and a patient/clinical search index; indexes derived from EXPLAIN; a SKIP LOCKED claims/results worker table. | "Postgres vs Mongo per aggregate"; "Index choices from EXPLAIN" |
| distributed | V | Split into services over a broker; a claims/eligibility pipeline with a transactional outbox and idempotent consumers; a Kafka clinical-event log; realtime messaging with critical-value alerts; load-tested and scaled out statelessly. | "Outbox over dual-write"; "Kafka vs queue for clinical events" |
| secured & operable | VI | OIDC login, short-lived access tokens + rotating refresh with a Redis denylist, RBAC + minimum-necessary, row-level multi-tenancy with break-glass; timeouts/circuit breakers/bulkheads around lab/clearinghouse partners; SLOs; OpenTelemetry logs/metrics/traces; an immutable audit log of chart views; a deliberately injected broken-access-control PHI-leak incident you debug and write up. | "RLS for tenant isolation"; "Break-glass emergency access"; "SLOs & error budget" |
| shipped | VII | A trustworthy test suite (Testcontainers + lab/clearinghouse contract tests); multi-stage containers; deployed on HIPAA-eligible AWS under a BAA (ECS Fargate, Aurora, ElastiCache, MSK, S3, SQS) in private subnets via Terraform; a canary/blue-green pipeline with expand/contract zero-downtime migrations on live PHI tables. | "Deployment strategy"; "Expand/contract migration plan" |
| capstone & portfolio | VIII | A hardened, documented, operated platform with a full design doc + ADR library; a brownfield exercise (inherit and safely extend a deliberately messy legacy billing/claims module); break/scale/recover drills; STAR stories for interviews. | The consolidated design doc |
ADR / design-doc index
Each part produces at least one Architecture Decision Record. ADRs accumulate here as you progress, building the design-doc muscle that distinguishes senior engineers. (Template: Context → Decision → Alternatives considered → Consequences → Status.)
- ADRs will be listed here as each part is completed.
How to run it
The lab (Postgres, MongoDB, Redis, Kafka) runs locally via Docker — see Appendix A: Lab Setup. The optional runnable code lives under this folder once you reach the prose stage; each stage is tagged so you can check out Pulsely at any point in its evolution.
Status: project brief defined. Code increments are added as chapters are drafted.