# krishagni/openspecimen architecture

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

- Interactive diagram: https://gitdiagram.com/krishagni/openspecimen
- Repository: https://github.com/krishagni/openspecimen

## Overview

OpenSpecimen is a configurable biobanking and biospecimen-management platform. Its principal workflow manages specimens through collection, consent, quality control, requests, distribution, and shipping, with inventory and lifecycle tracking alongside that path. Users also authenticate, configure forms, and query or report on data. The sampled material confirms the storage-container REST-to-service boundary and storage domain, but does not expose most other runtime wiring; those capability branches and lifecycle links are therefore documented at a high level from the README.

Main entry points: [`WEB-INF/src/com/krishagni/catissueplus/core/biospecimen`](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen) (Collection), [`WEB-INF/src/com/krishagni/catissueplus/core/administrative`](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative) (Specimen requests), [`WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java`](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java) (Storage REST API), [`WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java`](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java) (Storage service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_biospecimens["Biospecimen lifecycle"]
  node_collection["Collection"]
  node_consent["Consent"]
  node_qc["QC and annotations"]
  node_requests["Specimen requests"]
  node_distribution["Distribution"]
end

subgraph group_inventory["Storage and logistics"]
  node_shipping["Shipping and tracking"]
  node_storage_api["Storage REST API"]
  node_storage_service["Storage service"]
  node_storage_domain[("Container inventory")]
end

subgraph group_platform["Access and configuration"]
  node_authentication["Authentication"]
  node_authorization["Role authorization"]
  node_custom_forms["Custom forms"]
  node_integrations{{"Clinical and instrument systems"}}
end

subgraph group_insight["Queries and reporting"]
  node_query["Data query<br/>[QueryService.java]"]
  node_reports["Exports and reports"]
end

node_user(("Biobank user"))

node_user -->|"authenticates"| node_authentication
node_user -->|"manages"| node_collection
node_collection -->|"records consent"| node_consent
node_consent -->|"supports QC"| node_qc
node_qc -->|"enables requests"| node_requests
node_requests -->|"requests distribution"| node_distribution
node_distribution -->|"ships specimens"| node_shipping
node_user -->|"manages inventory"| node_storage_api
node_storage_api -->|"calls"| node_storage_service
node_storage_service -->|"uses container model"| node_storage_domain
node_user -->|"queries data"| node_query
node_query -.->|"exports results"| node_reports
node_user -->|"configures fields"| node_custom_forms
node_integrations -.->|"provides data"| node_collection
node_user -->|"uses roles"| node_authorization

click node_collection "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen"
click node_consent "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen"
click node_qc "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen"
click node_requests "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative"
click node_distribution "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative"
click node_shipping "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative"
click node_storage_api "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java"
click node_storage_service "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java"
click node_storage_domain "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative/domain/StorageContainer.java"
click node_authentication "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/auth/services/UserAuthenticationService.java"
click node_authorization "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core"
click node_custom_forms "https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core"
click node_query "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/de/services/QueryService.java"
click node_reports "https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/de/services/impl/QueryServiceImpl.java"

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_collection,node_consent,node_qc,node_requests,node_distribution,node_user toneBlue
class node_shipping,node_storage_api,node_storage_service,node_storage_domain toneAmber
class node_authentication,node_authorization,node_custom_forms,node_integrations toneMint
class node_query,node_reports toneRose
```

## Components

### Biospecimen lifecycle

- [Collection](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen): `WEB-INF/src/com/krishagni/catissueplus/core/biospecimen`
- [Consent](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen): `WEB-INF/src/com/krishagni/catissueplus/core/biospecimen`
- [QC and annotations](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/biospecimen): `WEB-INF/src/com/krishagni/catissueplus/core/biospecimen`
- [Specimen requests](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative): `WEB-INF/src/com/krishagni/catissueplus/core/administrative`
- [Distribution](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative): `WEB-INF/src/com/krishagni/catissueplus/core/administrative`

### Storage and logistics

- [Shipping and tracking](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative): `WEB-INF/src/com/krishagni/catissueplus/core/administrative`
- [Storage REST API](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java): `WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java`
- [Storage service](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java): `WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java`
- [Container inventory](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/administrative/domain/StorageContainer.java): `WEB-INF/src/com/krishagni/catissueplus/core/administrative/domain/StorageContainer.java`

### Access and configuration

- [Authentication](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/auth/services/UserAuthenticationService.java): `WEB-INF/src/com/krishagni/catissueplus/core/auth/services/UserAuthenticationService.java`
- [Role authorization](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core): `WEB-INF/src/com/krishagni/catissueplus/core`
- [Custom forms](https://github.com/krishagni/openspecimen/tree/master/WEB-INF/src/com/krishagni/catissueplus/core): `WEB-INF/src/com/krishagni/catissueplus/core`
- **Clinical and instrument systems**

### Queries and reporting

- [Data query](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/de/services/QueryService.java): `WEB-INF/src/com/krishagni/catissueplus/core/de/services/QueryService.java`
- [Exports and reports](https://github.com/krishagni/openspecimen/blob/master/WEB-INF/src/com/krishagni/catissueplus/core/de/services/impl/QueryServiceImpl.java): `WEB-INF/src/com/krishagni/catissueplus/core/de/services/impl/QueryServiceImpl.java`

### Other components

- **Biobank user**

## Connections

- Biobank user → Authentication: authenticates
- Biobank user → Collection: manages
- Collection → Consent: records consent
- Consent → QC and annotations: supports QC
- QC and annotations → Specimen requests: enables requests (evidence: `WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java`)
- Specimen requests → Distribution: requests distribution
- Distribution → Shipping and tracking: ships specimens
- Biobank user → Storage REST API: manages inventory
- Storage REST API → Storage service: calls (evidence: `WEB-INF/src/com/krishagni/catissueplus/rest/controller/StorageContainersController.java`)
- Storage service → Container inventory: uses container model (evidence: `WEB-INF/src/com/krishagni/catissueplus/core/administrative/services/StorageContainerService.java`)
- Biobank user → Data query: queries data
- Data query → Exports and reports: exports results
- Biobank user → Custom forms: configures fields
- Clinical and instrument systems → Collection: provides data
- Biobank user → Role authorization: uses roles
