# unbug/codelf architecture

> Architecture diagram of the GitHub repository unbug/codelf, 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/unbug/codelf
- Repository: https://github.com/unbug/codelf

## Overview

CODELF is a browser-based naming search tool: a user enters a term and optional languages, the app requests code-search results, extracts variable names, and displays them with repository/source-code context. It also documents a daily algorithm copybook and GitHub repository/star organizer. The sampled React code shows the search orchestration and supporting models; the tree and README establish the other capabilities, but their internal wiring was not sampled, so those branches are represented without speculative edges.

Main entry points: [`src/containers/MainContainer.js`](https://github.com/unbug/codelf/blob/master/src/containers/MainContainer.js) (Search controller), [`src/models/SearchCodeModel.js`](https://github.com/unbug/codelf/blob/master/src/models/SearchCodeModel.js) (Search model), [`src/models/DDMSModel.js`](https://github.com/unbug/codelf/blob/master/src/models/DDMSModel.js) (Keyword and organizer service), [`src/App.js`](https://github.com/unbug/codelf/blob/master/src/App.js) (React app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Search interface"]
  node_app["React app<br/>[App.js]"]
  node_main["Search controller<br/>[MainContainer.js]"]
  node_searchbar["Query and filters<br/>[SearchBar.js]"]
  node_results["Variable results<br/>[VariableList.js]"]
  node_source["Source viewer<br/>[SourceCode.js]"]
  node_highlight["Code highlighting"]
  node_suggestions["Suggestions<br/>[Suggestion.js]"]
  node_loading["Loading state<br/>[Loading.js]"]
end

subgraph group_search["Naming search"]
  node_searchmodel["Search model<br/>[SearchCodeModel.js]"]
  node_searchapi{{"Searchcode API"}}
  node_translations["Translation providers"]
  node_resultstore[("Search cache<br/>[Store.js]")]
end

subgraph group_shared["App services"]
  node_appmodel["App state and analytics<br/>[AppModel.js]"]
  node_ddms["Keyword and organizer service<br/>[DDMSModel.js]"]
  node_ddmsapi{{"DDMS service"}}
  node_storage[("Browser storage<br/>[LocalStorage.js]")]
  node_form["Form submission<br/>[FormHandler.js]"]
end

subgraph group_other["Other capabilities"]
  node_copybook["Algorithm copybook"]
  node_copybookmodel["Copybook data<br/>[CopybookModel.js]"]
  node_bookmarkapp["Legacy bookmark app<br/>[App.js]"]
  node_bookmarkview["Bookmark organizer view<br/>[BookmarkView.js]"]
  node_bookmarkmodel["Bookmark model<br/>[BookmarkModel.js]"]
end

node_user(("User"))

node_user -->|"enters query"| node_searchbar
node_app -->|"renders"| node_main
node_app -.->|"mounts capability"| node_copybook
node_main -->|"renders"| node_searchbar
node_main -->|"requests search"| node_searchmodel
node_searchmodel -->|"queries and fetches"| node_searchapi
node_searchmodel -->|"requests translation"| node_translations
node_searchmodel -->|"reads and saves"| node_resultstore
node_main -->|"renders results"| node_results
node_main -->|"renders source"| node_source
node_source -->|"uses highlighting"| node_highlight
node_main -->|"renders suggestions"| node_suggestions
node_main -->|"shows loading"| node_loading
node_main -->|"records analytics"| node_appmodel
node_main -->|"posts keywords"| node_ddms
node_ddms -->|"sends and retrieves data"| node_ddmsapi
node_ddms -->|"submits forms"| node_form
node_ddms -->|"persists keywords"| node_storage
node_appmodel -->|"persists device ID"| node_storage
node_app -.->|"organizer capability"| node_bookmarkapp
node_bookmarkapp -->|"renders view"| node_bookmarkview
node_bookmarkview -.->|"uses bookmark data"| node_bookmarkmodel
node_copybook -.->|"uses copybook data"| node_copybookmodel

click node_app "https://github.com/unbug/codelf/blob/master/src/App.js"
click node_main "https://github.com/unbug/codelf/blob/master/src/containers/MainContainer.js"
click node_searchbar "https://github.com/unbug/codelf/blob/master/src/components/SearchBar.js"
click node_results "https://github.com/unbug/codelf/blob/master/src/components/VariableList.js"
click node_source "https://github.com/unbug/codelf/blob/master/src/components/SourceCode.js"
click node_highlight "https://github.com/unbug/codelf/blob/master/src/components/hooks/useCodeHighlighting.js"
click node_suggestions "https://github.com/unbug/codelf/blob/master/src/components/Suggestion.js"
click node_searchmodel "https://github.com/unbug/codelf/blob/master/src/models/SearchCodeModel.js"
click node_translations "https://github.com/unbug/codelf/tree/master/src/models/metadata"
click node_resultstore "https://github.com/unbug/codelf/blob/master/src/models/Store.js"
click node_loading "https://github.com/unbug/codelf/blob/master/src/components/Loading.js"
click node_appmodel "https://github.com/unbug/codelf/blob/master/src/models/AppModel.js"
click node_ddms "https://github.com/unbug/codelf/blob/master/src/models/DDMSModel.js"
click node_storage "https://github.com/unbug/codelf/blob/master/src/utils/LocalStorage.js"
click node_form "https://github.com/unbug/codelf/blob/master/src/utils/FormHandler.js"
click node_copybook "https://github.com/unbug/codelf/blob/master/src/containers/CopybookContainer.js"
click node_copybookmodel "https://github.com/unbug/codelf/blob/master/src/models/CopybookModel.js"
click node_bookmarkapp "https://github.com/unbug/codelf/blob/master/__static/app/src/App.js"
click node_bookmarkview "https://github.com/unbug/codelf/blob/master/__static/app/src/view/BookmarkView.js"
click node_bookmarkmodel "https://github.com/unbug/codelf/blob/master/__static/app/src/model/BookmarkModel.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_app,node_main,node_searchbar,node_results,node_source,node_highlight,node_suggestions,node_loading,node_user toneBlue
class node_searchmodel,node_searchapi,node_translations,node_resultstore toneAmber
class node_appmodel,node_ddms,node_ddmsapi,node_storage,node_form toneMint
class node_copybook,node_copybookmodel,node_bookmarkapp,node_bookmarkview,node_bookmarkmodel toneRose
```

## Components

### Search interface

- [React app](https://github.com/unbug/codelf/blob/master/src/App.js): `src/App.js`
- [Search controller](https://github.com/unbug/codelf/blob/master/src/containers/MainContainer.js): `src/containers/MainContainer.js`
- [Query and filters](https://github.com/unbug/codelf/blob/master/src/components/SearchBar.js): `src/components/SearchBar.js`
- [Variable results](https://github.com/unbug/codelf/blob/master/src/components/VariableList.js): `src/components/VariableList.js`
- [Source viewer](https://github.com/unbug/codelf/blob/master/src/components/SourceCode.js): `src/components/SourceCode.js`
- [Code highlighting](https://github.com/unbug/codelf/blob/master/src/components/hooks/useCodeHighlighting.js): `src/components/hooks/useCodeHighlighting.js`
- [Suggestions](https://github.com/unbug/codelf/blob/master/src/components/Suggestion.js): `src/components/Suggestion.js`
- [Loading state](https://github.com/unbug/codelf/blob/master/src/components/Loading.js): `src/components/Loading.js`

### Naming search

- [Search model](https://github.com/unbug/codelf/blob/master/src/models/SearchCodeModel.js): `src/models/SearchCodeModel.js`
- **Searchcode API**
- [Translation providers](https://github.com/unbug/codelf/tree/master/src/models/metadata): `src/models/metadata`
- [Search cache](https://github.com/unbug/codelf/blob/master/src/models/Store.js): `src/models/Store.js`

### App services

- [App state and analytics](https://github.com/unbug/codelf/blob/master/src/models/AppModel.js): `src/models/AppModel.js`
- [Keyword and organizer service](https://github.com/unbug/codelf/blob/master/src/models/DDMSModel.js): `src/models/DDMSModel.js`
- **DDMS service**
- [Browser storage](https://github.com/unbug/codelf/blob/master/src/utils/LocalStorage.js): `src/utils/LocalStorage.js`
- [Form submission](https://github.com/unbug/codelf/blob/master/src/utils/FormHandler.js): `src/utils/FormHandler.js`

### Other capabilities

- [Algorithm copybook](https://github.com/unbug/codelf/blob/master/src/containers/CopybookContainer.js): `src/containers/CopybookContainer.js`
- [Copybook data](https://github.com/unbug/codelf/blob/master/src/models/CopybookModel.js): `src/models/CopybookModel.js`
- [Legacy bookmark app](https://github.com/unbug/codelf/blob/master/__static/app/src/App.js): `__static/app/src/App.js`
- [Bookmark organizer view](https://github.com/unbug/codelf/blob/master/__static/app/src/view/BookmarkView.js): `__static/app/src/view/BookmarkView.js`
- [Bookmark model](https://github.com/unbug/codelf/blob/master/__static/app/src/model/BookmarkModel.js): `__static/app/src/model/BookmarkModel.js`

### Other components

- **User**

## Connections

- User → Query and filters: enters query (evidence: `src/components/SearchBar.js`)
- React app → Search controller: renders (evidence: `src/App.js`)
- React app → Algorithm copybook: mounts capability (evidence: `src/App.js`)
- Search controller → Query and filters: renders (evidence: `src/containers/MainContainer.js`)
- Search controller → Search model: requests search (evidence: `src/containers/MainContainer.js`)
- Search model → Searchcode API: queries and fetches (evidence: `src/models/SearchCodeModel.js`)
- Search model → Translation providers: requests translation (evidence: `src/models/SearchCodeModel.js`)
- Search model → Search cache: reads and saves (evidence: `src/models/SearchCodeModel.js`)
- Search controller → Variable results: renders results (evidence: `src/containers/MainContainer.js`)
- Search controller → Source viewer: renders source (evidence: `src/containers/MainContainer.js`)
- Source viewer → Code highlighting: uses highlighting (evidence: `src/components/SourceCode.js`)
- Search controller → Suggestions: renders suggestions (evidence: `src/containers/MainContainer.js`)
- Search controller → Loading state: shows loading (evidence: `src/containers/MainContainer.js`)
- Search controller → App state and analytics: records analytics (evidence: `src/containers/MainContainer.js`)
- Search controller → Keyword and organizer service: posts keywords (evidence: `src/containers/MainContainer.js`)
- Keyword and organizer service → DDMS service: sends and retrieves data (evidence: `src/models/DDMSModel.js`)
- Keyword and organizer service → Form submission: submits forms (evidence: `src/models/DDMSModel.js`)
- Keyword and organizer service → Browser storage: persists keywords (evidence: `src/models/DDMSModel.js`)
- App state and analytics → Browser storage: persists device ID (evidence: `src/models/AppModel.js`)
- React app → Legacy bookmark app: organizer capability (evidence: `README.md`)
- Legacy bookmark app → Bookmark organizer view: renders view (evidence: `__static/app/src/App.js`)
- Bookmark organizer view → Bookmark model: uses bookmark data
- Algorithm copybook → Copybook data: uses copybook data (evidence: `src/containers/CopybookContainer.js`)
