# technologyenhancedlearning/learninghub.nhs.content architecture

> Architecture diagram of the GitHub repository technologyenhancedlearning/learninghub.nhs.content, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/technologyenhancedlearning/learninghub.nhs.content
- Repository: https://github.com/technologyenhancedlearning/learninghub.nhs.content

## Overview

Learning Hub Content Server supports two related workflows: ESR-style remote content launch by serving files from Azure storage, and historic URL launch by resolving migrated URLs and rewriting requests to Learning Hub content. The graph includes the API, caching, and request-metrics layers indicated by the sampled source. Several middleware and registration details are only partially excerpted; edges are limited to relationships shown in excerpts, the source index, or README.

Main entry points: [`LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs) (Web application setup), [`LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs`](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs) (Rewrite service), [`LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs`](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs) (Rewrite rule), [`LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs`](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs) (Content controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Content launch"]
  node_content_controller["Content controller"]
  node_file_service["File service<br/>[FileService.cs]"]
  node_file_interface["File service contract<br/>[IFileService.cs]"]
  node_metrics["Request metrics"]
end

subgraph group_rewrite["URL rewriting"]
  node_rewrite_rule["Rewrite rule"]
  node_rewrite_service["Rewrite service"]
  node_source_type["Source types<br/>[SourceType.cs]"]
  node_source_extensions["Source extensions"]
end

subgraph group_services["Service integrations"]
  node_azure_files[("Azure file storage")]
  node_http_client["Learning Hub HTTP client"]
  node_http_contract["HTTP client contract"]
  node_learninghub_api["Learning Hub API"]
  node_cache[("Distributed cache")]
end

subgraph group_runtime["Application runtime"]
  node_settings["Application settings<br/>[Settings.cs]"]
  node_startup["Web application setup<br/>[Startup.cs]"]
  node_program["Host entry point<br/>[Program.cs]"]
end

node_user(("Requesting client"))

node_user -->|"sends URL"| node_rewrite_rule
node_user -->|"requests file"| node_content_controller
node_rewrite_rule -->|"resolves content"| node_rewrite_service
node_rewrite_service -->|"gets client"| node_http_client
node_rewrite_service -->|"requests content data"| node_learninghub_api
node_http_client -->|"configures API client"| node_learninghub_api
node_rewrite_service -->|"reads and writes"| node_cache
node_content_controller -->|"downloads file"| node_file_service
node_file_service -->|"reads and archives"| node_azure_files
node_content_controller -->|"records metrics"| node_metrics
node_source_extensions -->|"uses types"| node_source_type
node_rewrite_rule -->|"uses types"| node_source_type
node_startup -->|"registers middleware"| node_rewrite_rule
node_startup -->|"registers service"| node_file_service
node_startup -->|"registers service"| node_rewrite_service
node_startup -->|"registers client"| node_http_client
node_program -->|"starts web host"| node_startup

click node_rewrite_rule "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs"
click node_rewrite_service "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs"
click node_source_type "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Models/SourceType.cs"
click node_source_extensions "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Extensions/SourceSystemExtensions.cs"
click node_content_controller "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs"
click node_file_service "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/FileService.cs"
click node_file_interface "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/IFileService.cs"
click node_http_client "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/LearningHubHttpClient.cs"
click node_http_contract "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/ILearningHubHttpClient.cs"
click node_metrics "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/EventSource/ScormContentEventSource.cs"
click node_settings "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Configuration/Settings.cs"
click node_startup "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs"
click node_program "https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Program.cs"

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_content_controller,node_file_service,node_file_interface,node_metrics,node_user toneBlue
class node_rewrite_rule,node_rewrite_service,node_source_type,node_source_extensions toneAmber
class node_azure_files,node_http_client,node_http_contract,node_learninghub_api,node_cache toneMint
class node_settings,node_startup,node_program toneRose
```

## Components

### Content launch

- [Content controller](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs`
- [File service](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/FileService.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/FileService.cs`
- [File service contract](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/IFileService.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/IFileService.cs`
- [Request metrics](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/EventSource/ScormContentEventSource.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/EventSource/ScormContentEventSource.cs`

### URL rewriting

- [Rewrite rule](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs`
- [Rewrite service](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs`
- [Source types](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Models/SourceType.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Models/SourceType.cs`
- [Source extensions](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Extensions/SourceSystemExtensions.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Extensions/SourceSystemExtensions.cs`

### Service integrations

- **Azure file storage**
- [Learning Hub HTTP client](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/LearningHubHttpClient.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/LearningHubHttpClient.cs`
- [HTTP client contract](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/ILearningHubHttpClient.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Interfaces/ILearningHubHttpClient.cs`
- **Learning Hub API**
- **Distributed cache**

### Application runtime

- [Application settings](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Configuration/Settings.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Configuration/Settings.cs`
- [Web application setup](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`
- [Host entry point](https://github.com/technologyenhancedlearning/learninghub.nhs.content/blob/main/LearningHub.Nhs.Content/LearningHub.Nhs.Content/Program.cs): `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Program.cs`

### Other components

- **Requesting client**

## Connections

- Requesting client → Rewrite rule: sends URL (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs`)
- Requesting client → Content controller: requests file (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs`)
- Rewrite rule → Rewrite service: resolves content (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs`)
- Rewrite service → Learning Hub HTTP client: gets client (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs`)
- Rewrite service → Learning Hub API: requests content data (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs`)
- Learning Hub HTTP client → Learning Hub API: configures API client (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/LearningHubHttpClient.cs`)
- Rewrite service → Distributed cache: reads and writes (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/ContentRewriteService.cs`)
- Content controller → File service: downloads file (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs`)
- File service → Azure file storage: reads and archives (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Service/FileService.cs`)
- Content controller → Request metrics: records metrics (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Controllers/LHContentController.cs`)
- Source extensions → Source types: uses types (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Extensions/SourceSystemExtensions.cs`)
- Rewrite rule → Source types: uses types (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/ResourceContentRewriteRule.cs`)
- Web application setup → Rewrite rule: registers middleware (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`)
- Web application setup → File service: registers service (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`)
- Web application setup → Rewrite service: registers service (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`)
- Web application setup → Learning Hub HTTP client: registers client (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Startup.cs`)
- Host entry point → Web application setup: starts web host (evidence: `LearningHub.Nhs.Content/LearningHub.Nhs.Content/Program.cs`)
