# moniruzjaman/diagnostic-field-guide architecture

> Architecture diagram of the GitHub repository moniruzjaman/diagnostic-field-guide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/moniruzjaman/diagnostic-field-guide
- Repository: https://github.com/moniruzjaman/diagnostic-field-guide

## Overview

This repository is a Bengali, mobile-first plant-disease field guide delivered as an offline-capable PWA, with interactive diagnostic tools alongside the ebook. The main reader workflow presents the book, supports search and audio, and preserves reader notes and bookmarks locally. Separate tools guide field observations or compare a user photo with reference images. The README documents additional dashboard, handbook, and study features, but their implementing files are absent from the supplied tree; those branches are represented only where an existing source path supports them. Source excerpts are partial, so edges are limited to shown or documented relationships.

Main entry points: [`js/reader.js`](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/reader.js) (Book Reader), [`js/diagnosis-wizard.js`](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/diagnosis-wizard.js) (Diagnosis Wizard), [`sw.js`](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/sw.js) (Offline Cache), [`js/notes.js`](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/notes.js) (Notes & Feedback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reading["Book Reader"]
  node_reader["Book Reader<br/>[reader.js]"]
  node_book["Book Content<br/>[content.js]"]
  node_search["Book Search<br/>[search.js]"]
  node_speech["Bangla TTS<br/>[tts.js]"]
  node_sharing["Sharing<br/>[share.js]"]
end

subgraph group_diagnosis["Field Diagnosis"]
  node_wizard["Diagnosis Wizard"]
  node_field["Field Workbench<br/>[field-diagnosis.js]"]
  node_matcher["Photo Matcher<br/>[symptom-matcher.js]"]
  node_causes["Cause Data Loader<br/>[cause-database.js]"]
  node_voice["Voice Input<br/>[voice-input.js]"]
  node_glossary["Voice Glossary<br/>[voice-glossary.js]"]
end

subgraph group_persistence["Reader Data"]
  node_bookmarks["Bookmarks<br/>[bookmarks.js]"]
  node_notes["Notes &amp; Feedback<br/>[notes.js]"]
end

subgraph group_pwa["Offline PWA"]
  node_serviceworker["Offline Cache<br/>[sw.js]"]
end

node_browser(("Reader"))
node_local[("Browser Storage")]
node_email["Email Client"]

node_browser -->|"opens"| node_reader
node_reader -->|"renders"| node_book
node_reader -->|"offers search"| node_search
node_reader -->|"controls playback"| node_speech
node_reader -->|"opens sharing"| node_sharing
node_browser -->|"opens"| node_wizard
node_wizard -->|"starts input"| node_voice
node_wizard -->|"uses glossary"| node_glossary
node_browser -->|"opens"| node_field
node_field -.->|"matches causes"| node_causes
node_browser -->|"opens"| node_matcher
node_bookmarks -.->|"stores bookmarks"| node_local
node_notes -->|"stores notes"| node_local
node_notes -->|"sends feedback"| node_email
node_reader -->|"registers offline support"| node_serviceworker
node_serviceworker -->|"caches content"| node_book
node_serviceworker -->|"serves offline"| node_browser

click node_reader "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/reader.js"
click node_book "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/content.js"
click node_search "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/search.js"
click node_speech "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/tts.js"
click node_sharing "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/share.js"
click node_wizard "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/diagnosis-wizard.js"
click node_field "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/field-diagnosis.js"
click node_matcher "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/symptom-matcher.js"
click node_causes "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/cause-database.js"
click node_voice "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/voice-input.js"
click node_glossary "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/voice-glossary.js"
click node_bookmarks "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/bookmarks.js"
click node_notes "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/notes.js"
click node_serviceworker "https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/sw.js"

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_reader,node_book,node_search,node_speech,node_sharing,node_email toneBlue
class node_wizard,node_field,node_matcher,node_causes,node_voice,node_glossary,node_local toneAmber
class node_bookmarks,node_notes toneMint
class node_serviceworker toneRose
class node_browser toneIndigo
```

## Components

### Book Reader

- [Book Reader](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/reader.js): `js/reader.js`
- [Book Content](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/content.js): `js/content.js`
- [Book Search](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/search.js): `js/search.js`
- [Bangla TTS](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/tts.js): `js/tts.js`
- [Sharing](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/share.js): `js/share.js`

### Field Diagnosis

- [Diagnosis Wizard](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/diagnosis-wizard.js): `js/diagnosis-wizard.js`
- [Field Workbench](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/field-diagnosis.js): `js/field-diagnosis.js`
- [Photo Matcher](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/symptom-matcher.js): `js/symptom-matcher.js`
- [Cause Data Loader](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/cause-database.js): `js/cause-database.js`
- [Voice Input](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/voice-input.js): `js/voice-input.js`
- [Voice Glossary](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/voice-glossary.js): `js/voice-glossary.js`

### Reader Data

- [Bookmarks](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/bookmarks.js): `js/bookmarks.js`
- [Notes & Feedback](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/js/notes.js): `js/notes.js`

### Offline PWA

- [Offline Cache](https://github.com/moniruzjaman/diagnostic-field-guide/blob/main/sw.js): `sw.js`

### Other components

- **Reader**
- **Browser Storage**
- **Email Client**

## Connections

- Reader → Book Reader: opens (evidence: `README.md`)
- Book Reader → Book Content: renders (evidence: `README.md`)
- Book Reader → Book Search: offers search (evidence: `README.md`)
- Book Reader → Bangla TTS: controls playback (evidence: `js/reader.js`)
- Book Reader → Sharing: opens sharing (evidence: `README.md`)
- Reader → Diagnosis Wizard: opens (evidence: `README.md`)
- Diagnosis Wizard → Voice Input: starts input (evidence: `js/diagnosis-wizard.js`)
- Diagnosis Wizard → Voice Glossary: uses glossary (evidence: `README.md`)
- Reader → Field Workbench: opens (evidence: `README.md`)
- Field Workbench → Cause Data Loader: matches causes
- Reader → Photo Matcher: opens (evidence: `README.md`)
- Bookmarks → Browser Storage: stores bookmarks
- Notes & Feedback → Browser Storage: stores notes (evidence: `js/notes.js`)
- Notes & Feedback → Email Client: sends feedback (evidence: `js/notes.js`)
- Book Reader → Offline Cache: registers offline support (evidence: `README.md`)
- Offline Cache → Book Content: caches content (evidence: `sw.js`)
- Offline Cache → Reader: serves offline (evidence: `sw.js`)
