## Infrastructure Services (AI, Epub, Storage, Billing)
This document summarizes concrete infrastructure services for AI/knowledge integration, EPUB processing, book storage, and Stripe billing. Diagrams show dependencies, flows, contracts, guardrails, and method interactions.

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1["ContentHasher"]
    flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1["SignalRSyncBroadcaster"]
    flow_file_nexusreader_infrastructure_services_billingservice_cs_file_1["BillingService"]
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1["BookStorageService"]
    flow_file_nexusreader_infrastructure_services_epubmetadataextractor_cs_file_1["EpubMetadataExtractor"]
    flow_file_nexusreader_infrastructure_services_epubreaderservice_cs_file_1["EpubReaderService"]
    flow_file_nexusreader_infrastructure_services_knowledgeservice_cs_file_1["KnowledgeService"]
    flow_file_nexusreader_infrastructure_services_promptregistry_cs_file_1["PromptRegistry"]
    flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1["AiSettings"]
    flow_file_nexusreader_infrastructure_configuration_stripesettings_cs_file_1["StripeSettings"]
    flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1["JsonRepairHelper"]
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1["SyncHub"]
    flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3[/"AiSettings"/]
    flow_type_nexusreader_infrastructure_configuration_stripesettings_cs_stripesettings_3[/"StripeSettings"/]
    flow_type_nexusreader_infrastructure_helpers_contenthasher_cs_contenthasher_7[/"ContentHasher"/]
    flow_type_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_jsonrepairhelper_6[/"JsonRepairHelper"/]
    flow_type_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_signalrsyncbroadcaster_11[/"SignalRSyncBroadcaster"/]
    flow_type_nexusreader_infrastructure_realtime_synchub_cs_synchub_10[/"SyncHub"/]
    flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10[/"BookStorageService"/]
    flow_type_nexusreader_infrastructure_services_epubmetadataextractor_cs_epubmetadataextractor_12[/"EpubMetadataExtractor"/]
    flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1 -->|dto AiSettings| flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3
    flow_file_nexusreader_infrastructure_configuration_stripesettings_cs_file_1 -->|model StripeSettings| flow_type_nexusreader_infrastructure_configuration_stripesettings_cs_stripesettings_3
    flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1 -->|model ContentHasher| flow_type_nexusreader_infrastructure_helpers_contenthasher_cs_contenthasher_7
    flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1 -->|model JsonRepairHelper| flow_type_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_jsonrepairhelper_6
    flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1 -->|model SignalRSyncBroadcaster| flow_type_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_signalrsyncbroadcaster_11
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 -->|model SyncHub| flow_type_nexusreader_infrastructure_realtime_synchub_cs_synchub_10
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|model BookStorageService| flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10
    flow_file_nexusreader_infrastructure_services_epubmetadataextractor_cs_file_1 -->|model EpubMetadataExtractor| flow_type_nexusreader_infrastructure_services_epubmetadataextractor_cs_epubmetadataextractor_12
    click flow_file_nexusreader_infrastructure_services_billingservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/BillingService.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_configuration_stripesettings_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Configuration/StripeSettings.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:10:1" "Open source"
    click flow_file_nexusreader_infrastructure_services_epubreaderservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/EpubReaderService.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_services_knowledgeservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/KnowledgeService.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Helpers/ContentHasher.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Configuration/AiSettings.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3 href "vscode://file/NexusReader.Infrastructure/Configuration/AiSettings.cs:3:1" "Open source"
    click flow_type_nexusreader_infrastructure_configuration_stripesettings_cs_stripesettings_3 href "vscode://file/NexusReader.Infrastructure/Configuration/StripeSettings.cs:3:1" "Open source"
    click flow_type_nexusreader_infrastructure_helpers_contenthasher_cs_contenthasher_7 href "vscode://file/NexusReader.Infrastructure/Helpers/ContentHasher.cs:7:1" "Open source"
    click flow_type_nexusreader_infrastructure_helpers_jsonrepairhelper_cs_jsonrepairhelper_6 href "vscode://file/NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs:6:1" "Open source"
    click flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1 href "vscode://file/NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_signalrsyncbroadcaster_11 href "vscode://file/NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs:11:1" "Open source"
    click flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_realtime_synchub_cs_synchub_10 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:10:1" "Open source"
    click flow_file_nexusreader_infrastructure_services_epubmetadataextractor_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/EpubMetadataExtractor.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_services_epubmetadataextractor_cs_epubmetadataextractor_12 href "vscode://file/NexusReader.Infrastructure/Services/EpubMetadataExtractor.cs:12:1" "Open source"
    click flow_file_nexusreader_infrastructure_services_promptregistry_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/PromptRegistry.cs:1:1" "Open source"
```

This dependency map shows service, helper, settings and realtime components and how DTOs/models link. It identifies AI and Stripe settings and key service classes for navigation and ownership.

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_2_nexusreader_infrastructure_services_bookstorageservice_cs["BookStorageService"]
    end
    subgraph flow_1_nexusreader_infrastructure_services_billingservice_cs["BillingService"]
    end
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1["BookStorageService"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66["EnsureDirectoryExists"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19["SaveEbookAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25["SaveEbookAsync"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68{"Evaluates branch condition"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68{"Check directory existence and create if absent"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_47_47["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45{"Guards early exit or rejection path"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53{"Ensure covers directory exists (create if missing)"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28{"Ensure uploads directory exists (create if missing)"}
    flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1["AiSettings"]
    flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3[/"AiSettings"/]
    flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10[/"BookStorageService"/]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 -->|true / false| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_47_47
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|EnsureDirectoryExists| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveCoverAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveCoverAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveEbookAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveEbookAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|model BookStorageService| flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 -->|exit / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28
    click flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:19:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:22:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:22:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:25:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:28:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:35:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:40:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:43:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:45:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:47:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:50:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:53:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:60:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:63:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:66:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:68:1" "Open source"
```

This flow highlights BookStorageService runtime paths: SaveEbookAsync and SaveCoverAsync ensure directories, perform async writes, and return web-relative paths. BillingService is shown as a sibling service but billing flow is implemented in BillingService.cs.

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph NexusReader_Infrastructure_Services_BookStorageService["BookStorageService"]
    end
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1["BookStorageService"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66["EnsureDirectoryExists"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19["SaveEbookAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25["SaveEbookAsync"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68{"Evaluates branch condition"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68{"Check directory existence and create if absent"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_47_47["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45{"Guards early exit or rejection path"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53{"Ensure covers directory exists (create if missing)"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28{"Ensure uploads directory exists (create if missing)"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 -->|true / false| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_47_47
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22 -->|Waits for async work| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|EnsureDirectoryExists| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveCoverAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveCoverAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveEbookAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 -->|SaveEbookAsync| flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 -->|exit / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28
    click flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:19:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:22:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_22_22 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:22:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:25:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:28:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:35:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:40:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:43:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:45:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:47:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:50:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:53:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:60:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:63:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:66:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:68:1" "Open source"
```

This control-flow emphasizes checks and failure paths for storage operations and the web-relative return conventions used by the service.

```mermaid
classDiagram
    class flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1["BookStorageService"]
    class flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1["AiSettings"]
    class flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3["AiSettings"]
    class flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10["BookStorageService"]
    flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1 --> flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3 : dto AiSettings
    flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 --> flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10 : model BookStorageService
    click flow_file_nexusreader_infrastructure_services_bookstorageservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_services_bookstorageservice_cs_bookstorageservice_10 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:10:1" "Open source"
    click flow_file_nexusreader_infrastructure_configuration_aisettings_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Configuration/AiSettings.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_configuration_aisettings_cs_aisettings_3 href "vscode://file/NexusReader.Infrastructure/Configuration/AiSettings.cs:3:1" "Open source"
```

This class/contract view shows the BookStorageService model and its dependency on AiSettings DTOs, clarifying configuration coupling.

```mermaid
flowchart TD
    subgraph NexusReader_Infrastructure_Services_BookStorageService["BookStorageService"]
    end
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66["EnsureDirectoryExists"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50["SaveCoverAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19["SaveEbookAsync"]
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25["SaveEbookAsync"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68{"Evaluates branch condition"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68{"Check directory existence and create if absent"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45{"Guards early exit or rejection path"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53{"Ensure covers directory exists (create if missing)"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35["Waits for async work"]
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28{"Ensure uploads directory exists (create if missing)"}
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22(["Returns result"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40(["Return web-relative path with forward slash"])
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 -->|true / false| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_branch_68_68
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 -->|Return web-relative path with forward slash| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 -->|exit / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 -->|Returns result| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22
    flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 -->|create-directory / continue| flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_19 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:19:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_22_22 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:22:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_25 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:25:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_guard_clause_28_28 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:28:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_await_35_35 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:35:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_saveebookasync_return_40_40 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:40:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_43 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:43:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_45_45 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:45:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_47_47 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:47:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_50 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:50:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_guard_clause_53_53 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:53:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_await_60_60 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:60:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_savecoverasync_return_63_63 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:63:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_66 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:66:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_bookstorageservice_cs_ensuredirectoryexists_guard_clause_68_68 href "vscode://file/NexusReader.Infrastructure/Services/BookStorageService.cs:68:1" "Open source"
```

This guardrails diagram isolates failure and branching behavior for storage operations and shows explicit early-exit guards.

```mermaid
flowchart TD
    subgraph NexusReader_Infrastructure_Services_EpubReaderService["EpubReaderService"]
    end
    subgraph NexusReader_Infrastructure_Helpers_ContentHasher["ContentHasher"]
    end
    subgraph NexusReader_Infrastructure_RealTime_SignalRSyncBroadcaster["SignalRSyncBroadcaster"]
    end
    subgraph NexusReader_Infrastructure_RealTime_SyncHub["SyncHub"]
    end
    flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1["ContentHasher"]
    flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1["SignalRSyncBroadcaster"]
    flow_file_nexusreader_infrastructure_services_epubreaderservice_cs_file_1["EpubReaderService"]
    flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9["ComputeHash"]
    flow_method_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_21["BroadcastProgressAsync"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28["OnConnectedAsync"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38["OnDisconnectedAsync"]
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19["UpdateProgress"]
    flow_method_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_175["CountWords"]
    flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11{"Evaluates branch condition"}
    flow_action_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_guard_clause_30_30{"check excludedConnectionId presence"}
    flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30["Reads repository or persistence state"]
    flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40["Reads repository or persistence state"]
    flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21["Reads repository or persistence state"]
    flow_action_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_guard_clause_177_177{"empty check"}
    flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_await_85_85["Waits for async work"]
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1["SyncHub"]
    flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_await_85_85 -->|ContentHasher.ComputeHash| flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9
    flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1 -->|ComputeHash| flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9
    flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1 -->|BroadcastProgressAsync| flow_method_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_21
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 -->|OnConnectedAsync| flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 -->|OnDisconnectedAsync| flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38
    flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 -->|UpdateProgress| flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19
    flow_file_nexusreader_infrastructure_services_epubreaderservice_cs_file_1 -->|CountWords| flow_method_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_175
    flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9 -->|true / false| flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11
    flow_method_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_21 -->|enter branch: attempts exclusion comment / else: normal send| flow_action_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_guard_clause_30_30
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28 -->|Reads repository or persistence state| flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38 -->|Reads repository or persistence state| flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40
    flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19 -->|Reads repository or persistence state| flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21
    flow_method_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_175 -->|empty check| flow_action_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_guard_clause_177_177
    click flow_file_nexusreader_infrastructure_services_epubreaderservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Services/EpubReaderService.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_175 href "vscode://file/NexusReader.Infrastructure/Services/EpubReaderService.cs:175:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_epubreaderservice_cs_countwords_guard_clause_177_177 href "vscode://file/NexusReader.Infrastructure/Services/EpubReaderService.cs:177:1" "Open source"
    click flow_action_nexusreader_infrastructure_services_knowledgeservice_cs_getknowledgeinternalasync_await_85_85 href "vscode://file/NexusReader.Infrastructure/Services/KnowledgeService.cs:85:1" "Open source"
    click flow_file_nexusreader_infrastructure_helpers_contenthasher_cs_file_1 href "vscode://file/NexusReader.Infrastructure/Helpers/ContentHasher.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_9 href "vscode://file/NexusReader.Infrastructure/Helpers/ContentHasher.cs:9:1" "Open source"
    click flow_action_nexusreader_infrastructure_helpers_contenthasher_cs_computehash_branch_11_11 href "vscode://file/NexusReader.Infrastructure/Helpers/ContentHasher.cs:11:1" "Open source"
    click flow_file_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_file_1 href "vscode://file/NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_21 href "vscode://file/NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs:21:1" "Open source"
    click flow_action_nexusreader_infrastructure_realtime_signalrsyncbroadcaster_cs_broadcastprogressasync_guard_clause_30_30 href "vscode://file/NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs:30:1" "Open source"
    click flow_file_nexusreader_infrastructure_realtime_synchub_cs_file_1 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:1:1" "Open source"
    click flow_method_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_19 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:19:1" "Open source"
    click flow_action_nexusreader_infrastructure_realtime_synchub_cs_updateprogress_repository_read_21_21 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:21:1" "Open source"
    click flow_method_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_28 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:28:1" "Open source"
    click flow_action_nexusreader_infrastructure_realtime_synchub_cs_onconnectedasync_repository_read_30_30 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:30:1" "Open source"
    click flow_method_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_38 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:38:1" "Open source"
    click flow_action_nexusreader_infrastructure_realtime_synchub_cs_ondisconnectedasync_repository_read_40_40 href "vscode://file/NexusReader.Infrastructure/RealTime/SyncHub.cs:40:1" "Open s

### Key Files
- NexusReader.Infrastructure/Services/KnowledgeService.cs
- NexusReader.Infrastructure/Services/EpubReaderService.cs
- NexusReader.Infrastructure/Services/EpubMetadataExtractor.cs
- NexusReader.Infrastructure/Services/BookStorageService.cs
- NexusReader.Infrastructure/Services/BillingService.cs
- NexusReader.Infrastructure/Services/PromptRegistry.cs
- NexusReader.Infrastructure/Configuration/AiSettings.cs
- NexusReader.Infrastructure/Configuration/StripeSettings.cs
- NexusReader.Infrastructure/Helpers/ContentHasher.cs
- NexusReader.Infrastructure/Helpers/JsonRepairHelper.cs
- NexusReader.Infrastructure/RealTime/SignalRSyncBroadcaster.cs
- NexusReader.Infrastructure/RealTime/SyncHub.cs

---

## See Also

- [Project Overview and High-level Architecture](../collections/overview.md)
- [Application Layer: Commands, Queries, DTOs and Handlers](../domains/application-cqs-and-handlers.md)
- [AI Features, Knowledge Graph and UX Integration](../integrations/ai-and-knowledge-ux.md)
- [Web Client (WASM) and Shared UI Components](../domains/web-client-and-shared-ui.md)
- [Mobile (MAUI) Application Integration](../runtime/mobile-maui.md)
- [Authentication, Authorization and Account Flows](../flows/authentication-and-account.md)
- [Business Overview](../business/business-overview.md)
- [Top Business Flows](../business/top-business-flows.md)
