Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [Local Model Support](#-local-model-support)
- [Universal File Import](#-universal-file-import)
- [Academic Citations](#-academic-citations)
- [Architecture](#-architecture)
- [Technical Documentation](#-technical-documentation)
- [Contributing](#-contributing)

Expand Down Expand Up @@ -132,6 +133,57 @@ Markdown Reader preserves citation syntax during editing and export, including H

---

## 🏗️ Architecture

Markdown Reader consists of a Next.js / React interface, a Tauri desktop host, and a local FastAPI service. The diagrams below summarize the five high-level views from the [interactive Architecture Explorer](./docs/architecture/index.html). They are simplified architectural maps rather than exhaustive function-call traces.

### 01 · System Overview

The desktop interface communicates with native Tauri capabilities and the Python backend. Document storage stays local; model requests can reach a configured cloud or local provider.

![system overview architecture diagram](./docs/architecture/system-overview.svg)

### 02 · Frontend Modules

The page composes the editor, feature panels, and stateful hooks. Panels and hooks use the typed API client for backend requests.

![frontend modules architecture diagram](./docs/architecture/frontend-modules.svg)

### 03 · Backend Modules

FastAPI registers routers for the main feature areas. Each router delegates work to the relevant domain implementation.

![backend modules architecture diagram](./docs/architecture/backend-modules.svg)

### 04 · AI Chat Request Flow

The chat panel passes a message through the React hook and typed client to the FastAPI AI endpoint, which delegates to the configured model provider.

![ai chat request flow architecture diagram](./docs/architecture/ai-chat-request-flow.svg)

In the packaged desktop app, API requests traverse the Tauri request proxy; the arrow from the client to the router abstracts that transport step.

### 05 · Desktop Runtime

In packaged builds, Tauri launches and supervises the Python sidecar. The Rust host retains the backend connection details and forwards authenticated requests from the WebView.

![desktop runtime architecture diagram](./docs/architecture/desktop-runtime.svg)

### Generate and Open the Interactive Architecture Explorer

These README diagrams provide an at-a-glance overview. To regenerate the source-scanned interactive explorer from your current checkout, run the following commands **from the repository root**:

```bash
python3 tools/generate_architecture.py
open docs/architecture/index.html
```

The generator writes `docs/architecture/index.html`; the `open` command opens that file on macOS. On Linux, use `xdg-open docs/architecture/index.html`; on Windows, use `start docs/architecture/index.html`.

The explorer supports zooming, panning, node inspection, and exporting a selected view as SVG. Its source-derived function views may vary as the code changes. The five static SVG diagrams embedded above are maintained in `docs/architecture/` and do **not** update automatically when the generator is run.

---

## 📖 Technical Documentation

For advanced and implementation details, see [Technical Documentation](./docs/TECHNICAL.md). It covers:
Expand Down
10 changes: 10 additions & 0 deletions docs/architecture/ai-chat-request-flow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/architecture/backend-modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/architecture/desktop-runtime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions docs/architecture/frontend-modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading