# bhavykhatri/dharmicdata architecture

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

- Interactive diagram: https://gitdiagram.com/bhavykhatri/dharmicdata
- Repository: https://github.com/bhavykhatri/dharmicdata

## Overview

Dharmic Data combines a structured sacred-text corpus with a web reader. The principal user journey is discovering a text, opening a section, and reading its verses; the app also offers search, bookmarks, reading progress, and verse sharing. The README documents the corpus’s major text collections, while the sampled web code confirms home-page widgets, local reading state, and transliteration-assisted search. Some routes and data-loading details were not excerpted, so their connections are omitted rather than inferred.

Main entry points: [`web/app/read/[text]/[unit]/page.tsx`](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/read/%5Btext%5D/%5Bunit%5D/page.tsx) (Section Reader), [`web/components/home-widgets.tsx`](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/home-widgets.tsx) (Daily and Progress), [`web/app/page.tsx`](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/page.tsx) (Home Dashboard), [`web/components/search-client.tsx`](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/search-client.tsx) (Text Search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Reader Experience"]
  node_reader["Reader<br/>[layout.tsx]"]
  node_home["Home Dashboard<br/>[page.tsx]"]
  node_library["Text Library<br/>[page.tsx]"]
  node_text_index["Text Sections<br/>[page.tsx]"]
  node_unit_reader["Section Reader<br/>[page.tsx]"]
  node_home_widgets["Daily and Progress<br/>[home-widgets.tsx]"]
end

subgraph group_corpus["Sacred Text Corpus"]
  node_text_catalog["Text Catalog<br/>[texts.ts]"]
  node_gita_data[("Bhagavad Gita")]
  node_mahabharata_data[("Mahabharata")]
  node_ramayana_data[("Valmiki Ramayana")]
  node_ramcharitmanas_data[("Ramcharitmanas")]
  node_veda_data[("Vedas")]
  node_other_text_data[("Other Text Data")]
end

subgraph group_state["Reader State"]
  node_local_state[("Local Reading State<br/>[store.ts]")]
  node_bookmarks["Saved Verses<br/>[page.tsx]"]
end

subgraph group_discovery["Search and Sharing"]
  node_search["Text Search<br/>[search-client.tsx]"]
  node_query_tools["Query Variants<br/>[query.ts]"]
  node_share_image["Verse Image Sharing<br/>[share-image.tsx]"]
  node_verse_actions["Verse Actions<br/>[verse-actions.tsx]"]
end

node_reader_user(("Reader"))

node_home -->|"reads catalog"| node_text_catalog
node_home -->|"renders widgets"| node_home_widgets
node_home_widgets -->|"reads progress"| node_local_state
node_home_widgets -->|"looks up text"| node_text_catalog
node_home_widgets -->|"renders sharing"| node_verse_actions
node_home_widgets -->|"renders image action"| node_share_image
node_bookmarks -->|"reads and updates"| node_local_state
node_search -->|"expands queries"| node_query_tools
node_search -->|"uses text filters"| node_text_catalog
node_reader_user -.->|"opens"| node_home
node_reader_user -.->|"chooses text"| node_library
node_reader_user -.->|"searches texts"| node_search
node_library -.->|"opens text"| node_text_index
node_text_index -.->|"opens section"| node_unit_reader
node_unit_reader -.->|"reads verses"| node_gita_data
node_unit_reader -.->|"reads verses"| node_mahabharata_data
node_unit_reader -.->|"reads verses"| node_ramayana_data
node_unit_reader -.->|"reads verses"| node_ramcharitmanas_data
node_unit_reader -.->|"reads verses"| node_veda_data
node_unit_reader -.->|"reads verses"| node_other_text_data

click node_reader "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/layout.tsx"
click node_home "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/page.tsx"
click node_library "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/library/page.tsx"
click node_text_index "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/read/%5Btext%5D/page.tsx"
click node_unit_reader "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/read/%5Btext%5D/%5Bunit%5D/page.tsx"
click node_home_widgets "https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/home-widgets.tsx"
click node_text_catalog "https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/texts.ts"
click node_gita_data "https://github.com/bhavykhatri/dharmicdata/tree/main/SrimadBhagvadGita"
click node_mahabharata_data "https://github.com/bhavykhatri/dharmicdata/tree/main/Mahabharata"
click node_ramayana_data "https://github.com/bhavykhatri/dharmicdata/tree/main/ValmikiRamayana"
click node_ramcharitmanas_data "https://github.com/bhavykhatri/dharmicdata/tree/main/Ramcharitmanas"
click node_veda_data "https://github.com/bhavykhatri/dharmicdata/tree/main/AtharvaVeda"
click node_other_text_data "https://github.com/bhavykhatri/dharmicdata/tree/main/Rigveda"
click node_local_state "https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/store.ts"
click node_bookmarks "https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/bookmarks/page.tsx"
click node_search "https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/search-client.tsx"
click node_query_tools "https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/query.ts"
click node_share_image "https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/share-image.tsx"
click node_verse_actions "https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/verse-actions.tsx"

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_home,node_library,node_text_index,node_unit_reader,node_home_widgets toneBlue
class node_text_catalog,node_gita_data,node_mahabharata_data,node_ramayana_data,node_ramcharitmanas_data,node_veda_data,node_other_text_data toneAmber
class node_local_state,node_bookmarks toneMint
class node_search,node_query_tools,node_share_image,node_verse_actions toneRose
class node_reader_user toneIndigo
```

## Components

### Reader Experience

- [Reader](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/layout.tsx): `web/app/layout.tsx`
- [Home Dashboard](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/page.tsx): `web/app/page.tsx`
- [Text Library](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/library/page.tsx): `web/app/library/page.tsx`
- [Text Sections](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/read/%5Btext%5D/page.tsx): `web/app/read/[text]/page.tsx`
- [Section Reader](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/read/%5Btext%5D/%5Bunit%5D/page.tsx): `web/app/read/[text]/[unit]/page.tsx`
- [Daily and Progress](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/home-widgets.tsx): `web/components/home-widgets.tsx`

### Sacred Text Corpus

- [Text Catalog](https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/texts.ts): `web/lib/texts.ts`
- [Bhagavad Gita](https://github.com/bhavykhatri/dharmicdata/tree/main/SrimadBhagvadGita): `SrimadBhagvadGita`
- [Mahabharata](https://github.com/bhavykhatri/dharmicdata/tree/main/Mahabharata): `Mahabharata`
- [Valmiki Ramayana](https://github.com/bhavykhatri/dharmicdata/tree/main/ValmikiRamayana): `ValmikiRamayana`
- [Ramcharitmanas](https://github.com/bhavykhatri/dharmicdata/tree/main/Ramcharitmanas): `Ramcharitmanas`
- [Vedas](https://github.com/bhavykhatri/dharmicdata/tree/main/AtharvaVeda): `AtharvaVeda`
- [Other Text Data](https://github.com/bhavykhatri/dharmicdata/tree/main/Rigveda): `Rigveda`

### Reader State

- [Local Reading State](https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/store.ts): `web/lib/store.ts`
- [Saved Verses](https://github.com/bhavykhatri/dharmicdata/blob/main/web/app/bookmarks/page.tsx): `web/app/bookmarks/page.tsx`

### Search and Sharing

- [Text Search](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/search-client.tsx): `web/components/search-client.tsx`
- [Query Variants](https://github.com/bhavykhatri/dharmicdata/blob/main/web/lib/query.ts): `web/lib/query.ts`
- [Verse Image Sharing](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/share-image.tsx): `web/components/share-image.tsx`
- [Verse Actions](https://github.com/bhavykhatri/dharmicdata/blob/main/web/components/verse-actions.tsx): `web/components/verse-actions.tsx`

### Other components

- **Reader**

## Connections

- Home Dashboard → Text Catalog: reads catalog (evidence: `web/app/page.tsx`)
- Home Dashboard → Daily and Progress: renders widgets (evidence: `web/app/page.tsx`)
- Daily and Progress → Local Reading State: reads progress (evidence: `web/components/home-widgets.tsx`)
- Daily and Progress → Text Catalog: looks up text (evidence: `web/components/home-widgets.tsx`)
- Daily and Progress → Verse Actions: renders sharing (evidence: `web/components/home-widgets.tsx`)
- Daily and Progress → Verse Image Sharing: renders image action (evidence: `web/components/home-widgets.tsx`)
- Saved Verses → Local Reading State: reads and updates (evidence: `web/app/bookmarks/page.tsx`)
- Text Search → Query Variants: expands queries (evidence: `web/components/search-client.tsx`)
- Text Search → Text Catalog: uses text filters (evidence: `web/components/search-client.tsx`)
- Reader → Home Dashboard: opens
- Reader → Text Library: chooses text
- Reader → Text Search: searches texts
- Text Library → Text Sections: opens text
- Text Sections → Section Reader: opens section
- Section Reader → Bhagavad Gita: reads verses
- Section Reader → Mahabharata: reads verses
- Section Reader → Valmiki Ramayana: reads verses
- Section Reader → Ramcharitmanas: reads verses
- Section Reader → Vedas: reads verses
- Section Reader → Other Text Data: reads verses
