# ashahin1/lightnotepad architecture

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

- Interactive diagram: https://gitdiagram.com/ashahin1/lightnotepad
- Repository: https://github.com/ashahin1/lightnotepad

## Overview

LightNotePad is a native Windows text editor. The main workflow is launching with files (or opening them through the UI), routing each file to a tab, editing in RichEdit, and saving while preserving encoding and line endings. The graph also includes documented syntax highlighting, search/printing, tab recovery, and Windows integration. Some capabilities are documented but their implementations were not sampled, so those are represented within the owning application component without speculative call edges.

Main entry points: [`src/app_window.cpp`](https://github.com/ashahin1/lightnotepad/blob/main/src/app_window.cpp) (Window and Workflows), [`src/editor_tab.cpp`](https://github.com/ashahin1/lightnotepad/blob/main/src/editor_tab.cpp) (Document Editor), [`src/main.cpp`](https://github.com/ashahin1/lightnotepad/blob/main/src/main.cpp) (Application Entry), [`src/file_io.cpp`](https://github.com/ashahin1/lightnotepad/blob/main/src/file_io.cpp) (File Encoding I/O)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and Window"]
  node_entry["Application Entry<br/>[main.cpp]"]
  node_window["Window and Workflows<br/>[app_window.cpp]"]
end

subgraph group_documents["Documents and Editing"]
  node_editor["Document Editor<br/>[editor_tab.cpp]"]
  node_file_io["File Encoding I/O<br/>[file_io.cpp]"]
  node_formats["Format Catalog"]
  node_path_lookup["Path Lookup"]
  node_syntax["Syntax Tokenizer"]
  node_context_helper["Context Menu Rules"]
end

subgraph group_presentation["Editor Presentation"]
  node_tabs["Tab Strip<br/>[tab_bar.cpp]"]
  node_status["Status Display<br/>[status_bar.cpp]"]
  node_tab_helpers["Tab Strip Helpers"]
end

subgraph group_windows["Windows Features"]
  node_shortcuts["Shortcut Dialog"]
  node_os_services["Windows Services"]
end

node_user(("User"))
node_windows_shell["Windows Shell"]

node_user -->|"launches"| node_entry
node_windows_shell -->|"opens files"| node_entry
node_entry -->|"creates window"| node_window
node_window -->|"manages tabs"| node_editor
node_window -->|"builds filters"| node_formats
node_window -->|"checks paths"| node_path_lookup
node_window -->|"updates tabs"| node_tabs
node_window -->|"updates status"| node_status
node_editor -->|"loads and saves"| node_file_io
node_editor -->|"tokenizes text"| node_syntax
node_editor -->|"computes menu flags"| node_context_helper
node_window -.->|"integrates shell and registry"| node_os_services
node_user -->|"edits and prints"| node_window

click node_entry "https://github.com/ashahin1/lightnotepad/blob/main/src/main.cpp"
click node_window "https://github.com/ashahin1/lightnotepad/blob/main/src/app_window.cpp"
click node_editor "https://github.com/ashahin1/lightnotepad/blob/main/src/editor_tab.cpp"
click node_file_io "https://github.com/ashahin1/lightnotepad/blob/main/src/file_io.cpp"
click node_formats "https://github.com/ashahin1/lightnotepad/blob/main/src/supported_formats.hpp"
click node_path_lookup "https://github.com/ashahin1/lightnotepad/blob/main/src/path_lookup_helper.hpp"
click node_syntax "https://github.com/ashahin1/lightnotepad/blob/main/src/syntax_highlighter.cpp"
click node_context_helper "https://github.com/ashahin1/lightnotepad/blob/main/src/editor_context_menu_helper.hpp"
click node_tabs "https://github.com/ashahin1/lightnotepad/blob/main/src/tab_bar.cpp"
click node_status "https://github.com/ashahin1/lightnotepad/blob/main/src/status_bar.cpp"
click node_tab_helpers "https://github.com/ashahin1/lightnotepad/blob/main/src/tab_strip_helper.hpp"
click node_shortcuts "https://github.com/ashahin1/lightnotepad/blob/main/src/shortcuts_dialog.cpp"

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_entry,node_window,node_user toneBlue
class node_editor,node_file_io,node_formats,node_path_lookup,node_syntax,node_context_helper toneAmber
class node_tabs,node_status,node_tab_helpers toneMint
class node_shortcuts,node_os_services toneRose
class node_windows_shell toneIndigo
```

## Components

### Startup and Window

- [Application Entry](https://github.com/ashahin1/lightnotepad/blob/main/src/main.cpp): `src/main.cpp`
- [Window and Workflows](https://github.com/ashahin1/lightnotepad/blob/main/src/app_window.cpp): `src/app_window.cpp`

### Documents and Editing

- [Document Editor](https://github.com/ashahin1/lightnotepad/blob/main/src/editor_tab.cpp): `src/editor_tab.cpp`
- [File Encoding I/O](https://github.com/ashahin1/lightnotepad/blob/main/src/file_io.cpp): `src/file_io.cpp`
- [Format Catalog](https://github.com/ashahin1/lightnotepad/blob/main/src/supported_formats.hpp): `src/supported_formats.hpp`
- [Path Lookup](https://github.com/ashahin1/lightnotepad/blob/main/src/path_lookup_helper.hpp): `src/path_lookup_helper.hpp`
- [Syntax Tokenizer](https://github.com/ashahin1/lightnotepad/blob/main/src/syntax_highlighter.cpp): `src/syntax_highlighter.cpp`
- [Context Menu Rules](https://github.com/ashahin1/lightnotepad/blob/main/src/editor_context_menu_helper.hpp): `src/editor_context_menu_helper.hpp`

### Editor Presentation

- [Tab Strip](https://github.com/ashahin1/lightnotepad/blob/main/src/tab_bar.cpp): `src/tab_bar.cpp`
- [Status Display](https://github.com/ashahin1/lightnotepad/blob/main/src/status_bar.cpp): `src/status_bar.cpp`
- [Tab Strip Helpers](https://github.com/ashahin1/lightnotepad/blob/main/src/tab_strip_helper.hpp): `src/tab_strip_helper.hpp`

### Windows Features

- [Shortcut Dialog](https://github.com/ashahin1/lightnotepad/blob/main/src/shortcuts_dialog.cpp): `src/shortcuts_dialog.cpp`
- **Windows Services**

### Other components

- **User**
- **Windows Shell**

## Connections

- User → Application Entry: launches (evidence: `README.md`)
- Windows Shell → Application Entry: opens files (evidence: `README.md`)
- Application Entry → Window and Workflows: creates window (evidence: `src/main.cpp`)
- Window and Workflows → Document Editor: manages tabs (evidence: `src/app_window.cpp`)
- Window and Workflows → Format Catalog: builds filters (evidence: `src/app_window.cpp`)
- Window and Workflows → Path Lookup: checks paths (evidence: `src/app_window.cpp`)
- Window and Workflows → Tab Strip: updates tabs (evidence: `src/app_window.cpp`)
- Window and Workflows → Status Display: updates status (evidence: `src/app_window.cpp`)
- Document Editor → File Encoding I/O: loads and saves (evidence: `src/editor_tab.cpp`)
- Document Editor → Syntax Tokenizer: tokenizes text (evidence: `src/editor_tab.cpp`)
- Document Editor → Context Menu Rules: computes menu flags (evidence: `src/editor_tab.cpp`)
- Window and Workflows → Windows Services: integrates shell and registry (evidence: `README.md`)
- User → Window and Workflows: edits and prints (evidence: `README.md`)
