## Business Overview

Business Overview centers on account, ai tokens, ai tokens (aitokensused, aitokenlimit) and currently highlights User Authentication Flow as the most representative business flow.

### Business Summary

- Domains: 37
- Capabilities: 7
- Flows: 7
- Source summaries used: 15
- Technical flow inputs used: 7

### Business Domains

- **account** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **ai tokens** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **ai tokens (aitokensused, aitokenlimit)** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **aitokens / aitokenlimit** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **appdbcontext** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **auth** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **authentication** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **author** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **authorization requirement** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **command** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **ebook** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **ebook/library ingestion** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **embedding** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **externallogin (google)** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **identity** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **jwt** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **knowledge/knowledgeservice** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **knowledgegraph** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **login** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **loginmodel / credentials** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **pro subscription** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **query** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **reader navigation / interaction** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **real time sync/broadcast** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **registration** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **result (operation outcome)** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **result<t>** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **secure storage** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **subscription/plan** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **subscriptionplan** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **sync** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **theme** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **token refresh** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **user** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **user / identity** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **user identity and profiles** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.
- **userprofile** (high confidence): Business Overview is currently grounded only by document anchors and still lacks a verified cross-file execution narrative.

### Business Capabilities

- **User Authentication Flow** (high confidence): User Authentication Flow coordinates 4 business-relevant steps beginning at NexusReader.UI.Shared/Pages/Account/Login.razor. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.UI.Shared/Pages/Account/Login.razor, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.
- **Token Refresh / Request Retry Flow** (high confidence): Token Refresh / Request Retry Flow coordinates 4 business-relevant steps beginning at NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.
- **Pro Access Authorization Flow** (high confidence): Pro Access Authorization Flow coordinates 4 business-relevant steps beginning at NexusReader.Web/Program.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web/Program.cs, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.
- **Ebook Ingestion Flow** (high confidence): Ebook Ingestion Flow coordinates 4 business-relevant steps beginning at NexusReader.Web/Program.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web/Program.cs, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.
- **Program (top level)** (high confidence): Program (top level) coordinates 8 business-relevant steps beginning at NexusReader.Web.Client/Program.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs, NexusReader.Web/Program.cs.
- **Program (top level)** (high confidence): Program (top level) coordinates 8 business-relevant steps beginning at NexusReader.Web/Program.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web/Program.cs, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.
- **Knowledge API group mappings** (high confidence): Knowledge API group mappings coordinates 8 business-relevant steps beginning at NexusReader.Web/Program.cs. Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile. Entrypoints: NexusReader.Web/Program.cs, NexusReader.Web.Client/Program.cs, NexusReader.Maui/MauiProgram.cs.

### Major Value Streams

- **Ebook Ingestion Flow** (rank 1, score 0.85, high confidence): Ebook Ingestion Flow starts at NexusReader.Web/Program.cs and follows 12 grounded steps: Enter Program (top level) -> Falls back to alternate path -> Repeats work over a collection or condition -> Guards early exit or rejection path -> .... Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile.
- **Knowledge API group mappings** (rank 2, score 0.85, high confidence): Knowledge API group mappings starts at NexusReader.Web/Program.cs and follows 12 grounded steps: Enter Program (top level) -> Falls back to alternate path -> Repeats work over a collection or condition -> Guards early exit or rejection path -> .... Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile.
- **Pro Access Authorization Flow** (rank 3, score 0.85, high confidence): Pro Access Authorization Flow starts at NexusReader.Web/Program.cs and follows 12 grounded steps: Enter Program (top level) -> Falls back to alternate path -> Repeats work over a collection or condition -> Guards early exit or rejection path -> .... Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile.
- **User Authentication Flow** (rank 5, score 0.85, high confidence): User Authentication Flow starts at NexusReader.UI.Shared/Pages/Account/Login.razor and follows 9 grounded steps: Enter Handle Login -> Falls back to alternate path -> Evaluates branch condition -> Reads repository or persistence state -> .... Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile.
- **Token Refresh / Request Retry Flow** (rank 6, score 0.81, high confidence): Token Refresh / Request Retry Flow starts at NexusReader.Web.Client/Handlers/AuthenticationHeaderHandler.cs and follows 12 grounded steps: Enter Send Async -> Falls back to alternate path -> Calls external dependency -> Evaluates branch condition -> .... Domains: account, ai tokens, ai tokens (aitokensused, aitokenlimit), aitokens / aitokenlimit, appdbcontext, auth, authentication, author, authorization requirement, command, ebook, ebook/library ingestion, embedding, externallogin (google), identity, jwt, knowledge/knowledgeservice, knowledgegraph, login, loginmodel / credentials, pro subscription, query, reader navigation / interaction, real time sync/broadcast, registration, result (operation outcome), result<t>, secure storage, subscription/plan, subscriptionplan, sync, theme, token refresh, user, user / identity, user identity and profiles, userprofile.

### Diagrams

Business interpretation diagrams grounded in the selected evidence for this overview scope.

#### Dependency and Model Map

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    flow_file_nexusreader_maui_mauiprogram_cs_file_1["MauiProgram"]
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35[/"AuthorizationCore"/]
    flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42[/"FocusModeService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38[/"HttpClient"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28[/"MauiPlatformService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10[/"MauiProgram"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29[/"MauiStorageService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32[/"NexusAuthenticationStateProvider"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33[/"NexusAuthenticationStateProvider (resolved)"/]
    flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43[/"QuizStateService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44[/"ReaderNavigationService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41[/"ThemeService"/]
    flow_type_nexusreader_web_client_program_cs_throwingbookstorageservice_74[/"ThrowingBookStorageService"/]
    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_file_nexusreader_maui_mauiprogram_cs_file_1 -->|Authorization| flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IFocusModeService| flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|HttpClient| flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IPlatformService| flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|model MauiProgram| flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|INativeStorageService| flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|AuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IQuizStateService| flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IReaderNavigationService| flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IThemeService| flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41
    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 -->|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
    click flow_file_nexusreader_maui_mauiprogram_cs_file_1 href "vscode://file/NexusReader.Maui/MauiProgram.cs:1:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10 href "vscode://file/NexusReader.Maui/MauiProgram.cs:10:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28 href "vscode://file/NexusReader.Maui/MauiProgram.cs:28:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29 href "vscode://file/NexusReader.Maui/MauiProgram.cs:29:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32 href "vscode://file/NexusReader.Maui/MauiProgram.cs:32:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33 href "vscode://file/NexusReader.Maui/MauiProgram.cs:33:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35 href "vscode://file/NexusReader.Maui/MauiProgram.cs:35:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38 href "vscode://file/NexusReader.Maui/MauiProgram.cs:38:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41 href "vscode://file/NexusReader.Maui/MauiProgram.cs:41:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42 href "vscode://file/NexusReader.Maui/MauiProgram.cs:42:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43 href "vscode://file/NexusReader.Maui/MauiProgram.cs:43:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44 href "vscode://file/NexusReader.Maui/MauiProgram.cs:44: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"
```

This dependency-map view is included as a grounded technical anchor for the published business interpretation.

#### Startup and Service Registration Flow

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_2_nexusreader_maui_mauiprogram_cs["MauiProgram"]
    end
    subgraph flow_1_nexusreader_web_client_program_cs["Program.cs"]
    end
    subgraph Node_xref_business_overview_md_user_authentication_flow["User Authentication Flow"]
    end
    subgraph Node_xref_business_overview_md_token_refresh_request_retry_flow["Token Refresh / Request Retry Flow"]
    end
    subgraph Node_xref_business_overview_md_pro_access_authorization_flow["Pro Access Authorization Flow"]
    end
    flow_file_nexusreader_maui_mauiprogram_cs_file_1["MauiProgram"]
    flow_file_nexusreader_web_client_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12["CreateMauiApp"]
    flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35[/"AuthorizationCore"/]
    flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42[/"FocusModeService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38[/"HttpClient"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28[/"MauiPlatformService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29[/"MauiStorageService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32[/"NexusAuthenticationStateProvider"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33[/"NexusAuthenticationStateProvider (resolved)"/]
    flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43[/"QuizStateService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44[/"ReaderNavigationService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41[/"ThemeService"/]
    flow_type_nexusreader_web_client_program_cs_identityservice_32[/"IdentityService"/]
    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_webplatformservice_18[/"WebPlatformService"/]
    flow_type_nexusreader_web_client_program_cs_webstorageservice_19[/"WebStorageService"/]
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|unknown| flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|Authorization| flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IFocusModeService| flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|HttpClient| flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IPlatformService| flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|INativeStorageService| flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|AuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IQuizStateService| flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IReaderNavigationService| flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IThemeService| flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41
    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 -->|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 -->|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
    click flow_file_nexusreader_maui_mauiprogram_cs_file_1 href "vscode://file/NexusReader.Maui/MauiProgram.cs:1:1" "Open source"
    click flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12 href "vscode://file/NexusReader.Maui/MauiProgram.cs:12:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28 href "vscode://file/NexusReader.Maui/MauiProgram.cs:28:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29 href "vscode://file/NexusReader.Maui/MauiProgram.cs:29:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32 href "vscode://file/NexusReader.Maui/MauiProgram.cs:32:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33 href "vscode://file/NexusReader.Maui/MauiProgram.cs:33:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35 href "vscode://file/NexusReader.Maui/MauiProgram.cs:35:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38 href "vscode://file/NexusReader.Maui/MauiProgram.cs:38:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41 href "vscode://file/NexusReader.Maui/MauiProgram.cs:41:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42 href "vscode://file/NexusReader.Maui/MauiProgram.cs:42:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43 href "vscode://file/NexusReader.Maui/MauiProgram.cs:43:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44 href "vscode://file/NexusReader.Maui/MauiProgram.cs:44: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_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"
```

This primary-runtime view is included as a grounded technical anchor for the published business interpretation.

#### MauiProgram Flow

```mermaid
---
config:
  flowchart:
    defaultRenderer: "elk"
---
flowchart TD
    subgraph flow_2_nexusreader_maui_mauiprogram_cs["MauiProgram"]
    end
    subgraph flow_0_nexusreader_web_program_cs["Program.cs"]
    end
    subgraph Node_xref_business_overview_md_user_authentication_flow["User Authentication Flow"]
    end
    subgraph Node_xref_business_overview_md_token_refresh_request_retry_flow["Token Refresh / Request Retry Flow"]
    end
    subgraph Node_xref_business_overview_md_pro_access_authorization_flow["Pro Access Authorization Flow"]
    end
    flow_file_nexusreader_maui_mauiprogram_cs_file_1["MauiProgram"]
    flow_file_nexusreader_web_program_cs_file_1["Program.cs"]
    flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12["CreateMauiApp"]
    flow_method_nexusreader_web_program_cs_program_top_level_29["Program (top-level)"]
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_catch_59_59["Handles exception path"]
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_throw_63_63["Throws exception"]
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_try_14_14["Begins protected execution"]
    flow_action_nexusreader_web_program_cs_program_top_level_branch_62_62{"Evaluates branch condition"}
    flow_action_nexusreader_web_program_cs_program_top_level_fallback_66_66{"Falls back to alternate path"}
    flow_action_nexusreader_web_program_cs_program_top_level_repository_read_125_125["Reads repository or persistence state"]
    flow_action_nexusreader_web_program_cs_program_top_level_repository_read_126_126["Reads repository or persistence state"]
    flow_action_nexusreader_web_program_cs_program_top_level_repository_read_127_127["Reads repository or persistence state"]
    flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35[/"AuthorizationCore"/]
    flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42[/"FocusModeService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38[/"HttpClient"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28[/"MauiPlatformService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10[/"MauiProgram"/]
    flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29[/"MauiStorageService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32[/"NexusAuthenticationStateProvider"/]
    flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33[/"NexusAuthenticationStateProvider (resolved)"/]
    flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43[/"QuizStateService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44[/"ReaderNavigationService"/]
    flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41[/"ThemeService"/]
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57(["Build and return app"])
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_catch_59_59 -->|Throws exception| flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_throw_63_63
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57 -->|handled exception| flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_catch_59_59
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57 -->|Returns result| flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57
    flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_try_14_14 -->|Build and return app| flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57
    flow_action_nexusreader_web_program_cs_program_top_level_branch_62_62 -->|fallback| flow_action_nexusreader_web_program_cs_program_top_level_fallback_66_66
    flow_action_nexusreader_web_program_cs_program_top_level_fallback_66_66 -->|Reads repository or persistence state| flow_action_nexusreader_web_program_cs_program_top_level_repository_read_125_125
    flow_action_nexusreader_web_program_cs_program_top_level_repository_read_125_125 -->|Reads repository or persistence state| flow_action_nexusreader_web_program_cs_program_top_level_repository_read_126_126
    flow_action_nexusreader_web_program_cs_program_top_level_repository_read_126_126 -->|Reads repository or persistence state| flow_action_nexusreader_web_program_cs_program_top_level_repository_read_127_127
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|unknown| flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|CreateMauiApp| flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|Authorization| flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IFocusModeService| flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|HttpClient| flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IPlatformService| flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|model MauiProgram| flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|INativeStorageService| flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|NexusAuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|AuthenticationStateProvider| flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IQuizStateService| flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IReaderNavigationService| flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44
    flow_file_nexusreader_maui_mauiprogram_cs_file_1 -->|IThemeService| flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41
    flow_file_nexusreader_web_program_cs_file_1 -->|Program top-level| flow_method_nexusreader_web_program_cs_program_top_level_29
    flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12 -->|Begins protected execution| flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_try_14_14
    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_file_nexusreader_maui_mauiprogram_cs_file_1 href "vscode://file/NexusReader.Maui/MauiProgram.cs:1:1" "Open source"
    click flow_method_nexusreader_maui_mauiprogram_cs_createmauiapp_12 href "vscode://file/NexusReader.Maui/MauiProgram.cs:12:1" "Open source"
    click flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_try_14_14 href "vscode://file/NexusReader.Maui/MauiProgram.cs:14:1" "Open source"
    click flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_return_57_57 href "vscode://file/NexusReader.Maui/MauiProgram.cs:57:1" "Open source"
    click flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_catch_59_59 href "vscode://file/NexusReader.Maui/MauiProgram.cs:59:1" "Open source"
    click flow_action_nexusreader_maui_mauiprogram_cs_createmauiapp_throw_63_63 href "vscode://file/NexusReader.Maui/MauiProgram.cs:63:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauiprogram_10 href "vscode://file/NexusReader.Maui/MauiProgram.cs:10:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauiplatformservice_28 href "vscode://file/NexusReader.Maui/MauiProgram.cs:28:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_mauistorageservice_29 href "vscode://file/NexusReader.Maui/MauiProgram.cs:29:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_32 href "vscode://file/NexusReader.Maui/MauiProgram.cs:32:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_nexusauthenticationstateprovider_resolved_33 href "vscode://file/NexusReader.Maui/MauiProgram.cs:33:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_authorizationcore_35 href "vscode://file/NexusReader.Maui/MauiProgram.cs:35:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_httpclient_38 href "vscode://file/NexusReader.Maui/MauiProgram.cs:38:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_themeservice_41 href "vscode://file/NexusReader.Maui/MauiProgram.cs:41:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_focusmodeservice_42 href "vscode://file/NexusReader.Maui/MauiProgram.cs:42:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_quizstateservice_43 href "vscode://file/NexusReader.Maui/MauiProgram.cs:43:1" "Open source"
    click flow_type_nexusreader_maui_mauiprogram_cs_readernavigationservice_44 href "vscode://file/NexusReader.Maui/MauiProgram.cs:44: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_action_nexusreader_web_program_cs_program_top_level_branch_62_62 href "vscode://file/NexusReader.Web/Program.cs:62:1" "Open source"
    click flow_action_nexusreader_web_program_cs_program_top_level_fallback_66_66 href "vscode://file/NexusReader.Web/Program.cs:66:1" "Open source"
    click flow_action_nexusreader_web_program_cs_program_top_level_repository_read_125_125 href "vscode://file/NexusReader.Web/Program.cs:125:1" "Open source"
    click flow_action_nexusreader_web_program_cs_program_top_level_repository_read_126_126 href "vscode://file/NexusReader.Web/Program.cs:126:1" "Open source"
    click flow_action_nexusreader_web_program_cs_program_top_level_repository_read_127_127 href "vscode://file/NexusReader.Web/Program.cs:127:1" "Open source"
```

This primary-runtime view is included as a grounded technical anchor for the published business interpretation.


### Unknowns and Gaps

- Business flow Token Refresh / Request Retry Flow is ambiguous relative to another candidate flow in the same scope.
- Business flow Pro Access Authorization Flow is ambiguous relative to another candidate flow in the same scope.

### Key Files

- NexusReader.Maui/MauiProgram.cs
- NexusReader.Web.Client/Program.cs
- NexusReader.Web/Program.cs
- NexusReader.Application/DTOs/User/AuthorDto.cs
- NexusReader.Application/Security/Authorization/ProUserHandler.cs
- NexusReader.Application/Security/Authorization/ProUserRequirement.cs
- NexusReader.Domain/Entities/Author.cs
- NexusReader.UI.Shared/Layout/AuthLayout.razor

---

## See Also

- [Project Overview and High-level Architecture](../collections/overview.md)
- [Authentication, Authorization and Account Flows](../flows/authentication-and-account.md)
- [Infrastructure Services (AI, Epub, Storage, Billing)](../infrastructure/infrastructure-services.md)
- [Application Layer: Commands, Queries, DTOs and Handlers](../domains/application-cqs-and-handlers.md)
- [Top Business Flows](top-business-flows.md)
