← All notes

Field note ·

Inside DIUT: architecture of an on-premise laboratory platform

A visual tour of how DIUT separates laboratory workflows, infrastructure, and document rendering.

DIUT supports the laboratory path from patient intake to verified results, printing, and reporting. Its architecture keeps those business decisions together while isolating infrastructure that changes or scales for different reasons.

Three applications, one domain

System map
Drag to pan
The access service owns the workflow; the web and browser applications stay focused on interaction and rendering.

The Bun monorepo shares four libraries: @diut/hcdc for domain entities and authorization, @diut/services for gRPC contracts, @diut/nestjs-infra for reusable adapters, and @diut/common for small shared types.

A request crosses explicit seams

Request path
Drag to pan
Transport details stop at the controller; business rules stay in use cases; NestJS tokens connect domain interfaces to adapters.

The access service is arranged as controller, app, domain, and infra. Shared CASL rules express permissions against users, branches, record state, and domain fields. The React client uses the same authorization vocabulary, while the server remains authoritative.

Printing earns a separate service

Document pipeline
Drag to pan
Clinical decisions remain in the access service; Chromium receives only prepared HTML and page settings.

The narrow gRPC interface keeps Chromium’s weight and failure modes outside the main application. Rendering can scale independently without moving laboratory rules into a second service.

The deployment mirrors the code

On-premise deployment
Drag to pan
GitOps, persistent storage, and observability make the four-node on-premise environment reproducible and diagnosable.

DIUT keeps most behavior in one access service and introduces a network seam only for a genuinely different workload. That balance preserves locality in the laboratory workflow while allowing delivery, storage, rendering, and observability to evolve independently.