Antigravity bf31effd36 fix: preserve and render EPUB images via dynamic server endpoint (#65)
Fixes #64

### Summary of Changes
1. **Extended `IEpubReader` & `EpubReaderService`**: Added `GetEpubResourceAsync` to handle binary data extraction of static assets (like images) from the EPUB archive.
2. **Added Client-Side HTTP Call**: Extended `WasmEpubService` to retrieve static resources from the server using the API client.
3. **Preserved and Sanitized Images**: Updated `ExtractParagraphs` and `SanitizeParagraph` to treat `<img>` tags as first-class citizens, preserving their `src` attributes and excluding them from sanitization stripping.
4. **Dynamic URL Rewriting**: Introduced a relative-to-absolute path resolution algorithm (`ResolveRelativePath`) and rewrote image `src` attributes to use the dynamic endpoint `/api/epub/{ebookId}/resource?path=...`.
5. **Registered API Resource Serving Endpoint**: Added the `/api/epub/{ebookId:guid}/resource` minimal API endpoint in `Program.cs` that maps requests directly to `GetEpubResourceAsync` and returns files with the correct MIME type.
6. **Added Unit Tests**: Created `EpubReaderServiceTests.cs` to verify all image extraction, path resolution, and sanitization/rewriting rules. All tests pass successfully.

---------

Co-authored-by: Marek Jasiński <jasins.marek@gmail.com>
Reviewed-on: #65
Co-authored-by: Antigravity <antigravity@google.com>
Co-committed-by: Antigravity <antigravity@google.com>
2026-06-01 16:04:56 +00:00
2026-05-25 14:02:56 +02:00

📖 Nexus Reader

Nexus Reader is a state-of-the-art, cross-platform Blazor .NET 10 immersive e-book reader, powered by Native AOT, Clean Architecture, CQRS, and interactive D3.js Relationship Graphs built on vector-based AI semantics.


Features & Architecture Highlights

📁 Ingestion & Description persistence

  • Extracted and persistent book descriptions from EPUB package metadata during book ingestion.
  • The Description field propagates cleanly from the Ebook entity through Mapster to LastReadBookDto and UserProfileDto.
  • Implemented deep-link route activation: /reader/{bookId}?chapter=N.
  • Allows instant resume of reading session coordinates and loads the specific chapter chapter directly via URL query parameters.

🛡️ Downstream AI Resilience

  • Standard resilience engine in DependencyInjection.cs utilizing the Polly package (ai-retry).
  • Automatically intercepts, handles, and retries on both rate-limits (429 Too Many Requests) and downstream capacity overloads (503 ServiceUnavailable / high demand).

⚙️ Concurrent Request Deduplication

  • Multi-client InteractiveAuto Blazor circuit synchronization is backed by a thread-safe active task registry in KnowledgeService which ensures that identical concurrent requests await a single shared task instance, eliminating redundant LLM queries.

🛠️ Build & Verification Gate

Ensure the dotnet workload matches the active SDK, and compile the full solution utilizing:

dotnet build NexusReader.slnx --no-restore

Run test suite:

dotnet test --no-restore
S
Description
No description provided
Readme 16 MiB
Languages
C# 46.2%
HTML 25.8%
CSS 23%
JavaScript 4.1%
Shell 0.8%
Other 0.1%