# bres777/notes-index-test architecture

> Architecture diagram of the GitHub repository bres777/notes-index-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bres777/notes-index-test
- Repository: https://github.com/bres777/notes-index-test

## Overview

notes-index is a small two-command Markdown note indexer and search tool. The index workflow scans a folder, reads and parses each note, extracts searchable words, then writes an index file. The search workflow reads and validates only that index, answers one word, tag, or link-target query, and prints matches and remarks. The README documents the separate file-mediated commands; source excerpts confirm their module calls. Sample notes and tests are not runtime components.

Main entry points: [`src/build-index.js`](https://github.com/bres777/notes-index-test/blob/main/src/build-index.js) (Build index), [`src/cli.js`](https://github.com/bres777/notes-index-test/blob/main/src/cli.js) (Index CLI), [`src/search-cli.js`](https://github.com/bres777/notes-index-test/blob/main/src/search-cli.js) (Search CLI), [`src/search.js`](https://github.com/bres777/notes-index-test/blob/main/src/search.js) (Query engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_indexing["Index building"]
  node_indexer["Index CLI<br/>[cli.js]"]
  node_builder["Build index<br/>[build-index.js]"]
  node_scanner["Note scanner<br/>[scan.js]"]
  node_parser["Note parser<br/>[parse-note.js]"]
  node_words["Word extractor<br/>[extract-words.js]"]
end

subgraph group_searching["Index search"]
  node_searcher["Search CLI<br/>[search-cli.js]"]
  node_loader["Index loader<br/>[load-index.js]"]
  node_search["Query engine<br/>[search.js]"]
end

node_indexfile["Index file"]

node_indexer -->|"builds via"| node_builder
node_builder -->|"scans with"| node_scanner
node_builder -->|"parses notes"| node_parser
node_builder -->|"indexes words"| node_words
node_indexer -->|"writes"| node_indexfile
node_indexfile -->|"reads"| node_loader
node_searcher -->|"loads via"| node_loader
node_searcher -->|"queries"| node_search
node_search -->|"tokenizes query"| node_words

click node_indexer "https://github.com/bres777/notes-index-test/blob/main/src/cli.js"
click node_builder "https://github.com/bres777/notes-index-test/blob/main/src/build-index.js"
click node_scanner "https://github.com/bres777/notes-index-test/blob/main/src/scan.js"
click node_parser "https://github.com/bres777/notes-index-test/blob/main/src/parse-note.js"
click node_words "https://github.com/bres777/notes-index-test/blob/main/src/extract-words.js"
click node_searcher "https://github.com/bres777/notes-index-test/blob/main/src/search-cli.js"
click node_loader "https://github.com/bres777/notes-index-test/blob/main/src/load-index.js"
click node_search "https://github.com/bres777/notes-index-test/blob/main/src/search.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_indexer,node_builder,node_scanner,node_parser,node_words toneBlue
class node_searcher,node_loader,node_search toneAmber
class node_indexfile toneIndigo
```

## Components

### Index building

- [Index CLI](https://github.com/bres777/notes-index-test/blob/main/src/cli.js): `src/cli.js`
- [Build index](https://github.com/bres777/notes-index-test/blob/main/src/build-index.js): `src/build-index.js`
- [Note scanner](https://github.com/bres777/notes-index-test/blob/main/src/scan.js): `src/scan.js`
- [Note parser](https://github.com/bres777/notes-index-test/blob/main/src/parse-note.js): `src/parse-note.js`
- [Word extractor](https://github.com/bres777/notes-index-test/blob/main/src/extract-words.js): `src/extract-words.js`

### Index search

- [Search CLI](https://github.com/bres777/notes-index-test/blob/main/src/search-cli.js): `src/search-cli.js`
- [Index loader](https://github.com/bres777/notes-index-test/blob/main/src/load-index.js): `src/load-index.js`
- [Query engine](https://github.com/bres777/notes-index-test/blob/main/src/search.js): `src/search.js`

### Other components

- **Index file**

## Connections

- Index CLI → Build index: builds via (evidence: `src/cli.js`)
- Build index → Note scanner: scans with (evidence: `src/build-index.js`)
- Build index → Note parser: parses notes (evidence: `src/build-index.js`)
- Build index → Word extractor: indexes words (evidence: `src/build-index.js`)
- Index CLI → Index file: writes (evidence: `README.md`)
- Index file → Index loader: reads (evidence: `README.md`)
- Search CLI → Index loader: loads via (evidence: `src/search-cli.js`)
- Search CLI → Query engine: queries (evidence: `src/search-cli.js`)
- Query engine → Word extractor: tokenizes query (evidence: `src/search.js`)
