# jaywcjlove/linux-command architecture

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

- Interactive diagram: https://gitdiagram.com/jaywcjlove/linux-command
- Repository: https://github.com/jaywcjlove/linux-command

## Overview

Linux Command is a searchable static reference site built from a collection of command guides. The principal workflow turns Markdown command entries into a searchable index and rendered pages; visitors search the index, then open a guide. The repository also contains dedicated list, hot-command, contributor, and shared page templates. The build and browser implementation are sampled, but individual command guides and template internals are not, so their relationships are shown only where the build source establishes them.

Main entry points: [`scripts/build.mjs`](https://github.com/jaywcjlove/linux-command/blob/master/scripts/build.mjs) (Site generator), [`template/js/index.js`](https://github.com/jaywcjlove/linux-command/blob/master/template/js/index.js) (Search UI), [`dist/data.json`](https://github.com/jaywcjlove/linux-command/blob/master/dist/data.json) (Command index), [`template/list.ejs`](https://github.com/jaywcjlove/linux-command/blob/master/template/list.ejs) (Search results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Reference content"]
  node_guides["Command guides"]
  node_index["Command index<br/>[data.json]"]
end

subgraph group_generation["Site generation"]
  node_builder["Site generator<br/>[build.mjs]"]
  node_templates["Page templates"]
end

subgraph group_experience["Search experience"]
  node_search["Search UI<br/>[index.js]"]
  node_copy["Copy control"]
end

subgraph group_pages["Rendered pages"]
  node_home["Home page<br/>[index.ejs]"]
  node_results["Search results<br/>[list.ejs]"]
  node_details["Command detail<br/>[details.ejs]"]
  node_popular["Hot commands<br/>[hot.ejs]"]
  node_contributors["Contributors<br/>[contributors.ejs]"]
  node_shared["Shared page elements"]
end

node_visitor(("Visitor"))

node_builder -->|"reads guides"| node_guides
node_builder -->|"writes index"| node_index
node_builder -->|"renders templates"| node_templates
node_builder -->|"renders home"| node_home
node_builder -->|"renders results"| node_results
node_builder -->|"renders guides"| node_details
node_builder -->|"renders hot page"| node_popular
node_builder -->|"renders contributors"| node_contributors
node_visitor -->|"enters query"| node_search
node_search -->|"searches data"| node_index
node_search -->|"opens results"| node_results
node_visitor -.->|"opens guide"| node_details
node_visitor -.->|"copies command"| node_copy

click node_guides "https://github.com/jaywcjlove/linux-command/tree/master/command"
click node_builder "https://github.com/jaywcjlove/linux-command/blob/master/scripts/build.mjs"
click node_index "https://github.com/jaywcjlove/linux-command/blob/master/dist/data.json"
click node_templates "https://github.com/jaywcjlove/linux-command/tree/master/template"
click node_search "https://github.com/jaywcjlove/linux-command/blob/master/template/js/index.js"
click node_copy "https://github.com/jaywcjlove/linux-command/blob/master/template/js/copy-to-clipboard.js"
click node_home "https://github.com/jaywcjlove/linux-command/blob/master/template/index.ejs"
click node_results "https://github.com/jaywcjlove/linux-command/blob/master/template/list.ejs"
click node_details "https://github.com/jaywcjlove/linux-command/blob/master/template/details.ejs"
click node_popular "https://github.com/jaywcjlove/linux-command/blob/master/template/hot.ejs"
click node_contributors "https://github.com/jaywcjlove/linux-command/blob/master/template/contributors.ejs"
click node_shared "https://github.com/jaywcjlove/linux-command/tree/master/template/partial"

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_guides,node_index toneBlue
class node_builder,node_templates toneAmber
class node_search,node_copy toneMint
class node_home,node_results,node_details,node_popular,node_contributors,node_shared toneRose
class node_visitor toneIndigo
```

## Components

### Reference content

- [Command guides](https://github.com/jaywcjlove/linux-command/tree/master/command): `command`
- [Command index](https://github.com/jaywcjlove/linux-command/blob/master/dist/data.json): `dist/data.json`

### Site generation

- [Site generator](https://github.com/jaywcjlove/linux-command/blob/master/scripts/build.mjs): `scripts/build.mjs`
- [Page templates](https://github.com/jaywcjlove/linux-command/tree/master/template): `template`

### Search experience

- [Search UI](https://github.com/jaywcjlove/linux-command/blob/master/template/js/index.js): `template/js/index.js`
- [Copy control](https://github.com/jaywcjlove/linux-command/blob/master/template/js/copy-to-clipboard.js): `template/js/copy-to-clipboard.js`

### Rendered pages

- [Home page](https://github.com/jaywcjlove/linux-command/blob/master/template/index.ejs): `template/index.ejs`
- [Search results](https://github.com/jaywcjlove/linux-command/blob/master/template/list.ejs): `template/list.ejs`
- [Command detail](https://github.com/jaywcjlove/linux-command/blob/master/template/details.ejs): `template/details.ejs`
- [Hot commands](https://github.com/jaywcjlove/linux-command/blob/master/template/hot.ejs): `template/hot.ejs`
- [Contributors](https://github.com/jaywcjlove/linux-command/blob/master/template/contributors.ejs): `template/contributors.ejs`
- [Shared page elements](https://github.com/jaywcjlove/linux-command/tree/master/template/partial): `template/partial`

### Other components

- **Visitor**

## Connections

- Site generator → Command guides: reads guides (evidence: `scripts/build.mjs`)
- Site generator → Command index: writes index (evidence: `scripts/build.mjs`)
- Site generator → Page templates: renders templates (evidence: `scripts/build.mjs`)
- Site generator → Home page: renders home (evidence: `scripts/build.mjs`)
- Site generator → Search results: renders results (evidence: `scripts/build.mjs`)
- Site generator → Command detail: renders guides (evidence: `scripts/build.mjs`)
- Site generator → Hot commands: renders hot page (evidence: `scripts/build.mjs`)
- Site generator → Contributors: renders contributors (evidence: `scripts/build.mjs`)
- Visitor → Search UI: enters query (evidence: `template/js/index.js`)
- Search UI → Command index: searches data (evidence: `template/js/index.js`)
- Search UI → Search results: opens results (evidence: `template/js/index.js`)
- Visitor → Command detail: opens guide
- Visitor → Copy control: copies command
