# khaled10a/algo-app architecture

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

## Overview

Algo App is a React learning tool whose main workflow is selecting an algorithm and input, then running, visualizing, benchmarking, or debugging it. The graph separates the application shell, algorithm catalog, learning features, shared runtime utilities, and the AI service. The README documents several capabilities whose implementation is not present in the supplied tree or excerpts; those are represented at the supported feature-directory level. Links reflect excerpted imports or README statements, not presumed internal pipelines.

Main entry points: [`src/algorithms/registry.js`](https://github.com/khaled10a/algo-app/blob/main/src/algorithms/registry.js) (Algorithm registry), [`src/App.jsx`](https://github.com/khaled10a/algo-app/blob/main/src/App.jsx) (App shell), [`src/tabs`](https://github.com/khaled10a/algo-app/tree/main/src/tabs) (Domain debuggers), [`src/components/visualizer/GraphDebugger.jsx`](https://github.com/khaled10a/algo-app/blob/main/src/components/visualizer/GraphDebugger.jsx) (Graph playground)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_shell["App shell<br/>[App.jsx]"]
end

subgraph group_catalog["Algorithms"]
  node_catalog["Algorithm registry<br/>[registry.js]"]
  node_sortsearch["Sort and search"]
  node_graphs["Graph algorithms"]
  node_dp["Dynamic programming"]
  node_backtracking["Backtracking"]
  node_dnc["Divide and conquer"]
  node_greedy["Greedy algorithms"]
end

subgraph group_learning["Learning Features"]
  node_benchmark["Benchmarking<br/>[BenchmarkTab.jsx]"]
  node_visualizer["Sorting visualizer<br/>[VisualizerTab.jsx]"]
  node_graphdebug["Graph playground<br/>[GraphDebugger.jsx]"]
  node_debuggers["Domain debuggers"]
  node_complexity["Complexity reference<br/>[ComplexityTab.jsx]"]
  node_pseudocode["Pseudocode<br/>[PseudocodeTab.jsx]"]
  node_history["Run history<br/>[HistoryTab.jsx]"]
  node_report["Auto report<br/>[ReportTab.jsx]"]
end

subgraph group_runtime["Shared Runtime"]
  node_playback["Playback controls<br/>[usePlayback.js]"]
  node_persistent["Persistent state"]
  node_audio["Audio feedback<br/>[audio.js]"]
  node_export["Result export<br/>[exportUtils.js]"]
end

subgraph group_ai["AI Service"]
  node_assistant["AI assistant UI<br/>[AIAssistantTab.jsx]"]
  node_proxy["AI proxy<br/>[assistant.js]"]
end

node_student(("Learner"))
node_groq["Groq AI"]

node_student -->|"uses"| node_shell
node_shell -->|"selects algorithms"| node_catalog
node_catalog -->|"registers"| node_sortsearch
node_catalog -->|"registers"| node_graphs
node_catalog -->|"registers"| node_dp
node_catalog -->|"registers"| node_backtracking
node_catalog -->|"registers"| node_dnc
node_catalog -->|"registers"| node_greedy
node_shell -->|"renders"| node_graphdebug
node_shell -->|"renders"| node_debuggers
node_student -->|"configures runs"| node_benchmark
node_benchmark -->|"benchmarks"| node_sortsearch
node_student -->|"starts playback"| node_visualizer
node_visualizer -.->|"controls steps"| node_playback
node_student -->|"edits graphs"| node_graphdebug
node_graphdebug -->|"runs algorithms"| node_graphs
node_graphdebug -->|"uses controls"| node_playback
node_debuggers -->|"gets descriptors"| node_catalog
node_debuggers -.->|"uses controls"| node_playback
node_debuggers -.->|"plays tones"| node_audio
node_shell -->|"stores settings"| node_persistent
node_student -->|"consults"| node_complexity
node_student -->|"consults"| node_pseudocode
node_student -->|"compares runs"| node_history
node_student -->|"reviews summary"| node_report
node_benchmark -->|"exports results"| node_export
node_student -->|"asks questions"| node_assistant
node_assistant -->|"requests answers"| node_proxy
node_proxy -->|"requests completion"| node_groq

click node_shell "https://github.com/khaled10a/algo-app/blob/main/src/App.jsx"
click node_catalog "https://github.com/khaled10a/algo-app/blob/main/src/algorithms/registry.js"
click node_sortsearch "https://github.com/khaled10a/algo-app/tree/main/src/algorithms"
click node_graphs "https://github.com/khaled10a/algo-app/tree/main/src/algorithms/graphs"
click node_dp "https://github.com/khaled10a/algo-app/tree/main/src/algorithms/dynamicProgramming"
click node_backtracking "https://github.com/khaled10a/algo-app/tree/main/src/algorithms/backtracking"
click node_dnc "https://github.com/khaled10a/algo-app/tree/main/src/algorithms/divideAndConquer"
click node_greedy "https://github.com/khaled10a/algo-app/tree/main/src/algorithms/greedy"
click node_benchmark "https://github.com/khaled10a/algo-app/blob/main/src/tabs/BenchmarkTab.jsx"
click node_visualizer "https://github.com/khaled10a/algo-app/blob/main/src/tabs/VisualizerTab.jsx"
click node_graphdebug "https://github.com/khaled10a/algo-app/blob/main/src/components/visualizer/GraphDebugger.jsx"
click node_debuggers "https://github.com/khaled10a/algo-app/tree/main/src/tabs"
click node_complexity "https://github.com/khaled10a/algo-app/blob/main/src/tabs/ComplexityTab.jsx"
click node_pseudocode "https://github.com/khaled10a/algo-app/blob/main/src/tabs/PseudocodeTab.jsx"
click node_history "https://github.com/khaled10a/algo-app/blob/main/src/tabs/HistoryTab.jsx"
click node_report "https://github.com/khaled10a/algo-app/blob/main/src/tabs/ReportTab.jsx"
click node_playback "https://github.com/khaled10a/algo-app/blob/main/src/hooks/usePlayback.js"
click node_persistent "https://github.com/khaled10a/algo-app/blob/main/src/hooks/usePersistentState.js"
click node_audio "https://github.com/khaled10a/algo-app/blob/main/src/utils/audio.js"
click node_export "https://github.com/khaled10a/algo-app/blob/main/src/utils/exportUtils.js"
click node_assistant "https://github.com/khaled10a/algo-app/blob/main/src/tabs/AIAssistantTab.jsx"
click node_proxy "https://github.com/khaled10a/algo-app/blob/main/api/assistant.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_shell toneBlue
class node_catalog,node_sortsearch,node_graphs,node_dp,node_backtracking,node_dnc,node_greedy toneAmber
class node_benchmark,node_visualizer,node_graphdebug,node_debuggers,node_complexity,node_pseudocode,node_history,node_report toneMint
class node_playback,node_persistent,node_audio,node_export toneRose
class node_assistant,node_proxy,node_student,node_groq toneIndigo
```

## Components

### Application

- [App shell](https://github.com/khaled10a/algo-app/blob/main/src/App.jsx): `src/App.jsx`

### Algorithms

- [Algorithm registry](https://github.com/khaled10a/algo-app/blob/main/src/algorithms/registry.js): `src/algorithms/registry.js`
- [Sort and search](https://github.com/khaled10a/algo-app/tree/main/src/algorithms): `src/algorithms`
- [Graph algorithms](https://github.com/khaled10a/algo-app/tree/main/src/algorithms/graphs): `src/algorithms/graphs`
- [Dynamic programming](https://github.com/khaled10a/algo-app/tree/main/src/algorithms/dynamicProgramming): `src/algorithms/dynamicProgramming`
- [Backtracking](https://github.com/khaled10a/algo-app/tree/main/src/algorithms/backtracking): `src/algorithms/backtracking`
- [Divide and conquer](https://github.com/khaled10a/algo-app/tree/main/src/algorithms/divideAndConquer): `src/algorithms/divideAndConquer`
- [Greedy algorithms](https://github.com/khaled10a/algo-app/tree/main/src/algorithms/greedy): `src/algorithms/greedy`

### Learning Features

- [Benchmarking](https://github.com/khaled10a/algo-app/blob/main/src/tabs/BenchmarkTab.jsx): `src/tabs/BenchmarkTab.jsx`
- [Sorting visualizer](https://github.com/khaled10a/algo-app/blob/main/src/tabs/VisualizerTab.jsx): `src/tabs/VisualizerTab.jsx`
- [Graph playground](https://github.com/khaled10a/algo-app/blob/main/src/components/visualizer/GraphDebugger.jsx): `src/components/visualizer/GraphDebugger.jsx`
- [Domain debuggers](https://github.com/khaled10a/algo-app/tree/main/src/tabs): `src/tabs`
- [Complexity reference](https://github.com/khaled10a/algo-app/blob/main/src/tabs/ComplexityTab.jsx): `src/tabs/ComplexityTab.jsx`
- [Pseudocode](https://github.com/khaled10a/algo-app/blob/main/src/tabs/PseudocodeTab.jsx): `src/tabs/PseudocodeTab.jsx`
- [Run history](https://github.com/khaled10a/algo-app/blob/main/src/tabs/HistoryTab.jsx): `src/tabs/HistoryTab.jsx`
- [Auto report](https://github.com/khaled10a/algo-app/blob/main/src/tabs/ReportTab.jsx): `src/tabs/ReportTab.jsx`

### Shared Runtime

- [Playback controls](https://github.com/khaled10a/algo-app/blob/main/src/hooks/usePlayback.js): `src/hooks/usePlayback.js`
- [Persistent state](https://github.com/khaled10a/algo-app/blob/main/src/hooks/usePersistentState.js): `src/hooks/usePersistentState.js`
- [Audio feedback](https://github.com/khaled10a/algo-app/blob/main/src/utils/audio.js): `src/utils/audio.js`
- [Result export](https://github.com/khaled10a/algo-app/blob/main/src/utils/exportUtils.js): `src/utils/exportUtils.js`

### AI Service

- [AI assistant UI](https://github.com/khaled10a/algo-app/blob/main/src/tabs/AIAssistantTab.jsx): `src/tabs/AIAssistantTab.jsx`
- [AI proxy](https://github.com/khaled10a/algo-app/blob/main/api/assistant.js): `api/assistant.js`

### Other components

- **Learner**
- **Groq AI**

## Connections

- Learner → App shell: uses
- App shell → Algorithm registry: selects algorithms (evidence: `src/App.jsx`)
- Algorithm registry → Sort and search: registers (evidence: `src/algorithms/registry.js`)
- Algorithm registry → Graph algorithms: registers (evidence: `src/algorithms/registry.js`)
- Algorithm registry → Dynamic programming: registers (evidence: `src/algorithms/registry.js`)
- Algorithm registry → Backtracking: registers (evidence: `src/algorithms/registry.js`)
- Algorithm registry → Divide and conquer: registers (evidence: `src/algorithms/registry.js`)
- Algorithm registry → Greedy algorithms: registers (evidence: `src/algorithms/registry.js`)
- App shell → Graph playground: renders (evidence: `src/App.jsx`)
- App shell → Domain debuggers: renders (evidence: `src/App.jsx`)
- Learner → Benchmarking: configures runs
- Benchmarking → Sort and search: benchmarks (evidence: `src/tabs/BenchmarkTab.jsx`)
- Learner → Sorting visualizer: starts playback
- Sorting visualizer → Playback controls: controls steps
- Learner → Graph playground: edits graphs
- Graph playground → Graph algorithms: runs algorithms (evidence: `src/components/visualizer/GraphDebugger.jsx`)
- Graph playground → Playback controls: uses controls (evidence: `src/components/visualizer/GraphDebugger.jsx`)
- Domain debuggers → Algorithm registry: gets descriptors (evidence: `src/tabs/BacktrackDebuggerTab.jsx`)
- Domain debuggers → Playback controls: uses controls (evidence: `src/tabs/BacktrackDebuggerTab.jsx`)
- Domain debuggers → Audio feedback: plays tones (evidence: `src/tabs/BacktrackDebuggerTab.jsx`)
- App shell → Persistent state: stores settings (evidence: `src/App.jsx`)
- Learner → Complexity reference: consults
- Learner → Pseudocode: consults
- Learner → Run history: compares runs
- Learner → Auto report: reviews summary
- Benchmarking → Result export: exports results (evidence: `src/tabs/BenchmarkTab.jsx`)
- Learner → AI assistant UI: asks questions
- AI assistant UI → AI proxy: requests answers
- AI proxy → Groq AI: requests completion (evidence: `api/assistant.js`)
