# codeshreya32/ece244-book architecture

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

- Interactive diagram: https://gitdiagram.com/codeshreya32/ece244-book
- Repository: https://github.com/codeshreya32/ece244-book

## Overview

Khufu is an online C++ programming textbook. Its main workflow is authors maintaining MyST chapter content, which Jupyter Book turns into a book for learners. A separate semantic-search workflow extracts text from rendered chapter HTML, generates embeddings and location metadata, and saves them as JSON; the README describes copying those outputs into the built site. The excerpts do not show the semantic-search query implementation or its runtime data loading, so those links are omitted. Major chapter topics are grouped together rather than expanded into individual lessons.

Main entry points: [`embeddings/generate.py`](https://github.com/codeshreya32/ece244-book/blob/main/embeddings/generate.py) (HTML Extraction), [`textbook/chapters`](https://github.com/codeshreya32/ece244-book/tree/main/textbook/chapters) (Course Chapters), [`embeddings/outputs`](https://github.com/codeshreya32/ece244-book/tree/main/embeddings/outputs) (Search JSON Data), [`textbook`](https://github.com/codeshreya32/ece244-book/tree/main/textbook) (Online Textbook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_book["Textbook"]
  node_chapters["Course Chapters"]
  node_book_site["Online Textbook"]
end

subgraph group_search["Semantic Search"]
  node_search_page["Search Page<br/>[semantic-search.md]"]
  node_html_extract["HTML Extraction<br/>[generate.py]"]
  node_embedding_model["Embedding Generation<br/>[generate.py]"]
  node_search_data[("Search JSON Data")]
  node_timing["Timing Decorator<br/>[func_time.py]"]
  node_highlight["Result Highlighting"]
end

subgraph group_examples["Code Examples"]
  node_examples_code["C++ Examples"]
end

node_authors(("Authors"))
node_readers(("Learners"))

node_authors -->|"write content"| node_chapters
node_chapters -->|"build book"| node_book_site
node_readers -->|"read"| node_book_site
node_html_extract -->|"provide text"| node_embedding_model
node_embedding_model -->|"save embeddings"| node_search_data
node_html_extract -->|"save locations"| node_search_data
node_html_extract -->|"uses decorator"| node_timing
node_chapters -->|"render before indexing"| node_html_extract
node_search_data -->|"copy search outputs"| node_book_site

click node_chapters "https://github.com/codeshreya32/ece244-book/tree/main/textbook/chapters"
click node_book_site "https://github.com/codeshreya32/ece244-book/tree/main/textbook"
click node_examples_code "https://github.com/codeshreya32/ece244-book/tree/main/textbook/code"
click node_search_page "https://github.com/codeshreya32/ece244-book/blob/main/textbook/semantic-search.md"
click node_html_extract "https://github.com/codeshreya32/ece244-book/blob/main/embeddings/generate.py"
click node_embedding_model "https://github.com/codeshreya32/ece244-book/blob/main/embeddings/generate.py"
click node_search_data "https://github.com/codeshreya32/ece244-book/tree/main/embeddings/outputs"
click node_timing "https://github.com/codeshreya32/ece244-book/blob/main/embeddings/func_time.py"
click node_highlight "https://github.com/codeshreya32/ece244-book/blob/main/textbook/_static/highlight_scroll.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_chapters,node_book_site toneBlue
class node_search_page,node_html_extract,node_embedding_model,node_search_data,node_timing,node_highlight toneAmber
class node_examples_code toneMint
class node_authors,node_readers toneIndigo
```

## Components

### Textbook

- [Course Chapters](https://github.com/codeshreya32/ece244-book/tree/main/textbook/chapters): `textbook/chapters`
- [Online Textbook](https://github.com/codeshreya32/ece244-book/tree/main/textbook): `textbook`

### Semantic Search

- [Search Page](https://github.com/codeshreya32/ece244-book/blob/main/textbook/semantic-search.md): `textbook/semantic-search.md`
- [HTML Extraction](https://github.com/codeshreya32/ece244-book/blob/main/embeddings/generate.py): `embeddings/generate.py`
- [Embedding Generation](https://github.com/codeshreya32/ece244-book/blob/main/embeddings/generate.py): `embeddings/generate.py`
- [Search JSON Data](https://github.com/codeshreya32/ece244-book/tree/main/embeddings/outputs): `embeddings/outputs`
- [Timing Decorator](https://github.com/codeshreya32/ece244-book/blob/main/embeddings/func_time.py): `embeddings/func_time.py`
- [Result Highlighting](https://github.com/codeshreya32/ece244-book/blob/main/textbook/_static/highlight_scroll.js): `textbook/_static/highlight_scroll.js`

### Code Examples

- [C++ Examples](https://github.com/codeshreya32/ece244-book/tree/main/textbook/code): `textbook/code`

### Other components

- **Authors**
- **Learners**

## Connections

- Authors → Course Chapters: write content (evidence: `README.md`)
- Course Chapters → Online Textbook: build book (evidence: `README.md`)
- Learners → Online Textbook: read (evidence: `README.md`)
- HTML Extraction → Embedding Generation: provide text (evidence: `embeddings/generate.py`)
- Embedding Generation → Search JSON Data: save embeddings (evidence: `embeddings/generate.py`)
- HTML Extraction → Search JSON Data: save locations (evidence: `embeddings/generate.py`)
- HTML Extraction → Timing Decorator: uses decorator (evidence: `embeddings/generate.py`)
- Course Chapters → HTML Extraction: render before indexing (evidence: `README.md`)
- Search JSON Data → Online Textbook: copy search outputs (evidence: `README.md`)
