# mah-bin/cognitree architecture

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

## Overview

CogniTree is an adaptive-learning app that turns curriculum prerequisites and quiz distractors into personalized knowledge-gap diagnoses and remediation paths. The main workflow is student exploration, concept selection, quiz response, diagnosis/mastery updates, then a highlighted detour and progress views. The README documents broader capabilities such as misconception blame tags, BFS fallback, fluency tracking, and mastery revocation. Some UI wiring is supported by the SOURCE INDEX; unsampled implementation details and the separate root-level engine are left unconnected where their relationships are not evidenced.

Main entry points: [`nodedesign/src/App.jsx`](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/App.jsx) (App coordinator), [`nodedesign/src/core/CurriculumContext.tsx`](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/CurriculumContext.tsx) (Curriculum state), [`nodedesign/src/components/graph/Graph.jsx`](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/graph/Graph.jsx) (Interactive graph), [`nodedesign/src/components/AnalyticsDashboard.tsx`](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/AnalyticsDashboard.tsx) (Learning analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_app["App coordinator<br/>[App.jsx]"]
  node_hero["Landing experience<br/>[ScrollHero.jsx]"]
  node_login["Login modal<br/>[LoginModal.jsx]"]
  node_navigation["Curriculum navigation<br/>[CurriculumNav.jsx]"]
  node_topbar["Progress controls<br/>[TopBar.jsx]"]
  node_graphview["Interactive graph<br/>[Graph.jsx]"]
  node_concept["Concept node view<br/>[ConceptNode.jsx]"]
  node_insights["Concept insights<br/>[InsightPanel.jsx]"]
  node_quiz["Quiz interface<br/>[QuizModal.tsx]"]
  node_diagnosticpanel["Diagnosis panel"]
  node_analytics["Learning analytics"]
  node_scan["Path scan animation"]
end

subgraph group_diagnosis["Diagnosis and progress"]
  node_context["Curriculum state"]
  node_logic["Diagnosis and mastery logic<br/>[graphLogic.ts]"]
end

subgraph group_curriculum["Curriculum data"]
  node_adapter["Graph data adapter<br/>[adapter.js]"]
  node_mockdata["Demo curriculum data<br/>[mockData.js]"]
  node_curriculumgraph["Authored curriculum graph"]
end

subgraph group_rootlogic["Root-level logic"]
  node_engine["Root-level logic engine<br/>[engine.ts]"]
  node_rootcurriculum["Root curriculum data<br/>[curriculum.json]"]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"renders"| node_hero
node_app -->|"renders"| node_login
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_topbar
node_app -->|"renders"| node_graphview
node_app -->|"renders"| node_insights
node_app -->|"renders"| node_quiz
node_app -->|"renders"| node_diagnosticpanel
node_app -->|"renders"| node_analytics
node_app -->|"runs"| node_scan
node_graphview -->|"renders"| node_concept
node_graphview -->|"maps nodes"| node_adapter
node_quiz -->|"submits answers"| node_context
node_context -->|"calls"| node_logic
node_context -->|"loads"| node_curriculumgraph
node_analytics -->|"reads progress"| node_context
node_analytics -->|"uses signals"| node_logic
node_logic -->|"updates state"| node_context

click node_app "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/App.jsx"
click node_hero "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/hero/ScrollHero.jsx"
click node_login "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/auth/LoginModal.jsx"
click node_navigation "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/CurriculumNav.jsx"
click node_topbar "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/ui/TopBar.jsx"
click node_graphview "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/graph/Graph.jsx"
click node_concept "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/nodes/ConceptNode.jsx"
click node_insights "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/InsightPanel.jsx"
click node_quiz "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/QuizModal.tsx"
click node_diagnosticpanel "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/DiagnosticPanel.jsx"
click node_analytics "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/AnalyticsDashboard.tsx"
click node_scan "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/hooks/useDiagnosticScan.js"
click node_context "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/CurriculumContext.tsx"
click node_logic "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/graphLogic.ts"
click node_adapter "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/data/adapter.js"
click node_mockdata "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/data/mockData.js"
click node_curriculumgraph "https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/curriculum_graph.json"
click node_engine "https://github.com/mah-bin/cognitree/blob/main/src/logic/engine.ts"
click node_rootcurriculum "https://github.com/mah-bin/cognitree/blob/main/src/data/curriculum.json"

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_hero,node_login,node_navigation,node_topbar,node_graphview,node_concept,node_insights,node_quiz,node_diagnosticpanel,node_analytics,node_scan toneBlue
class node_context,node_logic toneAmber
class node_adapter,node_mockdata,node_curriculumgraph toneMint
class node_engine,node_rootcurriculum toneRose
class node_student toneIndigo
```

## Components

### Learning experience

- [App coordinator](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/App.jsx): `nodedesign/src/App.jsx`
- [Landing experience](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/hero/ScrollHero.jsx): `nodedesign/src/components/hero/ScrollHero.jsx`
- [Login modal](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/auth/LoginModal.jsx): `nodedesign/src/components/auth/LoginModal.jsx`
- [Curriculum navigation](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/CurriculumNav.jsx): `nodedesign/src/components/panels/CurriculumNav.jsx`
- [Progress controls](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/ui/TopBar.jsx): `nodedesign/src/components/ui/TopBar.jsx`
- [Interactive graph](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/graph/Graph.jsx): `nodedesign/src/components/graph/Graph.jsx`
- [Concept node view](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/nodes/ConceptNode.jsx): `nodedesign/src/components/nodes/ConceptNode.jsx`
- [Concept insights](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/InsightPanel.jsx): `nodedesign/src/components/panels/InsightPanel.jsx`
- [Quiz interface](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/QuizModal.tsx): `nodedesign/src/components/QuizModal.tsx`
- [Diagnosis panel](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/panels/DiagnosticPanel.jsx): `nodedesign/src/components/panels/DiagnosticPanel.jsx`
- [Learning analytics](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/components/AnalyticsDashboard.tsx): `nodedesign/src/components/AnalyticsDashboard.tsx`
- [Path scan animation](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/hooks/useDiagnosticScan.js): `nodedesign/src/hooks/useDiagnosticScan.js`

### Diagnosis and progress

- [Curriculum state](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/CurriculumContext.tsx): `nodedesign/src/core/CurriculumContext.tsx`
- [Diagnosis and mastery logic](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/graphLogic.ts): `nodedesign/src/core/graphLogic.ts`

### Curriculum data

- [Graph data adapter](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/data/adapter.js): `nodedesign/src/data/adapter.js`
- [Demo curriculum data](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/data/mockData.js): `nodedesign/src/data/mockData.js`
- [Authored curriculum graph](https://github.com/mah-bin/cognitree/blob/main/nodedesign/src/core/curriculum_graph.json): `nodedesign/src/core/curriculum_graph.json`

### Root-level logic

- [Root-level logic engine](https://github.com/mah-bin/cognitree/blob/main/src/logic/engine.ts): `src/logic/engine.ts`
- [Root curriculum data](https://github.com/mah-bin/cognitree/blob/main/src/data/curriculum.json): `src/data/curriculum.json`

### Other components

- **Student**

## Connections

- Student → App coordinator: uses (evidence: `README.md`)
- App coordinator → Landing experience: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Login modal: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Curriculum navigation: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Progress controls: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Interactive graph: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Concept insights: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Quiz interface: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Diagnosis panel: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Learning analytics: renders (evidence: `nodedesign/src/App.jsx`)
- App coordinator → Path scan animation: runs (evidence: `nodedesign/src/App.jsx`)
- Interactive graph → Concept node view: renders (evidence: `nodedesign/src/components/graph/Graph.jsx`)
- Interactive graph → Graph data adapter: maps nodes (evidence: `nodedesign/src/components/graph/Graph.jsx`)
- Quiz interface → Curriculum state: submits answers (evidence: `nodedesign/src/components/QuizModal.tsx`)
- Curriculum state → Diagnosis and mastery logic: calls (evidence: `nodedesign/src/core/CurriculumContext.tsx`)
- Curriculum state → Authored curriculum graph: loads (evidence: `nodedesign/src/core/CurriculumContext.tsx`)
- Learning analytics → Curriculum state: reads progress (evidence: `nodedesign/src/components/AnalyticsDashboard.tsx`)
- Learning analytics → Diagnosis and mastery logic: uses signals (evidence: `nodedesign/src/components/AnalyticsDashboard.tsx`)
- Diagnosis and mastery logic → Curriculum state: updates state (evidence: `README.md`)
