## Mobile (MAUI) Application Integration
This document briefly describes the MAUI app host, platform services, storage implementations, and how the MAUI client reuses shared Application/Infrastructure and UI.Shared code. Diagrams below show dependencies, startup/registration flows, key program control paths, and method interactions.

=== DIAGRAM 1: Dependency and Model Map (dependency-map) ===
```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    flow_file_nexusreader_infrastructure_mobile_services_mauiplatformservice_cs_file_1["MauiPlatformService"]
    flow_file_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_file_1["MauiStorageService"]
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_file_nexusreader_web_client_services_wasmepubservice_cs_file_1["WasmEpubReader"]
    flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1["AuthenticationHeaderHandler"]
    flow_type_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_mauistorageservice_8[/"MauiStorageService"/]
    flow_type_nexusreader_web_client_handlers_authenticationheaderhandler_cs_authenticationheaderhandler_14[/"AuthenticationHeaderHandler"/]
    flow_type_nexusreader_web_client_program_cs_identityservice_32[/"IdentityService"/]
    flow_type_nexusreader_web_client_program_cs_nexusreader_application_extension_55[/"NexusReader.Application (extension)"/]
    flow_type_nexusreader_web_client_program_cs_nexusreader_web_client_handlers_authenticationheaderhandler_40[/"NexusReader.Web.Client.Handlers.AuthenticationHeaderHandler"/]
    flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74[/"ThrowingBookStorageService"/]
    flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49[/"ThrowingDbContextFactory"/]
    flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61[/"ThrowingDbContextFactory"/]
    flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84[/"ThrowingEbookRepository"/]
    flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66[/"ThrowingEmbeddingGenerator"/]
    flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94[/"ThrowingSyncBroadcaster"/]
    flow_type_nexusreader_web_client_program_cs_webplatformservice_18[/"WebPlatformService"/]
    flow_type_nexusreader_web_client_program_cs_webstorageservice_19[/"WebStorageService"/]
    flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubmetadataextractor_43[/"WasmEpubMetadataExtractor"/]
    flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubreader_8[/"WasmEpubReader"/]
    flow_file_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_file_1 -->|model MauiStorageService| flow_type_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_mauistorageservice_8
    flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1 -->|model AuthenticationHeaderHandler| flow_type_nexusreader_web_client_handlers_authenticationheaderhandler_cs_authenticationheaderhandler_14
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IIdentityService| flow_type_nexusreader_web_client_program_cs_identityservice_32
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IServiceCollection application extension| flow_type_nexusreader_web_client_program_cs_nexusreader_application_extension_55
    flow_file_nexusreader_web_client_program_cs_file_1 -->|NexusReader.Web.Client.Handlers.AuthenticationHeaderHandler| flow_type_nexusreader_web_client_program_cs_nexusreader_web_client_handlers_authenticationheaderhandler_40
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingBookStorageService| flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IDbContextFactory AppDbContext>| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingDbContextFactory| flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEbookRepository| flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingEmbeddingGenerator| flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66
    flow_file_nexusreader_web_client_program_cs_file_1 -->|model ThrowingSyncBroadcaster| flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_client_program_cs_webplatformservice_18
    flow_file_nexusreader_web_client_program_cs_file_1 -->|INativeStorageService| flow_type_nexusreader_web_client_program_cs_webstorageservice_19
    flow_file_nexusreader_web_client_services_wasmepubservice_cs_file_1 -->|model WasmEpubMetadataExtractor| flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubmetadataextractor_43
    flow_file_nexusreader_web_client_services_wasmepubservice_cs_file_1 -->|model WasmEpubReader| flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubreader_8
    click flow_file_nexusreader_infrastructure_mobile_services_mauiplatformservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure.Mobile/Services/MauiPlatformService.cs:1:1" "Open source"
    click flow_file_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_file_1 href "vscode://file/NexusReader.Infrastructure.Mobile/Services/MauiStorageService.cs:1:1" "Open source"
    click flow_type_nexusreader_infrastructure_mobile_services_mauistorageservice_cs_mauistorageservice_8 href "vscode://file/NexusReader.Infrastructure.Mobile/Services/MauiStorageService.cs:8:1" "Open source"
    click flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1 href "vscode://file/NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_handlers_authenticationheaderhandler_cs_authenticationheaderhandler_14 href "vscode://file/NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs:14:1" "Open source"
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_61 href "vscode://file/NexusReader.Web.Client/Program.cs:61:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingembeddinggenerator_66 href "vscode://file/NexusReader.Web.Client/Program.cs:66:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74 href "vscode://file/NexusReader.Web.Client/Program.cs:74:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingebookrepository_84 href "vscode://file/NexusReader.Web.Client/Program.cs:84:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingsyncbroadcaster_94 href "vscode://file/NexusReader.Web.Client/Program.cs:94:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webstorageservice_19 href "vscode://file/NexusReader.Web.Client/Program.cs:19:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_identityservice_32 href "vscode://file/NexusReader.Web.Client/Program.cs:32:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusreader_web_client_handlers_authenticationheaderhandler_40 href "vscode://file/NexusReader.Web.Client/Program.cs:40:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_throwingdbcontextfactory_49 href "vscode://file/NexusReader.Web.Client/Program.cs:49:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_nexusreader_application_extension_55 href "vscode://file/NexusReader.Web.Client/Program.cs:55:1" "Open source"
    click flow_file_nexusreader_web_client_services_wasmepubservice_cs_file_1 href "vscode://file/NexusReader.Web.Client/Services/WasmEpubService.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubreader_8 href "vscode://file/NexusReader.Web.Client/Services/WasmEpubService.cs:8:1" "Open source"
    click flow_type_nexusreader_web_client_services_wasmepubservice_cs_wasmepubmetadataextractor_43 href "vscode://file/NexusReader.Web.Client/Services/WasmEpubService.cs:43:1" "Open source"
```
This map shows MAUI mobile services (MauiPlatformService, MauiStorageService) alongside Web client services and Program.cs registrations. It highlights which platform abstractions (IPlatformService, INativeStorageService) have mobile and web implementations and where DI models live.

=== DIAGRAM 2: Startup and Service Registration Flow (primary-runtime) ===
```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_0_nexusreader_web_program_cs["Program.cs"]
    end
    subgraph flow_1_nexusreader_web_client_program_cs["Program.cs"]
    end
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_file_nexusreader_web_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250["GetEpubContent (GET /api/epub/{ebookId}/{index})"]
    flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355["GetMyEbooks (GET /api/library/books)"]
    flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434["HandleSubscriptionCancellation"]
    flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410["HandleSubscriptionSuccess"]
    flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453["Identity Login (GET /identity/login/google)"]
    flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330["IngestEbook (POST /api/library/ingest)"]
    flow_method_nexusreader_web_program_cs_knowledge_api_group_mappings_261["Knowledge API group mappings"]
    flow_method_nexusreader_web_program_cs_map_identity_api_mapgroup_identity_451["Map Identity API (MapGroup /identity)"]
    flow_method_nexusreader_web_program_cs_program_top_level_29["Program (top-level)"]
    flow_method_nexusreader_web_program_cs_stripewebhook_post_api_stripewebhook_367["StripeWebhook (POST /api/StripeWebhook)"]
    flow_type_nexusreader_web_client_program_cs_identityservice_32[/"IdentityService"/]
    flow_type_nexusreader_web_client_program_cs_webplatformservice_18[/"WebPlatformService"/]
    flow_type_nexusreader_web_client_program_cs_webstorageservice_19[/"WebStorageService"/]
    flow_type_nexusreader_web_program_cs_addapplication_78[/"AddApplication()"/]
    flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79[/"AddInfrastructure(IConfiguration)"/]
    flow_type_nexusreader_web_program_cs_framework_34[/"framework"/]
    flow_type_nexusreader_web_program_cs_named_httpclient_58[/"named HttpClient"/]
    flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93[/"NexusReader.Infrastructure.Services.BillingService"/]
    flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81[/"RegisterServicesFromAssemblies"/]
    flow_type_nexusreader_web_program_cs_serveridentityservice_75[/"ServerIdentityService"/]
    flow_type_nexusreader_web_program_cs_tokenlimithandler_87[/"TokenLimitHandler"/]
    flow_type_nexusreader_web_program_cs_webplatformservice_47[/"WebPlatformService"/]
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IIdentityService| flow_type_nexusreader_web_client_program_cs_identityservice_32
    flow_file_nexusreader_web_client_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_client_program_cs_webplatformservice_18
    flow_file_nexusreader_web_client_program_cs_file_1 -->|INativeStorageService| flow_type_nexusreader_web_client_program_cs_webstorageservice_19
    flow_file_nexusreader_web_program_cs_file_1 -->|Application layer| flow_type_nexusreader_web_program_cs_addapplication_78
    flow_file_nexusreader_web_program_cs_file_1 -->|Infrastructure layer| flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79
    flow_file_nexusreader_web_program_cs_file_1 -->|Razor / Blazor services| flow_type_nexusreader_web_program_cs_framework_34
    flow_file_nexusreader_web_program_cs_file_1 -->|uses| flow_type_nexusreader_web_program_cs_named_httpclient_58
    flow_file_nexusreader_web_program_cs_file_1 -->|IBillingService| flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93
    flow_file_nexusreader_web_program_cs_file_1 -->|MediatR handlers| flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81
    flow_file_nexusreader_web_program_cs_file_1 -->|IIdentityService| flow_type_nexusreader_web_program_cs_serveridentityservice_75
    flow_file_nexusreader_web_program_cs_file_1 -->|IAuthorizationHandler| flow_type_nexusreader_web_program_cs_tokenlimithandler_87
    flow_file_nexusreader_web_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_program_cs_webplatformservice_47
    click flow_file_nexusreader_web_client_program_cs_file_1 href "vscode://file/NexusReader.Web.Client/Program.cs:1:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webplatformservice_18 href "vscode://file/NexusReader.Web.Client/Program.cs:18:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_webstorageservice_19 href "vscode://file/NexusReader.Web.Client/Program.cs:19:1" "Open source"
    click flow_type_nexusreader_web_client_program_cs_identityservice_32 href "vscode://file/NexusReader.Web.Client/Program.cs:32:1" "Open source"
    click flow_file_nexusreader_web_program_cs_file_1 href "vscode://file/NexusReader.Web/Program.cs:1:1" "Open source"
    click flow_method_nexusreader_web_program_cs_program_top_level_29 href "vscode://file/NexusReader.Web/Program.cs:29:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250 href "vscode://file/NexusReader.Web/Program.cs:250:1" "Open source"
    click flow_method_nexusreader_web_program_cs_knowledge_api_group_mappings_261 href "vscode://file/NexusReader.Web/Program.cs:261:1" "Open source"
    click flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330 href "vscode://file/NexusReader.Web/Program.cs:330:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355 href "vscode://file/NexusReader.Web/Program.cs:355:1" "Open source"
    click flow_method_nexusreader_web_program_cs_stripewebhook_post_api_stripewebhook_367 href "vscode://file/NexusReader.Web/Program.cs:367:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410 href "vscode://file/NexusReader.Web/Program.cs:410:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434 href "vscode://file/NexusReader.Web/Program.cs:434:1" "Open source"
    click flow_method_nexusreader_web_program_cs_map_identity_api_mapgroup_identity_451 href "vscode://file/NexusReader.Web/Program.cs:451:1" "Open source"
    click flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453 href "vscode://file/NexusReader.Web/Program.cs:453:1" "Open source"
    click flow_type_nexusreader_web_program_cs_framework_34 href "vscode://file/NexusReader.Web/Program.cs:34:1" "Open source"
    click flow_type_nexusreader_web_program_cs_webplatformservice_47 href "vscode://file/NexusReader.Web/Program.cs:47:1" "Open source"
    click flow_type_nexusreader_web_program_cs_named_httpclient_58 href "vscode://file/NexusReader.Web/Program.cs:58:1" "Open source"
    click flow_type_nexusreader_web_program_cs_serveridentityservice_75 href "vscode://file/NexusReader.Web/Program.cs:75:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addapplication_78 href "vscode://file/NexusReader.Web/Program.cs:78:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79 href "vscode://file/NexusReader.Web/Program.cs:79:1" "Open source"
    click flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81 href "vscode://file/NexusReader.Web/Program.cs:81:1" "Open source"
    click flow_type_nexusreader_web_program_cs_tokenlimithandler_87 href "vscode://file/NexusReader.Web/Program.cs:87:1" "Open source"
    click flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93 href "vscode://file/NexusReader.Web/Program.cs:93:1" "Open source"
```
This flow highlights service registration in Program.cs for both client and server. It shows the platform abstractions (IPlatformService, INativeStorageService) are bound to platform-specific implementations in the DI container, enabling reuse of shared layers.

=== DIAGRAM 3: Program.cs Flow (primary-runtime) ===
```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_0_nexusreader_web_program_cs["Program.cs"]
    end
    flow_file_nexusreader_web_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_web_program_cs_configure_pipeline_and_run_225["Configure pipeline and run"]
    flow_method_nexusreader_web_program_cs_database_initialization_and_seeding_with_retries_175["Database initialization and seeding with retries"]
    flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250["GetEpubContent (GET /api/epub/{ebookId}/{index})"]
    flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355["GetMyEbooks (GET /api/library/books)"]
    flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434["HandleSubscriptionCancellation"]
    flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410["HandleSubscriptionSuccess"]
    flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453["Identity Login (GET /identity/login/google)"]
    flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330["IngestEbook (POST /api/library/ingest)"]
    flow_method_nexusreader_web_program_cs_knowledge_api_group_mappings_261["Knowledge API group mappings"]
    flow_method_nexusreader_web_program_cs_map_identity_api_mapgroup_identity_451["Map Identity API (MapGroup /identity)"]
    flow_method_nexusreader_web_program_cs_program_top_level_29["Program (top-level)"]
    flow_method_nexusreader_web_program_cs_stripewebhook_post_api_stripewebhook_367["StripeWebhook (POST /api/StripeWebhook)"]
    flow_method_nexusreader_web_program_cs_usehangfiredashboard_163["UseHangfireDashboard"]
    flow_type_nexusreader_web_program_cs_addapplication_78[/"AddApplication()"/]
    flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79[/"AddInfrastructure(IConfiguration)"/]
    flow_type_nexusreader_web_program_cs_framework_34[/"framework"/]
    flow_type_nexusreader_web_program_cs_identity_ef_stores_107[/"Identity + EF stores"/]
    flow_type_nexusreader_web_program_cs_named_httpclient_58[/"named HttpClient"/]
    flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93[/"NexusReader.Infrastructure.Services.BillingService"/]
    flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81[/"RegisterServicesFromAssemblies"/]
    flow_type_nexusreader_web_program_cs_serveridentityservice_75[/"ServerIdentityService"/]
    flow_type_nexusreader_web_program_cs_tokenlimithandler_87[/"TokenLimitHandler"/]
    flow_type_nexusreader_web_program_cs_webplatformservice_47[/"WebPlatformService"/]
    flow_file_nexusreader_web_program_cs_file_1 -->|middleware| flow_method_nexusreader_web_program_cs_configure_pipeline_and_run_225
    flow_file_nexusreader_web_program_cs_file_1 -->|unknown| flow_method_nexusreader_web_program_cs_database_initialization_and_seeding_with_retries_175
    flow_file_nexusreader_web_program_cs_file_1 -->|GetEpubContent GET / api / epub / ebookId / index| flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250
    flow_file_nexusreader_web_program_cs_file_1 -->|GetMyEbooks GET / api / library / books| flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355
    flow_file_nexusreader_web_program_cs_file_1 -->|HandleSubscriptionCancellation| flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434
    flow_file_nexusreader_web_program_cs_file_1 -->|HandleSubscriptionSuccess| flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410
    flow_file_nexusreader_web_program_cs_file_1 -->|Identity Login GET / identity / login / google| flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453
    flow_file_nexusreader_web_program_cs_file_1 -->|IngestEbook POST / api / library / ingest| flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330
    flow_file_nexusreader_web_program_cs_file_1 -->|Knowledge API group mappings| flow_method_nexusreader_web_program_cs_knowledge_api_group_mappings_261
    flow_file_nexusreader_web_program_cs_file_1 -->|Map Identity API MapGroup / identity| flow_method_nexusreader_web_program_cs_map_identity_api_mapgroup_identity_451
    flow_file_nexusreader_web_program_cs_file_1 -->|Program top-level| flow_method_nexusreader_web_program_cs_program_top_level_29
    flow_file_nexusreader_web_program_cs_file_1 -->|StripeWebhook POST / api / StripeWebhook| flow_method_nexusreader_web_program_cs_stripewebhook_post_api_stripewebhook_367
    flow_file_nexusreader_web_program_cs_file_1 -->|middleware| flow_method_nexusreader_web_program_cs_usehangfiredashboard_163
    flow_file_nexusreader_web_program_cs_file_1 -->|Application layer| flow_type_nexusreader_web_program_cs_addapplication_78
    flow_file_nexusreader_web_program_cs_file_1 -->|Infrastructure layer| flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79
    flow_file_nexusreader_web_program_cs_file_1 -->|Razor / Blazor services| flow_type_nexusreader_web_program_cs_framework_34
    flow_file_nexusreader_web_program_cs_file_1 -->|uses| flow_type_nexusreader_web_program_cs_identity_ef_stores_107
    flow_file_nexusreader_web_program_cs_file_1 -->|uses| flow_type_nexusreader_web_program_cs_named_httpclient_58
    flow_file_nexusreader_web_program_cs_file_1 -->|IBillingService| flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93
    flow_file_nexusreader_web_program_cs_file_1 -->|MediatR handlers| flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81
    flow_file_nexusreader_web_program_cs_file_1 -->|IIdentityService| flow_type_nexusreader_web_program_cs_serveridentityservice_75
    flow_file_nexusreader_web_program_cs_file_1 -->|IAuthorizationHandler| flow_type_nexusreader_web_program_cs_tokenlimithandler_87
    flow_file_nexusreader_web_program_cs_file_1 -->|IPlatformService| flow_type_nexusreader_web_program_cs_webplatformservice_47
    click flow_file_nexusreader_web_program_cs_file_1 href "vscode://file/NexusReader.Web/Program.cs:1:1" "Open source"
    click flow_method_nexusreader_web_program_cs_program_top_level_29 href "vscode://file/NexusReader.Web/Program.cs:29:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250 href "vscode://file/NexusReader.Web/Program.cs:250:1" "Open source"
    click flow_method_nexusreader_web_program_cs_knowledge_api_group_mappings_261 href "vscode://file/NexusReader.Web/Program.cs:261:1" "Open source"
    click flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330 href "vscode://file/NexusReader.Web/Program.cs:330:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355 href "vscode://file/NexusReader.Web/Program.cs:355:1" "Open source"
    click flow_method_nexusreader_web_program_cs_stripewebhook_post_api_stripewebhook_367 href "vscode://file/NexusReader.Web/Program.cs:367:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410 href "vscode://file/NexusReader.Web/Program.cs:410:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434 href "vscode://file/NexusReader.Web/Program.cs:434:1" "Open source"
    click flow_method_nexusreader_web_program_cs_map_identity_api_mapgroup_identity_451 href "vscode://file/NexusReader.Web/Program.cs:451:1" "Open source"
    click flow_type_nexusreader_web_program_cs_framework_34 href "vscode://file/NexusReader.Web/Program.cs:34:1" "Open source"
    click flow_type_nexusreader_web_program_cs_webplatformservice_47 href "vscode://file/NexusReader.Web/Program.cs:47:1" "Open source"
    click flow_type_nexusreader_web_program_cs_named_httpclient_58 href "vscode://file/NexusReader.Web/Program.cs:58:1" "Open source"
    click flow_type_nexusreader_web_program_cs_serveridentityservice_75 href "vscode://file/NexusReader.Web/Program.cs:75:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addapplication_78 href "vscode://file/NexusReader.Web/Program.cs:78:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79 href "vscode://file/NexusReader.Web/Program.cs:79:1" "Open source"
    click flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81 href "vscode://file/NexusReader.Web/Program.cs:81:1" "Open source"
    click flow_type_nexusreader_web_program_cs_tokenlimithandler_87 href "vscode://file/NexusReader.Web/Program.cs:87:1" "Open source"
    click flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93 href "vscode://file/NexusReader.Web/Program.cs:93:1" "Open source"
    click flow_type_nexusreader_web_program_cs_identity_ef_stores_107 href "vscode://file/NexusReader.Web/Program.cs:107:1" "Open source"
    click flow_method_nexusreader_web_program_cs_usehangfiredashboard_163 href "vscode://file/NexusReader.Web/Program.cs:163:1" "Open source"
    click flow_method_nexusreader_web_program_cs_database_initialization_and_seeding_with_retries_175 href "vscode://file/NexusReader.Web/Program.cs:175:1" "Open source"
    click flow_method_nexusreader_web_program_cs_configure_pipeline_and_run_225 href "vscode://file/NexusReader.Web/Program.cs:225:1" "Open source"
```
This diagram focuses on the server Program.cs lifecycle: DB init/seeding, middleware and endpoint wiring. For MAUI the equivalent composition happens in MauiProgram where platform services (MauiPlatformService, MauiStorageService) are registered so shared layers use IPlatformService/INativeStorageService.

=== DIAGRAM 4: Program.cs Contracts and Entities (class-diagram) ===
```mermaid
classDiagram
    class flow_file_nexusreader_web_program_cs_file_1["Program.cs"]
    class flow_type_nexusreader_web_program_cs_addapplication_78["AddApplication()"]
    class flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79["AddInfrastructure(IConfiguration)"]
    class flow_type_nexusreader_web_program_cs_askquestionrequest_569["AskQuestionRequest"]
    class flow_type_nexusreader_web_program_cs_framework_34["framework"]
    class flow_type_nexusreader_web_program_cs_groundednessrequest_567["GroundednessRequest"]
    class flow_type_nexusreader_web_program_cs_identity_ef_stores_107["Identity + EF stores"]
    class flow_type_nexusreader_web_program_cs_knowledgerequest_566["KnowledgeRequest"]
    class flow_type_nexusreader_web_program_cs_named_httpclient_58["named HttpClient"]
    class flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93["NexusReader.Infrastructure.Services.BillingService"]
    class flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81["RegisterServicesFromAssemblies"]
    class flow_type_nexusreader_web_program_cs_semanticsearchrequest_568["SemanticSearchRequest"]
    class flow_type_nexusreader_web_program_cs_serveridentityservice_75["ServerIdentityService"]
    class flow_type_nexusreader_web_program_cs_tokenlimithandler_87["TokenLimitHandler"]
    class flow_type_nexusreader_web_program_cs_webplatformservice_47["WebPlatformService"]
    flow_file_nexusreader_web_program_cs_file_1 --> flow_type_nexusreader_web_program_cs_askquestionrequest_569 : dto AskQuestionRequest
    flow_file_nexusreader_web_program_cs_file_1 --> flow_type_nexusreader_web_program_cs_groundednessrequest_567 : dto GroundednessRequest
    flow_file_nexusreader_web_program_cs_file_1 --> flow_type_nexusreader_web_program_cs_knowledgerequest_566 : dto KnowledgeRequest
    flow_file_nexusreader_web_program_cs_file_1 --> flow_type_nexusreader_web_program_cs_semanticsearchrequest_568 : dto SemanticSearchRequest
    click flow_file_nexusreader_web_program_cs_file_1 href "vscode://file/NexusReader.Web/Program.cs:1:1" "Open source"
    click flow_type_nexusreader_web_program_cs_knowledgerequest_566 href "vscode://file/NexusReader.Web/Program.cs:566:1" "Open source"
    click flow_type_nexusreader_web_program_cs_groundednessrequest_567 href "vscode://file/NexusReader.Web/Program.cs:567:1" "Open source"
    click flow_type_nexusreader_web_program_cs_semanticsearchrequest_568 href "vscode://file/NexusReader.Web/Program.cs:568:1" "Open source"
    click flow_type_nexusreader_web_program_cs_askquestionrequest_569 href "vscode://file/NexusReader.Web/Program.cs:569:1" "Open source"
    click flow_type_nexusreader_web_program_cs_framework_34 href "vscode://file/NexusReader.Web/Program.cs:34:1" "Open source"
    click flow_type_nexusreader_web_program_cs_webplatformservice_47 href "vscode://file/NexusReader.Web/Program.cs:47:1" "Open source"
    click flow_type_nexusreader_web_program_cs_named_httpclient_58 href "vscode://file/NexusReader.Web/Program.cs:58:1" "Open source"
    click flow_type_nexusreader_web_program_cs_serveridentityservice_75 href "vscode://file/NexusReader.Web/Program.cs:75:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addapplication_78 href "vscode://file/NexusReader.Web/Program.cs:78:1" "Open source"
    click flow_type_nexusreader_web_program_cs_addinfrastructure_iconfiguration_79 href "vscode://file/NexusReader.Web/Program.cs:79:1" "Open source"
    click flow_type_nexusreader_web_program_cs_registerservicesfromassemblies_81 href "vscode://file/NexusReader.Web/Program.cs:81:1" "Open source"
    click flow_type_nexusreader_web_program_cs_tokenlimithandler_87 href "vscode://file/NexusReader.Web/Program.cs:87:1" "Open source"
    click flow_type_nexusreader_web_program_cs_nexusreader_infrastructure_services_billingservice_93 href "vscode://file/NexusReader.Web/Program.cs:93:1" "Open source"
    click flow_type_nexusreader_web_program_cs_identity_ef_stores_107 href "vscode://file/NexusReader.Web/Program.cs:107:1" "Open source"
```
This class diagram enumerates DTOs and service registration helpers referenced by Program.cs. It shows which contracts (requests, platform service) the composition root wires into the app.

=== DIAGRAM 5: Program.cs Guardrails and Failure Paths (control-flow) ===
```mermaid
flowchart TD
    subgraph NexusReader_Web_Program["Program"]
    end
    flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250["GetEpubContent (GET /api/epub/{ebookId}/{index})"]
    flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355["GetMyEbooks (GET /api/library/books)"]
    flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434["HandleSubscriptionCancellation"]
    flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410["HandleSubscriptionSuccess"]
    flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453["Identity Login (GET /identity/login/google)"]
    flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330["IngestEbook (POST /api/library/ingest)"]
    flow_method_nexusreader_web_program_cs_program_top_level_29["Program (top-level)"]
    flow_action_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_guard_clause_252_252{"Extract userId"}
    flow_action_nexusreader_web_program_cs_getmyebooks_get_api_library_books_guard_clause_357_357{"Ensure authenticated user"}
    flow_action_nexusreader_web_program_cs_handlesubscriptioncancellation_guard_clause_439_439{"Guards early exit or rejection path"}
    flow_action_nexusreader_web_program_cs_handlesubscriptionsuccess_guard_clause_416_416{"Guards early exit or rejection path"}
    flow_action_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_guard_clause_332_332{"Ensure authenticated user"}
    flow_action_nexusreader_web_program_cs_program_top_level_branch_62_62{"Evaluates branch condition"}
    flow_action_nexusreader_web_program_cs_identity_login_get_identity_login_google_return_460_460(["Return Challenge to Google"])
    flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250 -->|continue| flow_action_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_guard_clause_252_252
    flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355 -->|Unauthorized / continue| flow_action_nexusreader_web_program_cs_getmyebooks_get_api_library_books_guard_clause_357_357
    flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434 -->|exit / continue| flow_action_nexusreader_web_program_cs_handlesubscriptioncancellation_guard_clause_439_439
    flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410 -->|exit / continue| flow_action_nexusreader_web_program_cs_handlesubscriptionsuccess_guard_clause_416_416
    flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453 -->|Return Challenge to Google| flow_action_nexusreader_web_program_cs_identity_login_get_identity_login_google_return_460_460
    flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330 -->|Unauthorized / continue| flow_action_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_guard_clause_332_332
    flow_method_nexusreader_web_program_cs_program_top_level_29 -->|true / false| flow_action_nexusreader_web_program_cs_program_top_level_branch_62_62
    click flow_method_nexusreader_web_program_cs_program_top_level_29 href "vscode://file/NexusReader.Web/Program.cs:29:1" "Open source"
    click flow_action_nexusreader_web_program_cs_program_top_level_branch_62_62 href "vscode://file/NexusReader.Web/Program.cs:62:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_250 href "vscode://file/NexusReader.Web/Program.cs:250:1" "Open source"
    click flow_action_nexusreader_web_program_cs_getepubcontent_get_api_epub_ebookid_index_guard_clause_252_252 href "vscode://file/NexusReader.Web/Program.cs:252:1" "Open source"
    click flow_method_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_330 href "vscode://file/NexusReader.Web/Program.cs:330:1" "Open source"
    click flow_action_nexusreader_web_program_cs_ingestebook_post_api_library_ingest_guard_clause_332_332 href "vscode://file/NexusReader.Web/Program.cs:332:1" "Open source"
    click flow_method_nexusreader_web_program_cs_getmyebooks_get_api_library_books_355 href "vscode://file/NexusReader.Web/Program.cs:355:1" "Open source"
    click flow_action_nexusreader_web_program_cs_getmyebooks_get_api_library_books_guard_clause_357_357 href "vscode://file/NexusReader.Web/Program.cs:357:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptionsuccess_410 href "vscode://file/NexusReader.Web/Program.cs:410:1" "Open source"
    click flow_action_nexusreader_web_program_cs_handlesubscriptionsuccess_guard_clause_416_416 href "vscode://file/NexusReader.Web/Program.cs:416:1" "Open source"
    click flow_method_nexusreader_web_program_cs_handlesubscriptioncancellation_434 href "vscode://file/NexusReader.Web/Program.cs:434:1" "Open source"
    click flow_action_nexusreader_web_program_cs_handlesubscriptioncancellation_guard_clause_439_439 href "vscode://file/NexusReader.Web/Program.cs:439:1" "Open source"
    click flow_method_nexusreader_web_program_cs_identity_login_get_identity_login_google_453 href "vscode://file/NexusReader.Web/Program.cs:453:1" "Open source"
    click flow_action_nexusreader_web_program_cs_identity_login_get_identity_login_google_return_460_460 href "vscode://file/NexusReader.Web/Program.cs:460:1" "Open source"
```
This control-flow view highlights guard clauses, authentication checks, and early-exit paths for key endpoints. It clarifies where platform services must surface correct user/context info for downstream shared logic.

=== DIAGRAM 6: Method Flow Details (method-flow) ===
```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph NexusReader_Web_Client_Handlers_AuthenticationHeaderHandler["AuthenticationHeaderHandler"]
    end
    subgraph NexusReader_Web_Client_Services_WebPlatformService["WebPlatformService"]
    end
    subgraph NexusReader_UI_Shared_Services_KnowledgeGraphService["KnowledgeGraphService"]
    end
    subgraph NexusReader_UI_Shared_Services_NexusAuthenticationStateProvider["NexusAuthenticationStateProvider"]
    end
    subgraph NexusReader_UI_Shared_Services_SyncService["SyncService"]
    end
    subgraph NexusReader_UI_Shared_Services_KnowledgeCoordinator["KnowledgeCoordinator"]
    end
    flow_file_nexusreader_ui_shared_services_knowledgecoordinator_cs_file_1["KnowledgeCoordinator"]
    flow_file_nexusreader_ui_shared_services_knowledgegraphservice_cs_file_1["KnowledgeGraphService"]
    flow_file_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_file_1["NexusAuthenticationStateProvider"]
    flow_file_nexusreader_ui_shared_services_syncservice_cs_file_1["SyncService"]
    flow_file_nexusreader_web_client_services_webplatformservice_cs_file_1["WebPlatformService"]
    flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112["RequestSummaryAndQuizAsync"]
    flow_method_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_36["Clear"]
    flow_method_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_84["CreateState"]
    flow_method_nexusreader_ui_shared_services_syncservice_cs_disposeasync_103["DisposeAsync"]
    flow_method_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_112["CloneHttpRequestMessageAsync"]
    flow_method_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_32["GetDeviceContext"]
    flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_generatefullquiz_await_91_91["Waits for async work"]
    flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_requestsummary_await_83_83["Waits for async work"]
    flow_action_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_await_114_114["Waits for async work"]
    flow_action_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_branch_41_41{"Evaluates branch condition"}
    flow_action_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_branch_93_93{"Evaluates branch condition"}
    flow_action_nexusreader_ui_shared_services_syncservice_cs_disposeasync_branch_106_106{"Evaluates branch condition"}
    flow_action_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_branch_119_119{"Copy content if present"}
    flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1["AuthenticationHeaderHandler"]
    flow_action_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_return_34_34(["Returns result"])
    flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_generatefullquiz_await_91_91 -->|RequestSummaryAndQuizAsync| flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112
    flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_requestsummary_await_83_83 -->|RequestSummaryAndQuizAsync| flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112
    flow_action_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_return_34_34 -->|Wraps created context in Result.Ok| flow_action_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_return_34_34
    flow_file_nexusreader_ui_shared_services_knowledgecoordinator_cs_file_1 -->|RequestSummaryAndQuizAsync| flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112
    flow_file_nexusreader_ui_shared_services_knowledgegraphservice_cs_file_1 -->|Clear| flow_method_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_36
    flow_file_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_file_1 -->|CreateState| flow_method_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_84
    flow_file_nexusreader_ui_shared_services_syncservice_cs_file_1 -->|DisposeAsync| flow_method_nexusreader_ui_shared_services_syncservice_cs_disposeasync_103
    flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1 -->|CloneHttpRequestMessageAsync| flow_method_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_112
    flow_file_nexusreader_web_client_services_webplatformservice_cs_file_1 -->|GetDeviceContext| flow_method_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_32
    flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112 -->|Waits for async work| flow_action_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_await_114_114
    flow_method_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_36 -->|true / false| flow_action_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_branch_41_41
    flow_method_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_84 -->|true / false| flow_action_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_branch_93_93
    flow_method_nexusreader_ui_shared_services_syncservice_cs_disposeasync_103 -->|true / false| flow_action_nexusreader_ui_shared_services_syncservice_cs_disposeasync_branch_106_106
    flow_method_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_112 -->|copy-content / no-content| flow_action_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_branch_119_119
    flow_method_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_32 -->|Returns result| flow_action_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_return_34_34
    click flow_file_nexusreader_web_client_handlers_authenticationheaderhandler_cs_file_1 href "vscode://file/NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs:1:1" "Open source"
    click flow_method_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_112 href "vscode://file/NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs:112:1" "Open source"
    click flow_action_nexusreader_web_client_handlers_authenticationheaderhandler_cs_clonehttprequestmessageasync_branch_119_119 href "vscode://file/NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs:119:1" "Open source"
    click flow_file_nexusreader_web_client_services_webplatformservice_cs_file_1 href "vscode://file/NexusReader.Web.Client/Services/WebPlatformService.cs:1:1" "Open source"
    click flow_method_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_32 href "vscode://file/NexusReader.Web.Client/Services/WebPlatformService.cs:32:1" "Open source"
    click flow_action_nexusreader_web_client_services_webplatformservice_cs_getdevicecontext_return_34_34 href "vscode://file/NexusReader.Web.Client/Services/WebPlatformService.cs:34:1" "Open source"
    click flow_file_nexusreader_ui_shared_services_knowledgegraphservice_cs_file_1 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeGraphService.cs:1:1" "Open source"
    click flow_method_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_36 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeGraphService.cs:36:1" "Open source"
    click flow_action_nexusreader_ui_shared_services_knowledgegraphservice_cs_clear_branch_41_41 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeGraphService.cs:41:1" "Open source"
    click flow_file_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_file_1 href "vscode://file/NexusReader.UI.Shared/Services/NexusAuthenticationStateProvider.cs:1:1" "Open source"
    click flow_method_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_84 href "vscode://file/NexusReader.UI.Shared/Services/NexusAuthenticationStateProvider.cs:84:1" "Open source"
    click flow_action_nexusreader_ui_shared_services_nexusauthenticationstateprovider_cs_createstate_branch_93_93 href "vscode://file/NexusReader.UI.Shared/Services/NexusAuthenticationStateProvider.cs:93:1" "Open source"
    click flow_file_nexusreader_ui_shared_services_syncservice_cs_file_1 href "vscode://file/NexusReader.UI.Shared/Services/SyncService.cs:1:1" "Open source"
    click flow_method_nexusreader_ui_shared_services_syncservice_cs_disposeasync_103 href "vscode://file/NexusReader.UI.Shared/Services/SyncService.cs:103:1" "Open source"
    click flow_action_nexusreader_ui_shared_services_syncservice_cs_disposeasync_branch_106_106 href "vscode://file/NexusReader.UI.Shared/Services/SyncService.cs:106:1" "Open source"
    click flow_file_nexusreader_ui_shared_services_knowledgecoordinator_cs_file_1 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeCoordinator.cs:1:1" "Open source"
    click flow_method_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_112 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeCoordinator.cs:112:1" "Open source"
    click flow_action_nexusreader_ui_shared_services_knowledgecoordinator_cs_requestsummaryandquizasync_await_114_114 href "vscode://file/NexusReader.UI.Shared/Services/KnowledgeCoordinator.cs:114:1" "Open source"
    click flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_requestsummary_await_83_83 href "vscode://file/NexusReader.UI.Shared/Components/Molecules/SelectionAiPanel.razor:83:1" "Open source"
    click flow_action_nexusreader_ui_shared_components_molecules_selectionaipanel_razor_generatefullquiz_await_91_91 href "vscode://file/NexusReader.UI.Shared/Components/Molecules/SelectionAiPanel.razor:91:1" "Open source"
```
This method-level diagram shows how platform and auth handlers interact with shared UI services (KnowledgeCoordinator, SyncService). It highlights async points and branches where platform-provided context or storage can affect flow.

### Key Files
- NexusReader.Infrastructure.Mobile/Services/MauiPlatformService.cs
- NexusReader.Infrastructure.Mobile/Services/MauiStorageService.cs
- NexusReader.Mobile/MauiProgram.cs
- NexusReader.UI.Shared/Services/KnowledgeCoordinator.cs
- NexusReader.Web.Client/Program.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)
- [Web Client (WASM) and Shared UI Components](../domains/web-client-and-shared-ui.md)
- [Infrastructure Services (AI, Epub, Storage, Billing)](../infrastructure/infrastructure-services.md)
- [Authentication, Authorization and Account Flows](../flows/authentication-and-account.md)
- [Real-time Synchronization and Sync Pipeline](realtime-and-sync.md)
- [AI Features, Knowledge Graph and UX Integration](../integrations/ai-and-knowledge-ux.md)
- [Top Business Flows](../business/top-business-flows.md)
