# whitenessly/hamilton_trr2 architecture

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

- Interactive diagram: https://gitdiagram.com/whitenessly/hamilton_trr2
- Repository: https://github.com/whitenessly/hamilton_trr2

## Overview

Hamilton Simulator is a browser-based learning tool for building graphs and exploring Hamiltonian-path searches. Its main workflow is handled in one large Home route: users edit a graph, run or step through a search, and inspect the visualization and progress. The README also documents fast search, dark/light mode, and responsive sidebars. The sampled source shows routing and parts of the search and interface, but not the full graph-editing or simulation implementation; those capabilities are represented at the Home module level.

Main entry points: [`src/routes/Home.jsx`](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx) (Simulator workspace), [`src/App.jsx`](https://github.com/whitenessly/hamilton_trr2/blob/main/src/App.jsx) (Route selection), [`src/main.jsx`](https://github.com/whitenessly/hamilton_trr2/blob/main/src/main.jsx) (Browser entry), [`src/routes/NotFound.jsx`](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/NotFound.jsx) (Not-found page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["App routing"]
  node_browser["Browser entry<br/>[main.jsx]"]
  node_router["Route selection<br/>[App.jsx]"]
  node_notfound["Not-found page<br/>[NotFound.jsx]"]
end

subgraph group_workspace["Graph workspace"]
  node_home["Simulator workspace<br/>[Home.jsx]"]
  node_graph["Graph builder<br/>[Home.jsx]"]
end

subgraph group_search["Hamilton search"]
  node_search["Path search<br/>[Home.jsx]"]
  node_fast["Fast search<br/>[Home.jsx]"]
  node_stepper["Step controls<br/>[Home.jsx]"]
end

subgraph group_presentation["Display and controls"]
  node_visualization["Search visualization<br/>[Home.jsx]"]
  node_log["Progress log<br/>[Home.jsx]"]
  node_settings["Theme and layout<br/>[Home.jsx]"]
end

node_visitor(("Learner"))

node_visitor -->|"opens app"| node_browser
node_browser -->|"renders"| node_router
node_router -->|"routes /home"| node_home
node_router -->|"routes fallback"| node_notfound
node_visitor -->|"uses simulator"| node_home
node_home -->|"builds graphs"| node_graph
node_home -->|"runs search"| node_search
node_home -->|"offers fast search"| node_fast
node_home -.->|"controls search"| node_stepper
node_home -->|"visualizes search"| node_visualization
node_home -->|"shows progress"| node_log
node_home -->|"offers display controls"| node_settings
node_notfound -->|"links home"| node_home

click node_browser "https://github.com/whitenessly/hamilton_trr2/blob/main/src/main.jsx"
click node_router "https://github.com/whitenessly/hamilton_trr2/blob/main/src/App.jsx"
click node_home "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_graph "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_search "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_fast "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_stepper "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_visualization "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_log "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_settings "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx"
click node_notfound "https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/NotFound.jsx"

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_browser,node_router,node_notfound toneBlue
class node_home,node_graph toneAmber
class node_search,node_fast,node_stepper toneMint
class node_visualization,node_log,node_settings toneRose
class node_visitor toneIndigo
```

## Components

### App routing

- [Browser entry](https://github.com/whitenessly/hamilton_trr2/blob/main/src/main.jsx): `src/main.jsx`
- [Route selection](https://github.com/whitenessly/hamilton_trr2/blob/main/src/App.jsx): `src/App.jsx`
- [Not-found page](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/NotFound.jsx): `src/routes/NotFound.jsx`

### Graph workspace

- [Simulator workspace](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`
- [Graph builder](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`

### Hamilton search

- [Path search](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`
- [Fast search](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`
- [Step controls](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`

### Display and controls

- [Search visualization](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`
- [Progress log](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`
- [Theme and layout](https://github.com/whitenessly/hamilton_trr2/blob/main/src/routes/Home.jsx): `src/routes/Home.jsx`

### Other components

- **Learner**

## Connections

- Learner → Browser entry: opens app (evidence: `README.md`)
- Browser entry → Route selection: renders (evidence: `src/main.jsx`)
- Route selection → Simulator workspace: routes /home (evidence: `src/App.jsx`)
- Route selection → Not-found page: routes fallback (evidence: `src/App.jsx`)
- Learner → Simulator workspace: uses simulator (evidence: `README.md`)
- Simulator workspace → Graph builder: builds graphs (evidence: `README.md`)
- Simulator workspace → Path search: runs search (evidence: `README.md`)
- Simulator workspace → Fast search: offers fast search (evidence: `src/routes/Home.jsx`)
- Simulator workspace → Step controls: controls search (evidence: `src/routes/Home.jsx`)
- Simulator workspace → Search visualization: visualizes search (evidence: `README.md`)
- Simulator workspace → Progress log: shows progress (evidence: `src/routes/Home.jsx`)
- Simulator workspace → Theme and layout: offers display controls (evidence: `src/routes/Home.jsx`)
- Not-found page → Simulator workspace: links home (evidence: `src/routes/NotFound.jsx`)
