# yogenyslav/ldt-2026 architecture

> Architecture diagram of the GitHub repository yogenyslav/ldt-2026, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yogenyslav/ldt-2026
- Repository: https://github.com/yogenyslav/ldt-2026

## Overview

This repository implements a DXA-image quality-assessment product: users upload or receive studies, asynchronous services analyze them, and results return to review, annotation, and reporting workflows. The graph follows the documented UI → manager → worker → NATS → analyzer path and includes the analyzer’s region-specific quality stages. README statements support several cross-service links; source excerpts show selected internal wiring, while unsampled subsystems are represented only at the level supported by the tree and documentation.

Main entry points: [`dicom-manager/cmd/service/main.go`](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/cmd/service/main.go) (HTTP API), [`ui/src/App.tsx`](https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/App.tsx) (Web application), [`dicom-analyzer/service.py`](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/service.py) (Analyzer service), [`dicom-analyzer/qc/pipeline.py`](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/pipeline.py) (Quality pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User workflows"]
  node_web["Web application<br/>[App.tsx]"]
  node_review["Review workspace<br/>[Study.tsx]"]
  node_annotations["Annotation and training<br/>[Annot.tsx]"]
  node_reports_ui["Reports workspace<br/>[Reports.tsx]"]
end

subgraph group_management["Study management"]
  node_manager["HTTP API<br/>[main.go]"]
  node_dicom["DICOM intake and retrieval<br/>[handler.go]"]
  node_jobs["Job status and decisions<br/>[handler.go]"]
  node_annotation_api["Annotation and training API<br/>[handler.go]"]
  node_reporting["Report generation<br/>[usecase.go]"]
  node_manager_events["Manager event listener<br/>[main.go]"]
end

subgraph group_processing["Analysis processing"]
  node_worker_rpc["Job RPC service<br/>[handler.go]"]
  node_worker_outbox["Transactional outbox<br/>[main.go]"]
  node_worker_results["Result listener<br/>[main.go]"]
  node_expiration["Job expiration<br/>[main.go]"]
end

subgraph group_analysis["Quality analysis"]
  node_analyzer_service["Analyzer service<br/>[service.py]"]
  node_qc_entry["Quality pipeline<br/>[pipeline.py]"]
  node_region["Region voting<br/>[region_vote.py]"]
  node_model_hub["Model registry<br/>[hub.py]"]
  node_spine["Spine criteria<br/>[spine_branch.py]"]
  node_hip["Hip criteria<br/>[hip_branch.py]"]
  node_crest_math["Pelvis geometry<br/>[crest_math.py]"]
  node_implant["Implant assessment"]
  node_render["Result rendering<br/>[render.py]"]
end

subgraph group_platform["Storage and integrations"]
  node_orthanc["Orthanc DICOM server"]
  node_nats["NATS messaging"]
  node_postgres[("PostgreSQL")]
  node_s3[("S3-compatible storage")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_web
node_web -->|"calls HTTP"| node_manager
node_web -->|"opens"| node_review
node_web -->|"opens"| node_annotations
node_web -->|"opens"| node_reports_ui
node_review -->|"requests results"| node_manager
node_annotations -->|"submits annotations"| node_manager
node_reports_ui -->|"requests reports"| node_manager
node_manager -->|"routes intake"| node_dicom
node_dicom -->|"stores and retrieves images"| node_orthanc
node_dicom -->|"starts jobs"| node_worker_rpc
node_worker_rpc -->|"creates events"| node_worker_outbox
node_worker_outbox -->|"publishes jobs"| node_nats
node_nats -->|"delivers jobs"| node_analyzer_service
node_analyzer_service -->|"loads images"| node_orthanc
node_analyzer_service -->|"runs analysis"| node_qc_entry
node_qc_entry -->|"uses models"| node_model_hub
node_qc_entry -->|"votes region"| node_region
node_qc_entry -->|"analyzes spine"| node_spine
node_qc_entry -->|"analyzes hip"| node_hip
node_spine -->|"uses geometry"| node_crest_math
node_hip -->|"assesses implant"| node_implant
node_analyzer_service -->|"returns results"| node_nats
node_nats -->|"delivers results"| node_worker_results
node_worker_results -->|"saves results"| node_postgres
node_worker_results -->|"publishes status"| node_nats
node_nats -->|"delivers status"| node_manager_events
node_manager_events -->|"updates jobs"| node_postgres
node_jobs -->|"reads and writes jobs"| node_postgres
node_annotation_api -->|"stores submissions"| node_postgres
node_reporting -->|"stores report files"| node_s3
node_manager -->|"routes report requests"| node_reporting
node_analyzer_service -->|"renders overlays"| node_render
node_worker_outbox -->|"persists events"| node_postgres
node_expiration -->|"checks timeouts"| node_postgres

click node_web "https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/App.tsx"
click node_review "https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Study.tsx"
click node_annotations "https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Annot.tsx"
click node_reports_ui "https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Reports.tsx"
click node_manager "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/cmd/service/main.go"
click node_dicom "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/dicom/upload/handler.go"
click node_jobs "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/job/result_decision/handler.go"
click node_annotation_api "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/annotation/submit/handler.go"
click node_reporting "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/usecases/report/generate/usecase.go"
click node_manager_events "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/cmd/job_listener/main.go"
click node_worker_rpc "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/internal/rpc/worker/handler.go"
click node_worker_outbox "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/outbox/main.go"
click node_worker_results "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/result_listener/main.go"
click node_expiration "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/expiration_checker/main.go"
click node_analyzer_service "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/service.py"
click node_qc_entry "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/pipeline.py"
click node_region "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/region_vote.py"
click node_model_hub "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/hub.py"
click node_spine "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/spine_branch.py"
click node_hip "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/hip_branch.py"
click node_crest_math "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/crest_math.py"
click node_implant "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/implant_trochanter.py"
click node_render "https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/render.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web,node_review,node_annotations,node_reports_ui,node_staff toneBlue
class node_manager,node_dicom,node_jobs,node_annotation_api,node_reporting,node_manager_events toneAmber
class node_worker_rpc,node_worker_outbox,node_worker_results,node_expiration toneMint
class node_analyzer_service,node_qc_entry,node_region,node_model_hub,node_spine,node_hip,node_crest_math,node_implant,node_render toneRose
class node_orthanc,node_nats,node_postgres,node_s3 toneIndigo
```

## Components

### User workflows

- [Web application](https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/App.tsx): `ui/src/App.tsx`
- [Review workspace](https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Study.tsx): `ui/src/_root/pages/Study.tsx`
- [Annotation and training](https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Annot.tsx): `ui/src/_root/pages/Annot.tsx`
- [Reports workspace](https://github.com/yogenyslav/ldt-2026/blob/master/ui/src/_root/pages/Reports.tsx): `ui/src/_root/pages/Reports.tsx`

### Study management

- [HTTP API](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/cmd/service/main.go): `dicom-manager/cmd/service/main.go`
- [DICOM intake and retrieval](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/dicom/upload/handler.go): `dicom-manager/internal/api/dicom/upload/handler.go`
- [Job status and decisions](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/job/result_decision/handler.go): `dicom-manager/internal/api/job/result_decision/handler.go`
- [Annotation and training API](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/api/annotation/submit/handler.go): `dicom-manager/internal/api/annotation/submit/handler.go`
- [Report generation](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/internal/usecases/report/generate/usecase.go): `dicom-manager/internal/usecases/report/generate/usecase.go`
- [Manager event listener](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-manager/cmd/job_listener/main.go): `dicom-manager/cmd/job_listener/main.go`

### Analysis processing

- [Job RPC service](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/internal/rpc/worker/handler.go): `dicom-worker/internal/rpc/worker/handler.go`
- [Transactional outbox](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/outbox/main.go): `dicom-worker/cmd/outbox/main.go`
- [Result listener](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/result_listener/main.go): `dicom-worker/cmd/result_listener/main.go`
- [Job expiration](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-worker/cmd/expiration_checker/main.go): `dicom-worker/cmd/expiration_checker/main.go`

### Quality analysis

- [Analyzer service](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/service.py): `dicom-analyzer/service.py`
- [Quality pipeline](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/pipeline.py): `dicom-analyzer/qc/pipeline.py`
- [Region voting](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/region_vote.py): `dicom-analyzer/qc/region_vote.py`
- [Model registry](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/hub.py): `dicom-analyzer/qc/hub.py`
- [Spine criteria](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/spine_branch.py): `dicom-analyzer/qc/spine_branch.py`
- [Hip criteria](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/hip_branch.py): `dicom-analyzer/qc/hip_branch.py`
- [Pelvis geometry](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/crest_math.py): `dicom-analyzer/qc/crest_math.py`
- [Implant assessment](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/qc/implant_trochanter.py): `dicom-analyzer/qc/implant_trochanter.py`
- [Result rendering](https://github.com/yogenyslav/ldt-2026/blob/master/dicom-analyzer/render.py): `dicom-analyzer/render.py`

### Storage and integrations

- **Orthanc DICOM server**
- **NATS messaging**
- **PostgreSQL**
- **S3-compatible storage**

### Other components

- **Staff user**

## Connections

- Staff user → Web application: uses (evidence: `README.md`)
- Web application → HTTP API: calls HTTP (evidence: `README.md`)
- Web application → Review workspace: opens (evidence: `ui/src/App.tsx`)
- Web application → Annotation and training: opens (evidence: `ui/src/App.tsx`)
- Web application → Reports workspace: opens (evidence: `ui/src/App.tsx`)
- Review workspace → HTTP API: requests results (evidence: `README.md`)
- Annotation and training → HTTP API: submits annotations (evidence: `README.md`)
- Reports workspace → HTTP API: requests reports (evidence: `README.md`)
- HTTP API → DICOM intake and retrieval: routes intake (evidence: `dicom-manager/cmd/service/main.go`)
- DICOM intake and retrieval → Orthanc DICOM server: stores and retrieves images (evidence: `README.md`)
- DICOM intake and retrieval → Job RPC service: starts jobs (evidence: `README.md`)
- Job RPC service → Transactional outbox: creates events
- Transactional outbox → NATS messaging: publishes jobs (evidence: `README.md`)
- NATS messaging → Analyzer service: delivers jobs (evidence: `README.md`)
- Analyzer service → Orthanc DICOM server: loads images (evidence: `README.md`)
- Analyzer service → Quality pipeline: runs analysis
- Quality pipeline → Model registry: uses models (evidence: `dicom-analyzer/qc/pipeline.py`)
- Quality pipeline → Region voting: votes region (evidence: `dicom-analyzer/qc/pipeline.py`)
- Quality pipeline → Spine criteria: analyzes spine (evidence: `dicom-analyzer/qc/pipeline.py`)
- Quality pipeline → Hip criteria: analyzes hip (evidence: `dicom-analyzer/qc/pipeline.py`)
- Spine criteria → Pelvis geometry: uses geometry (evidence: `dicom-analyzer/qc/spine_branch.py`)
- Hip criteria → Implant assessment: assesses implant (evidence: `dicom-analyzer/qc/hip_branch.py`)
- Analyzer service → NATS messaging: returns results (evidence: `README.md`)
- NATS messaging → Result listener: delivers results (evidence: `dicom-worker/cmd/result_listener/main.go`)
- Result listener → PostgreSQL: saves results
- Result listener → NATS messaging: publishes status (evidence: `dicom-worker/cmd/result_listener/main.go`)
- NATS messaging → Manager event listener: delivers status (evidence: `dicom-manager/cmd/job_listener/main.go`)
- Manager event listener → PostgreSQL: updates jobs (evidence: `dicom-manager/cmd/job_listener/main.go`)
- Job status and decisions → PostgreSQL: reads and writes jobs
- Annotation and training API → PostgreSQL: stores submissions
- Report generation → S3-compatible storage: stores report files (evidence: `README.md`)
- HTTP API → Report generation: routes report requests (evidence: `dicom-manager/cmd/service/main.go`)
- Analyzer service → Result rendering: renders overlays
- Transactional outbox → PostgreSQL: persists events
- Job expiration → PostgreSQL: checks timeouts (evidence: `dicom-worker/cmd/expiration_checker/main.go`)
