$ show Anxcye/anx-reader
Anx Reader is a cross-platform e-book reader application built with Flutter and Dart. It supports a wide range of formats (EPUB, MOBI, PDF, TXT, FB2, CBZ) by leveraging a forked version of the foliate-js JavaScript library as its core rendering engine, served by an embedded Dart HTTP server and displayed in a platform-abstracted WebView widget. This architecture, while functional, creates a hard dependency on a complex external JavaScript project and a Dart HTTP server for what is fundamentally a local file reader. The application follows a monolithic architecture with a strong emphasis on clean separation of concerns. It uses Riverpod for reactive state management, a service layer for business logic (AI, TTS, Sync, Translation), and a widget layer for UI composition. The codebase is notable for its extensive use of design patterns like Registry (for AI tools and dashboard tiles), Adapter (for platform-specific WebViews and TTS backends), and Repository (for AI tool data access). The Dart code itself is well-structured and demonstrates professional Flutter development practices. Beyond basic reading, it features deep AI integration (chat, summarization, content analysis via configurable providers), text-to-speech with multiple backends, WebDAV synchronization, a customizable statistics dashboard, and a full annotation system. The project is actively maintained with a sophisticated CI/CD pipeline targeting Windows, macOS, Linux, Android, iOS, and OpenHarmony. The Dart code demonstrates high craftsmanship, particularly in the AI tool framework, the dashboard tile system, and the platform abstraction layers. These components are well-isolated and could be extracted for reuse in other Dart projects. The primary risk is the tight coupling to the external foliate-js JavaScript engine and the reliance on multiple third-party AI and TTS APIs, which introduces external dependency risk and potential for API drift.
The LLM identified 5 files worth highlighting for reuse:
Implements a dynamic registry for AI-callable tools. The AiToolRegistry allows tools to be registered with their schema, builder, and context injector. The RepositoryTool<I, O> base class provides a robust template for tool execution with timeout, error handling, and serialization. This pattern is cleanly extensible and could be reused in any Dart project requiring structured tool execution for LLMs.
Provides an extensible framework for a customizable statistics dashboard. The DashboardTileRegistry allows tiles to be registered and dynamically composed into a grid. The DashboardTileBase abstract class defines a clean interface for tile rendering, editing, and interaction. This is a highly reusable pattern for any application needing a configurable dashboard.
A comprehensive Dart implementation of the WebDAV protocol (RFC 4918). It handles PROPFIND, MKCOL, GET, PUT, DELETE, and locking. It is self-contained and could be extracted into a standalone Dart package for any project needing WebDAV client capabilities.
A utility for parsing structured reasoning output from AI models, specifically handling think tags and tool call blocks from a streaming text response. It demonstrates a clean approach to extracting structured data from unstructured LLM output, a common problem in AI engineering.
An abstract controller that provides a platform-agnostic interface for the EPUB WebView. It abstracts away the differences between the default InAppWebView implementation and the Linux CEF implementation, allowing the core reading logic to remain platform-independent. A textbook example of the Adapter pattern.