# dakshdagar1628/structbuddy architecture

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

- Interactive diagram: https://gitdiagram.com/dakshdagar1628/structbuddy
- Repository: https://github.com/dakshdagar1628/structbuddy

## Overview

StructBuddy is an interactive data-structure learning app. A learner enters through the web app, chooses a module, and uses its visual and step-through learning experiences; the repository also exposes module listings and summaries through an MCP endpoint. The route map and MCP tool behavior are supported by sampled source. The tree identifies the other module pages and visualizers, but their internal wiring was not sampled, so those links are omitted. The README’s general Supabase claims are not reflected as a product flow in the sampled source.

Main entry points: [`src/App.tsx`](https://github.com/dakshdagar1628/structbuddy/blob/main/src/App.tsx) (App routes), [`src/pages/DoublyLinkedListModule.tsx`](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/DoublyLinkedListModule.tsx) (Doubly list page), [`src/lib/mcp/index.ts`](https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/index.ts) (Tool registry), [`supabase/functions/mcp/index.ts`](https://github.com/dakshdagar1628/structbuddy/blob/main/supabase/functions/mcp/index.ts) (MCP endpoint)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["Web navigation"]
  node_app["App routes<br/>[App.tsx]"]
end

subgraph group_learning["Learning experiences"]
  node_home["Module home<br/>[AlgoVizHome.tsx]"]
  node_arrays_page["Arrays page<br/>[ArraysModule.tsx]"]
  node_strings_page["Strings page<br/>[StringsModule.tsx]"]
  node_stack_page["Stack page<br/>[StackModule.tsx]"]
  node_queue_page["Queue page<br/>[QueueModule.tsx]"]
  node_linked_page["Linked list page"]
  node_doubly_page["Doubly list page"]
  node_trees_page["Trees page<br/>[TreesModule.tsx]"]
  node_learning_layout["Learning layout<br/>[LearningLayout.tsx]"]
  node_code_lab["Step code lab"]
  node_concept_canvas["Concept canvas"]
  node_array_viz["Array visualizer"]
  node_string_viz["String visualizer"]
  node_stack_viz["Stack visualizer"]
  node_queue_viz["Queue visualizer"]
  node_linked_viz["Linked list visualizer"]
  node_doubly_viz["Doubly list visualizer"]
  node_tree_viz["Tree visualizer<br/>[TreeVisualizer.tsx]"]
  node_arrays_data["Array lesson data<br/>[arrayData.ts]"]
end

subgraph group_mcp["MCP discovery"]
  node_mcp_endpoint["MCP endpoint<br/>[index.ts]"]
  node_mcp_definition["Tool registry<br/>[index.ts]"]
  node_list_tool["List modules<br/>[list-modules.ts]"]
  node_get_tool["Get module<br/>[get-module.ts]"]
end

node_learner(("Learner"))
node_mcp_client(("MCP client"))

node_learner -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_arrays_page
node_app -->|"routes to"| node_strings_page
node_app -->|"routes to"| node_stack_page
node_app -->|"routes to"| node_queue_page
node_app -->|"routes to"| node_linked_page
node_app -->|"routes to"| node_doubly_page
node_app -->|"routes to"| node_trees_page
node_doubly_page -->|"renders"| node_learning_layout
node_doubly_page -->|"renders"| node_code_lab
node_doubly_page -->|"renders"| node_concept_canvas
node_doubly_page -->|"renders"| node_doubly_viz
node_mcp_client -->|"requests tools"| node_mcp_endpoint
node_mcp_endpoint -->|"serves"| node_mcp_definition
node_mcp_definition -->|"registers"| node_list_tool
node_mcp_definition -->|"registers"| node_get_tool
node_arrays_data -->|"supplies steps"| node_code_lab

click node_app "https://github.com/dakshdagar1628/structbuddy/blob/main/src/App.tsx"
click node_home "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/AlgoVizHome.tsx"
click node_arrays_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/ArraysModule.tsx"
click node_strings_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/StringsModule.tsx"
click node_stack_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/StackModule.tsx"
click node_queue_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/QueueModule.tsx"
click node_linked_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/LinkedListModule.tsx"
click node_doubly_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/DoublyLinkedListModule.tsx"
click node_trees_page "https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/TreesModule.tsx"
click node_learning_layout "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/LearningLayout.tsx"
click node_code_lab "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/IntegratedCodeLab.tsx"
click node_concept_canvas "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/VisualConceptCanvas.tsx"
click node_array_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/ArraysVisualizer.tsx"
click node_string_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/StringsVisualizer.tsx"
click node_stack_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/StackVisualizer.tsx"
click node_queue_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/QueueVisualizer.tsx"
click node_linked_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/LinkedListVisualizer.tsx"
click node_doubly_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/DoublyLinkedListVisualizer.tsx"
click node_tree_viz "https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/TreeVisualizer.tsx"
click node_arrays_data "https://github.com/dakshdagar1628/structbuddy/blob/main/src/data/arrayData.ts"
click node_mcp_endpoint "https://github.com/dakshdagar1628/structbuddy/blob/main/supabase/functions/mcp/index.ts"
click node_mcp_definition "https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/index.ts"
click node_list_tool "https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/tools/list-modules.ts"
click node_get_tool "https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/tools/get-module.ts"

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_mcp_client toneBlue
class node_home,node_arrays_page,node_strings_page,node_stack_page,node_queue_page,node_linked_page,node_doubly_page,node_trees_page,node_learning_layout,node_code_lab,node_concept_canvas,node_array_viz,node_string_viz,node_stack_viz,node_queue_viz,node_linked_viz,node_doubly_viz,node_tree_viz,node_arrays_data toneAmber
class node_mcp_endpoint,node_mcp_definition,node_list_tool,node_get_tool toneMint
class node_learner toneIndigo
```

## Components

### Web navigation

- [App routes](https://github.com/dakshdagar1628/structbuddy/blob/main/src/App.tsx): `src/App.tsx`

### Learning experiences

- [Module home](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/AlgoVizHome.tsx): `src/pages/AlgoVizHome.tsx`
- [Arrays page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/ArraysModule.tsx): `src/pages/ArraysModule.tsx`
- [Strings page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/StringsModule.tsx): `src/pages/StringsModule.tsx`
- [Stack page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/StackModule.tsx): `src/pages/StackModule.tsx`
- [Queue page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/QueueModule.tsx): `src/pages/QueueModule.tsx`
- [Linked list page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/LinkedListModule.tsx): `src/pages/LinkedListModule.tsx`
- [Doubly list page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/DoublyLinkedListModule.tsx): `src/pages/DoublyLinkedListModule.tsx`
- [Trees page](https://github.com/dakshdagar1628/structbuddy/blob/main/src/pages/TreesModule.tsx): `src/pages/TreesModule.tsx`
- [Learning layout](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/LearningLayout.tsx): `src/components/algoviz/LearningLayout.tsx`
- [Step code lab](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/IntegratedCodeLab.tsx): `src/components/algoviz/IntegratedCodeLab.tsx`
- [Concept canvas](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/VisualConceptCanvas.tsx): `src/components/algoviz/VisualConceptCanvas.tsx`
- [Array visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/ArraysVisualizer.tsx): `src/components/algoviz/ArraysVisualizer.tsx`
- [String visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/StringsVisualizer.tsx): `src/components/algoviz/StringsVisualizer.tsx`
- [Stack visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/StackVisualizer.tsx): `src/components/algoviz/StackVisualizer.tsx`
- [Queue visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/QueueVisualizer.tsx): `src/components/algoviz/QueueVisualizer.tsx`
- [Linked list visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/LinkedListVisualizer.tsx): `src/components/algoviz/LinkedListVisualizer.tsx`
- [Doubly list visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/DoublyLinkedListVisualizer.tsx): `src/components/algoviz/DoublyLinkedListVisualizer.tsx`
- [Tree visualizer](https://github.com/dakshdagar1628/structbuddy/blob/main/src/components/algoviz/TreeVisualizer.tsx): `src/components/algoviz/TreeVisualizer.tsx`
- [Array lesson data](https://github.com/dakshdagar1628/structbuddy/blob/main/src/data/arrayData.ts): `src/data/arrayData.ts`

### MCP discovery

- [MCP endpoint](https://github.com/dakshdagar1628/structbuddy/blob/main/supabase/functions/mcp/index.ts): `supabase/functions/mcp/index.ts`
- [Tool registry](https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/index.ts): `src/lib/mcp/index.ts`
- [List modules](https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/tools/list-modules.ts): `src/lib/mcp/tools/list-modules.ts`
- [Get module](https://github.com/dakshdagar1628/structbuddy/blob/main/src/lib/mcp/tools/get-module.ts): `src/lib/mcp/tools/get-module.ts`

### Other components

- **Learner**
- **MCP client**

## Connections

- Learner → App routes: opens app
- App routes → Module home: routes to
- App routes → Arrays page: routes to
- App routes → Strings page: routes to
- App routes → Stack page: routes to
- App routes → Queue page: routes to
- App routes → Linked list page: routes to
- App routes → Doubly list page: routes to
- App routes → Trees page: routes to
- Doubly list page → Learning layout: renders
- Doubly list page → Step code lab: renders
- Doubly list page → Concept canvas: renders
- Doubly list page → Doubly list visualizer: renders
- MCP client → MCP endpoint: requests tools
- MCP endpoint → Tool registry: serves
- Tool registry → List modules: registers
- Tool registry → Get module: registers
- Array lesson data → Step code lab: supplies steps
