# phac-nml/irida-next architecture

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

- Interactive diagram: https://gitdiagram.com/phac-nml/irida-next
- Repository: https://github.com/phac-nml/irida-next

## Overview

IRIDA Next is a Rails bioinformatics platform for managing genomic samples, metadata, attachments, and workflow analysis. Users enter through the web UI or GraphQL API; controllers and GraphQL operations handle domain actions, with services and jobs supporting transfers, exports, and workflow execution. Workflow definitions are registered from configuration and mirrored pipeline repositories, then exposed through GraphQL and execution interfaces. The README also identifies storage, analysis, and metadata management as core capabilities. Edges cite only relationships visible in the supplied excerpts or README; many unsampled controller and persistence links are therefore omitted.

Main entry points: [`db/migrate/20230727133120_create_active_storage_tables.active_storage.rb`](https://github.com/phac-nml/irida-next/blob/main/db/migrate/20230727133120_create_active_storage_tables.active_storage.rb) (Application database), [`lib/irida/pipelines.rb`](https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipelines.rb) (Pipeline registry), [`config/routes.rb`](https://github.com/phac-nml/irida-next/blob/main/config/routes.rb) (Rails web routes), [`app/controllers/projects/samples_controller.rb`](https://github.com/phac-nml/irida-next/blob/main/app/controllers/projects/samples_controller.rb) (Sample operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_web["Rails web routes<br/>[routes.rb]"]
  node_graphql["GraphQL API<br/>[irida_schema.rb]"]
  node_browser["Browser UI components"]
end

subgraph group_domain["Sample management"]
  node_samples["Sample operations"]
  node_sample_service["Sample services"]
  node_attachments["Attachment handling<br/>[create_service.rb]"]
  node_metadata["Metadata management<br/>[metadata.rb]"]
  node_exports["Data exports<br/>[create_service.rb]"]
  node_search["Advanced search"]
  node_activity["Activity history"]
end

subgraph group_analysis["Workflow analysis"]
  node_pipeline_registry["Pipeline registry<br/>[pipelines.rb]"]
  node_pipeline_model["Pipeline definition<br/>[pipeline.rb]"]
  node_pipeline_repo["Pipeline repository mirror"]
  node_pipeline_config["Pipeline initialization<br/>[pipelines.rb]"]
  node_pipeline_query["Pipeline query resolver"]
  node_workflow_create["Workflow creation<br/>[create_service.rb]"]
  node_workflow_jobs["Workflow execution jobs"]
end

subgraph group_platform["Platform services"]
  node_database[("Application database")]
  node_auth["Authentication"]
end

node_user(("Platform user"))
node_wes["GA4GH WES service"]

node_user -->|"uses"| node_web
node_user -->|"queries"| node_graphql
node_web -->|"routes requests"| node_samples
node_web -->|"routes workflow requests"| node_workflow_create
node_browser -.->|"submits actions"| node_web
node_graphql -->|"resolves pipelines"| node_pipeline_query
node_pipeline_query -->|"finds pipeline"| node_pipeline_registry
node_pipeline_registry -->|"builds definitions"| node_pipeline_model
node_pipeline_registry -->|"mirrors repository"| node_pipeline_repo
node_pipeline_config -->|"initializes registry"| node_pipeline_registry
node_workflow_create -.->|"looks up workflow"| node_pipeline_registry
node_workflow_create -.->|"submits execution"| node_workflow_jobs
node_workflow_jobs -.->|"executes workflow"| node_wes
node_samples -.->|"delegates sample work"| node_sample_service
node_samples -.->|"persists samples"| node_database
node_attachments -.->|"stores attachment records"| node_database
node_metadata -.->|"stores metadata"| node_database
node_exports -.->|"reads export data"| node_database
node_search -.->|"queries records"| node_database
node_activity -.->|"reads activity records"| node_database
node_auth -.->|"checks user account"| node_database

click node_web "https://github.com/phac-nml/irida-next/blob/main/config/routes.rb"
click node_graphql "https://github.com/phac-nml/irida-next/blob/main/app/graphql/irida_schema.rb"
click node_samples "https://github.com/phac-nml/irida-next/blob/main/app/controllers/projects/samples_controller.rb"
click node_sample_service "https://github.com/phac-nml/irida-next/blob/main/app/services/base_sample_service.rb"
click node_attachments "https://github.com/phac-nml/irida-next/blob/main/app/services/attachments/create_service.rb"
click node_metadata "https://github.com/phac-nml/irida-next/blob/main/app/controllers/concerns/metadata.rb"
click node_exports "https://github.com/phac-nml/irida-next/blob/main/app/services/data_exports/create_service.rb"
click node_database "https://github.com/phac-nml/irida-next/blob/main/db/migrate/20230727133120_create_active_storage_tables.active_storage.rb"
click node_pipeline_registry "https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipelines.rb"
click node_pipeline_model "https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipeline.rb"
click node_pipeline_repo "https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipeline_repository.rb"
click node_pipeline_config "https://github.com/phac-nml/irida-next/blob/main/config/initializers/pipelines.rb"
click node_pipeline_query "https://github.com/phac-nml/irida-next/blob/main/app/graphql/resolvers/pipeline_resolver.rb"
click node_workflow_create "https://github.com/phac-nml/irida-next/blob/main/app/services/workflow_executions/create_service.rb"
click node_workflow_jobs "https://github.com/phac-nml/irida-next/blob/main/app/jobs/workflow_executions/workflow_execution_job.rb"
click node_browser "https://github.com/phac-nml/irida-next/tree/main/app/components"
click node_search "https://github.com/phac-nml/irida-next/blob/main/app/models/advanced_search_query_form.rb"
click node_activity "https://github.com/phac-nml/irida-next/blob/main/app/controllers/activities_controller.rb"
click node_auth "https://github.com/phac-nml/irida-next/blob/main/app/controllers/sessions_controller.rb"

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_graphql,node_browser,node_user toneBlue
class node_samples,node_sample_service,node_attachments,node_metadata,node_exports,node_search,node_activity toneAmber
class node_pipeline_registry,node_pipeline_model,node_pipeline_repo,node_pipeline_config,node_pipeline_query,node_workflow_create,node_workflow_jobs toneMint
class node_database,node_auth toneRose
class node_wes toneIndigo
```

## Components

### User interfaces

- [Rails web routes](https://github.com/phac-nml/irida-next/blob/main/config/routes.rb): `config/routes.rb`
- [GraphQL API](https://github.com/phac-nml/irida-next/blob/main/app/graphql/irida_schema.rb): `app/graphql/irida_schema.rb`
- [Browser UI components](https://github.com/phac-nml/irida-next/tree/main/app/components): `app/components`

### Sample management

- [Sample operations](https://github.com/phac-nml/irida-next/blob/main/app/controllers/projects/samples_controller.rb): `app/controllers/projects/samples_controller.rb`
- [Sample services](https://github.com/phac-nml/irida-next/blob/main/app/services/base_sample_service.rb): `app/services/base_sample_service.rb`
- [Attachment handling](https://github.com/phac-nml/irida-next/blob/main/app/services/attachments/create_service.rb): `app/services/attachments/create_service.rb`
- [Metadata management](https://github.com/phac-nml/irida-next/blob/main/app/controllers/concerns/metadata.rb): `app/controllers/concerns/metadata.rb`
- [Data exports](https://github.com/phac-nml/irida-next/blob/main/app/services/data_exports/create_service.rb): `app/services/data_exports/create_service.rb`
- [Advanced search](https://github.com/phac-nml/irida-next/blob/main/app/models/advanced_search_query_form.rb): `app/models/advanced_search_query_form.rb`
- [Activity history](https://github.com/phac-nml/irida-next/blob/main/app/controllers/activities_controller.rb): `app/controllers/activities_controller.rb`

### Workflow analysis

- [Pipeline registry](https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipelines.rb): `lib/irida/pipelines.rb`
- [Pipeline definition](https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipeline.rb): `lib/irida/pipeline.rb`
- [Pipeline repository mirror](https://github.com/phac-nml/irida-next/blob/main/lib/irida/pipeline_repository.rb): `lib/irida/pipeline_repository.rb`
- [Pipeline initialization](https://github.com/phac-nml/irida-next/blob/main/config/initializers/pipelines.rb): `config/initializers/pipelines.rb`
- [Pipeline query resolver](https://github.com/phac-nml/irida-next/blob/main/app/graphql/resolvers/pipeline_resolver.rb): `app/graphql/resolvers/pipeline_resolver.rb`
- [Workflow creation](https://github.com/phac-nml/irida-next/blob/main/app/services/workflow_executions/create_service.rb): `app/services/workflow_executions/create_service.rb`
- [Workflow execution jobs](https://github.com/phac-nml/irida-next/blob/main/app/jobs/workflow_executions/workflow_execution_job.rb): `app/jobs/workflow_executions/workflow_execution_job.rb`

### Platform services

- [Application database](https://github.com/phac-nml/irida-next/blob/main/db/migrate/20230727133120_create_active_storage_tables.active_storage.rb): `db/migrate/20230727133120_create_active_storage_tables.active_storage.rb`
- [Authentication](https://github.com/phac-nml/irida-next/blob/main/app/controllers/sessions_controller.rb): `app/controllers/sessions_controller.rb`

### Other components

- **Platform user**
- **GA4GH WES service**

## Connections

- Platform user → Rails web routes: uses
- Platform user → GraphQL API: queries
- Rails web routes → Sample operations: routes requests (evidence: `config/routes.rb`)
- Rails web routes → Workflow creation: routes workflow requests (evidence: `config/routes.rb`)
- Browser UI components → Rails web routes: submits actions
- GraphQL API → Pipeline query resolver: resolves pipelines (evidence: `app/graphql/resolvers/pipeline_resolver.rb`)
- Pipeline query resolver → Pipeline registry: finds pipeline (evidence: `app/graphql/resolvers/pipeline_resolver.rb`)
- Pipeline registry → Pipeline definition: builds definitions (evidence: `lib/irida/pipelines.rb`)
- Pipeline registry → Pipeline repository mirror: mirrors repository (evidence: `lib/irida/pipelines.rb`)
- Pipeline initialization → Pipeline registry: initializes registry (evidence: `config/initializers/pipelines.rb`)
- Workflow creation → Pipeline registry: looks up workflow
- Workflow creation → Workflow execution jobs: submits execution
- Workflow execution jobs → GA4GH WES service: executes workflow
- Sample operations → Sample services: delegates sample work
- Sample operations → Application database: persists samples
- Attachment handling → Application database: stores attachment records
- Metadata management → Application database: stores metadata
- Data exports → Application database: reads export data
- Advanced search → Application database: queries records
- Activity history → Application database: reads activity records
- Authentication → Application database: checks user account
