Skip to content
cd ../work

An enterprise LIMS that takes a pathology sample from booking to signed PDF report.

2024 · Healthcare / Diagnostics · role: owner

● status: production·7 services·~2 min read

Java 21Spring BootSpring SecuritySpring Data JPAReactTypeScriptPostgreSQLFlywayCaffeineOpenHTML2PDF

01 — overview

What it is

PathLab digitally transforms pathology lab operations end to end: patients book tests and download secure reports, technicians track samples through a multi-status lifecycle, doctors monitor results, and administrators run the lab on real analytics.

02 — the problem

Why it exists

Pathology labs run on manual, error-prone processes — handwritten registers, long turnaround times, and results patients can't access without a phone call or a second visit.

Lab data is sensitive medical data: it needs strict role separation, audit trails, and secure delivery, not a shared spreadsheet.

03 — architecture

How it's built

A React frontend talks to a layered Spring Boot backend (controller → service → repository → entity) over PostgreSQL. Caffeine caches hot reads, Flyway versions the schema, and reports render through OpenHTML2PDF + FreeMarker templates.

architecture — how requests flowlive
Patient Portalbooking · reportsLab / Admin UIReact + TSSpring Boot API4-role RBACSample Lifecycle6 statusesCaffeine CachePDF EngineOpenHTML2PDF + FTLPostgreSQLFlyway migrations

04 — engineering decisions

The choices that mattered

01

Multi-status sample lifecycle

Samples move through six explicit states — collection pending → collected → in transit → received → tested → discarded — with technician assignment and barcode generation at each step. State is the source of truth, not tribal knowledge.

02

Four-role RBAC done properly

ADMIN, LAB_TECH, DOCTOR, and PATIENT each see exactly their slice: patients their reports, technicians their queue, doctors their patients, admins the whole lab — enforced in Spring Security, not the UI.

03

Deterministic PDF reporting

Parametric results render through FreeMarker templates into OpenHTML2PDF — professional, consistent reports and invoices with bulk-processing support.

04

Performance where it matters

Caffeine caching on the hot read paths (test catalog, pricing) keeps patient-facing pages fast without complicating the write path.

Explain this project

A Laboratory Information Management System on Java 21 / Spring Boot with a layered controller → service → repository architecture over PostgreSQL. Samples move through an explicit six-state lifecycle — the state is the source of truth, with barcode generation and technician assignment at each step — and four roles (ADMIN, LAB_TECH, DOCTOR, PATIENT) are enforced in Spring Security rather than the UI. Reports render deterministically through FreeMarker → OpenHTML2PDF, Flyway versions the schema, and Caffeine caches hot read paths like the test catalog and pricing.

05 — features

What it does

  • Online test booking with catalog browsing and payment tracking
  • Secure patient report access with PDF download
  • Parametric result entry for technicians
  • Booking-trend and test-distribution analytics for admins
  • Email verification, notifications, and audit trails
  • Cloudinary image storage and Flyway-versioned schema

06 — stack

What it runs on

Backend
Java 21Spring BootSpring SecuritySpring Data JPA
Frontend
ReactTypeScriptViteTailwind CSS
Data
PostgreSQLFlywayCaffeine cache
Documents
OpenHTML2PDFFreeMarkerBarcode generation

Want the full story?

The repository has the code, the commits, and the decisions in context — or reach out and I'll walk you through it.