# long-6mui/cnpm-nc-readmanager architecture

> Architecture diagram of the GitHub repository long-6mui/cnpm-nc-readmanager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/long-6mui/cnpm-nc-readmanager
- Repository: https://github.com/long-6mui/cnpm-nc-readmanager

## Overview

ReadManager is a story publishing and reading product with an ASP.NET API, a mobile reader, and a web reader/admin. The core flow is readers browsing public stories and chapters, while admins manage story metadata and import/publish chapters; authentication supports both clients. The API services and EF Core database provide the principal domain layer. Several API services and client view-model implementations were not sampled, so only documented or directly evidenced connections are drawn; README material was not provided.

Main entry points: [`src/ReadManager.Api/Data/AppDbContext.cs`](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Data/AppDbContext.cs) (EF data context), [`src/ReadManager.Web/Services/StoriesApiClient.cs`](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Services/StoriesApiClient.cs) (Web API client), [`src/ReadManager.Api/Program.cs`](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Program.cs) (API hosting), [`src/ReadManager.Mobile/Services/ApiClient.cs`](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/ApiClient.cs) (Mobile HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Reader clients"]
  node_mobile_views["Mobile screens"]
  node_mobile_vm["Mobile reading state"]
  node_mobile_services["Mobile API services<br/>[StoryService.cs]"]
  node_mobile_auth["Mobile authentication<br/>[AuthService.cs]"]
  node_api_client["Mobile HTTP client<br/>[ApiClient.cs]"]
end

subgraph group_web["Web experience"]
  node_web_pages["Web reader pages"]
  node_web_home["Home and discovery<br/>[HomeController.cs]"]
  node_web_accounts["Web accounts"]
  node_web_admin_stories["Story administration"]
  node_web_admin_genres["Genre administration"]
  node_web_preview["Import preview"]
  node_web_api["Web API client"]
  node_web_auth_api["Web auth client<br/>[AuthApiClient.cs]"]
end

subgraph group_api["API domain"]
  node_api_auth_controller["Authentication endpoints<br/>[AuthController.cs]"]
  node_api_auth_service["Authentication logic<br/>[AuthService.cs]"]
  node_session_auth["Bearer session validation"]
  node_story_controller["Story endpoints"]
  node_story_service["Story domain service<br/>[StoryService.cs]"]
  node_genre_service["Genre service<br/>[GenreService.cs]"]
  node_chapter_controller["Chapter endpoints"]
  node_chapter_service["Chapter domain service<br/>[ChapterService.cs]"]
  node_chapter_reader["Chapter file reader"]
  node_zip_importer["ZIP story importer"]
  node_api_program["API hosting<br/>[Program.cs]"]
end

subgraph group_data["Persistence"]
  node_db_context["EF data context<br/>[AppDbContext.cs]"]
  node_database[("MySQL database")]
end

node_reader(("Reader"))
node_admin(("Administrator"))

node_reader -.->|"uses"| node_mobile_views
node_mobile_views -.->|"binds to"| node_mobile_vm
node_mobile_vm -.->|"requests data"| node_mobile_services
node_mobile_services -->|"sends requests"| node_api_client
node_mobile_auth -->|"posts credentials"| node_api_client
node_api_client -.->|"HTTP API"| node_story_controller
node_api_client -.->|"HTTP API"| node_api_auth_controller
node_reader -.->|"reads"| node_web_pages
node_web_home -->|"requests catalog"| node_web_api
node_web_pages -->|"requests stories"| node_web_api
node_web_accounts -->|"calls auth API"| node_web_auth_api
node_admin -.->|"manages stories"| node_web_admin_stories
node_admin -.->|"manages genres"| node_web_admin_genres
node_web_admin_stories -->|"calls API"| node_web_api
node_web_admin_genres -->|"calls API"| node_web_api
node_web_preview -->|"provides preview base"| node_web_admin_stories
node_web_api -.->|"HTTP API"| node_story_controller
node_web_api -->|"HTTP API"| node_chapter_controller
node_web_auth_api -->|"HTTP API"| node_api_auth_controller
node_story_controller -->|"delegates to"| node_story_service
node_chapter_controller -->|"delegates to"| node_chapter_service
node_api_auth_controller -->|"delegates to"| node_api_auth_service
node_chapter_service -->|"uses"| node_chapter_reader
node_story_service -.->|"queries data"| node_db_context
node_chapter_service -->|"reads and writes"| node_db_context
node_api_auth_service -->|"reads and writes"| node_db_context
node_session_auth -->|"checks user"| node_db_context
node_genre_service -.->|"uses data"| node_db_context
node_db_context -->|"persists entities"| node_database
node_api_program -->|"configures"| node_db_context
node_api_program -->|"registers"| node_session_auth
node_api_program -.->|"registers"| node_story_service
node_api_program -->|"registers"| node_chapter_service

click node_mobile_views "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Views/ChapterReaderPage.xaml.cs"
click node_mobile_vm "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/ViewModels/ChapterReaderViewModel.cs"
click node_mobile_services "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/StoryService.cs"
click node_mobile_auth "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/Auth/AuthService.cs"
click node_api_client "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/ApiClient.cs"
click node_web_pages "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/StoriesController.cs"
click node_web_home "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/HomeController.cs"
click node_web_accounts "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/AccountController.cs"
click node_web_admin_stories "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/StoriesController.cs"
click node_web_admin_genres "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/GenresController.cs"
click node_web_preview "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/PreviewController.cs"
click node_web_api "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Services/StoriesApiClient.cs"
click node_web_auth_api "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Services/AuthApiClient.cs"
click node_api_auth_controller "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/AuthController.cs"
click node_api_auth_service "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/AuthService.cs"
click node_session_auth "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Authentication/ApiSessionHandler.cs"
click node_story_controller "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/StoriesController.cs"
click node_story_service "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/StoryService.cs"
click node_genre_service "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/GenreService.cs"
click node_chapter_controller "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/ChaptersController.cs"
click node_chapter_service "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/ChapterService.cs"
click node_chapter_reader "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/ChapterFileReader.cs"
click node_zip_importer "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Data/ZipStoryImporter.cs"
click node_db_context "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Data/AppDbContext.cs"
click node_api_program "https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Program.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mobile_views,node_mobile_vm,node_mobile_services,node_mobile_auth,node_api_client toneBlue
class node_web_pages,node_web_home,node_web_accounts,node_web_admin_stories,node_web_admin_genres,node_web_preview,node_web_api,node_web_auth_api toneAmber
class node_api_auth_controller,node_api_auth_service,node_session_auth,node_story_controller,node_story_service,node_genre_service,node_chapter_controller,node_chapter_service,node_chapter_reader,node_zip_importer,node_api_program toneMint
class node_db_context,node_database toneRose
class node_reader,node_admin toneIndigo
```

## Components

### Reader clients

- [Mobile screens](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Views/ChapterReaderPage.xaml.cs): `src/ReadManager.Mobile/Views/ChapterReaderPage.xaml.cs`
- [Mobile reading state](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/ViewModels/ChapterReaderViewModel.cs): `src/ReadManager.Mobile/ViewModels/ChapterReaderViewModel.cs`
- [Mobile API services](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/StoryService.cs): `src/ReadManager.Mobile/Services/StoryService.cs`
- [Mobile authentication](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/Auth/AuthService.cs): `src/ReadManager.Mobile/Services/Auth/AuthService.cs`
- [Mobile HTTP client](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Mobile/Services/ApiClient.cs): `src/ReadManager.Mobile/Services/ApiClient.cs`

### Web experience

- [Web reader pages](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/StoriesController.cs): `src/ReadManager.Web/Controllers/StoriesController.cs`
- [Home and discovery](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/HomeController.cs): `src/ReadManager.Web/Controllers/HomeController.cs`
- [Web accounts](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Controllers/AccountController.cs): `src/ReadManager.Web/Controllers/AccountController.cs`
- [Story administration](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/StoriesController.cs): `src/ReadManager.Web/Areas/Admin/Controllers/StoriesController.cs`
- [Genre administration](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/GenresController.cs): `src/ReadManager.Web/Areas/Admin/Controllers/GenresController.cs`
- [Import preview](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Areas/Admin/Controllers/PreviewController.cs): `src/ReadManager.Web/Areas/Admin/Controllers/PreviewController.cs`
- [Web API client](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Services/StoriesApiClient.cs): `src/ReadManager.Web/Services/StoriesApiClient.cs`
- [Web auth client](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Web/Services/AuthApiClient.cs): `src/ReadManager.Web/Services/AuthApiClient.cs`

### API domain

- [Authentication endpoints](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/AuthController.cs): `src/ReadManager.Api/Controllers/AuthController.cs`
- [Authentication logic](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/AuthService.cs): `src/ReadManager.Api/Services/AuthService.cs`
- [Bearer session validation](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Authentication/ApiSessionHandler.cs): `src/ReadManager.Api/Authentication/ApiSessionHandler.cs`
- [Story endpoints](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/StoriesController.cs): `src/ReadManager.Api/Controllers/StoriesController.cs`
- [Story domain service](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/StoryService.cs): `src/ReadManager.Api/Services/StoryService.cs`
- [Genre service](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/GenreService.cs): `src/ReadManager.Api/Services/GenreService.cs`
- [Chapter endpoints](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Controllers/ChaptersController.cs): `src/ReadManager.Api/Controllers/ChaptersController.cs`
- [Chapter domain service](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/ChapterService.cs): `src/ReadManager.Api/Services/ChapterService.cs`
- [Chapter file reader](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Services/ChapterFileReader.cs): `src/ReadManager.Api/Services/ChapterFileReader.cs`
- [ZIP story importer](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Data/ZipStoryImporter.cs): `src/ReadManager.Api/Data/ZipStoryImporter.cs`
- [API hosting](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Program.cs): `src/ReadManager.Api/Program.cs`

### Persistence

- [EF data context](https://github.com/long-6mui/cnpm-nc-readmanager/blob/main/src/ReadManager.Api/Data/AppDbContext.cs): `src/ReadManager.Api/Data/AppDbContext.cs`
- **MySQL database**

### Other components

- **Reader**
- **Administrator**

## Connections

- Reader → Mobile screens: uses
- Mobile screens → Mobile reading state: binds to
- Mobile reading state → Mobile API services: requests data
- Mobile API services → Mobile HTTP client: sends requests (evidence: `src/ReadManager.Mobile/Services/StoryService.cs`)
- Mobile authentication → Mobile HTTP client: posts credentials (evidence: `src/ReadManager.Mobile/Services/Auth/AuthService.cs`)
- Mobile HTTP client → Story endpoints: HTTP API
- Mobile HTTP client → Authentication endpoints: HTTP API
- Reader → Web reader pages: reads
- Home and discovery → Web API client: requests catalog (evidence: `src/ReadManager.Web/Controllers/HomeController.cs`)
- Web reader pages → Web API client: requests stories (evidence: `src/ReadManager.Web/Controllers/StoriesController.cs`)
- Web accounts → Web auth client: calls auth API (evidence: `src/ReadManager.Web/Controllers/AccountController.cs`)
- Administrator → Story administration: manages stories
- Administrator → Genre administration: manages genres
- Story administration → Web API client: calls API (evidence: `src/ReadManager.Web/Areas/Admin/Controllers/StoriesController.cs`)
- Genre administration → Web API client: calls API (evidence: `src/ReadManager.Web/Areas/Admin/Controllers/GenresController.cs`)
- Import preview → Story administration: provides preview base (evidence: `src/ReadManager.Web/Areas/Admin/Controllers/StoriesController.cs`)
- Web API client → Story endpoints: HTTP API
- Web API client → Chapter endpoints: HTTP API (evidence: `src/ReadManager.Web/Services/StoriesApiClient.cs`)
- Web auth client → Authentication endpoints: HTTP API (evidence: `src/ReadManager.Web/Services/AuthApiClient.cs`)
- Story endpoints → Story domain service: delegates to (evidence: `src/ReadManager.Api/Controllers/StoriesController.cs`)
- Chapter endpoints → Chapter domain service: delegates to (evidence: `src/ReadManager.Api/Controllers/ChaptersController.cs`)
- Authentication endpoints → Authentication logic: delegates to (evidence: `src/ReadManager.Api/Controllers/AuthController.cs`)
- Chapter domain service → Chapter file reader: uses (evidence: `src/ReadManager.Api/Services/ChapterService.cs`)
- Story domain service → EF data context: queries data
- Chapter domain service → EF data context: reads and writes (evidence: `src/ReadManager.Api/Services/ChapterService.cs`)
- Authentication logic → EF data context: reads and writes (evidence: `src/ReadManager.Api/Services/AuthService.cs`)
- Bearer session validation → EF data context: checks user (evidence: `src/ReadManager.Api/Authentication/ApiSessionHandler.cs`)
- Genre service → EF data context: uses data
- EF data context → MySQL database: persists entities
- API hosting → EF data context: configures (evidence: `src/ReadManager.Api/Program.cs`)
- API hosting → Bearer session validation: registers (evidence: `src/ReadManager.Api/Program.cs`)
- API hosting → Story domain service: registers
- API hosting → Chapter domain service: registers (evidence: `src/ReadManager.Api/Program.cs`)
