# swapnonil2007/wannamath architecture

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

- Interactive diagram: https://gitdiagram.com/swapnonil2007/wannamath
- Repository: https://github.com/swapnonil2007/wannamath

## Overview

Wanna Math is an interactive engineering-mathematics textbook: learners browse a six-volume curriculum, open a chapter, read its mathematical exposition, and use its associated interactive lab. The graph shows that route, lab dispatch and rendering, the shared expression and visualization support, and the homepage’s interactive preview. The README documents the broad curriculum and lab capabilities; source excerpts and index references support the shown wiring. Many individual labs and page implementations were not sampled, so their internal behavior is not inferred.

Main entry points: [`src/app/[volume]/[module]/[chapter]/page.tsx`](https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/%5Bmodule%5D/%5Bchapter%5D/page.tsx) (Chapter Page), [`src/app/page.tsx`](https://github.com/swapnonil2007/wannamath/blob/main/src/app/page.tsx) (Home Page), [`src/components/visualizations/HeroIntegralPreview.tsx`](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegralPreview.tsx) (Integral Preview), [`src/components/math/MathExpressionInput.tsx`](https://github.com/swapnonil2007/wannamath/blob/main/src/components/math/MathExpressionInput.tsx) (Expression Input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum and Routes"]
  node_volume_route["Volume Page<br/>[page.tsx]"]
  node_module_route["Module Page<br/>[page.tsx]"]
  node_curriculum_data["Curriculum Catalog<br/>[curriculum.ts]"]
  node_registry["Curriculum Registry<br/>[index.ts]"]
  node_volume_manifests["Volume Manifests"]
end

subgraph group_learning["Learning Experience"]
  node_chapter_route["Chapter Page<br/>[page.tsx]"]
  node_topic_shell["Topic Page Shell<br/>[TopicPageShell.tsx]"]
end

subgraph group_visualization["Interactive Labs"]
  node_lab_dispatch["Dynamic Lab Renderer"]
  node_lab_loading["Lab Loading State"]
  node_lab_families["Curriculum Labs"]
  node_visual_primitives["Shared Visual Primitives"]
  node_render_loop["Demand Render Loop"]
end

subgraph group_math["Math Support"]
  node_math_input["Expression Input"]
  node_math_parser["Expression Compiler<br/>[mathParser.ts]"]
  node_katex["KaTeX Rendering<br/>[KaTeXMath.tsx]"]
end

subgraph group_discovery["Discovery and Metadata"]
  node_home["Home Page<br/>[page.tsx]"]
  node_hero_loader["Preview Loader"]
  node_hero_preview["Integral Preview"]
  node_hero_viewport["3D Preview Viewport"]
  node_jsonld["Structured Data Output<br/>[JsonLd.tsx]"]
  node_structured_data["Structured Data Builders<br/>[structuredData.ts]"]
  node_site_config["Site Metadata Config<br/>[siteConfig.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_home
node_home -->|"loads volumes"| node_curriculum_data
node_curriculum_data -->|"uses catalog"| node_registry
node_registry -->|"aggregates volumes"| node_volume_manifests
node_learner -->|"browses volumes"| node_volume_route
node_learner -->|"browses modules"| node_module_route
node_learner -->|"opens chapter"| node_chapter_route
node_chapter_route -->|"resolves chapter"| node_registry
node_chapter_route -->|"renders within"| node_topic_shell
node_chapter_route -->|"requests lab"| node_lab_dispatch
node_lab_dispatch -->|"dispatches labs"| node_lab_families
node_lab_dispatch -->|"shows while loading"| node_lab_loading
node_lab_families -.->|"uses shared primitives"| node_visual_primitives
node_visual_primitives -->|"exports render support"| node_render_loop
node_learner -->|"enters expressions"| node_math_input
node_math_input -->|"compiles expression"| node_math_parser
node_math_input -->|"typesets expression"| node_katex
node_chapter_route -->|"renders equations"| node_katex
node_home -->|"shows preview"| node_hero_loader
node_hero_loader -->|"loads preview"| node_hero_preview
node_hero_preview -->|"compiles inputs"| node_math_parser
node_hero_preview -->|"renders controls"| node_math_input
node_hero_preview -->|"typesets formulas"| node_katex
node_hero_preview -->|"renders 3D view"| node_hero_viewport
node_hero_viewport -->|"uses render loop"| node_render_loop
node_home -->|"builds metadata"| node_structured_data
node_chapter_route -->|"builds chapter data"| node_structured_data
node_structured_data -->|"uses site config"| node_site_config
node_home -->|"emits structured data"| node_jsonld
node_chapter_route -->|"emits structured data"| node_jsonld

click node_home "https://github.com/swapnonil2007/wannamath/blob/main/src/app/page.tsx"
click node_volume_route "https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/page.tsx"
click node_module_route "https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/%5Bmodule%5D/page.tsx"
click node_chapter_route "https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/%5Bmodule%5D/%5Bchapter%5D/page.tsx"
click node_curriculum_data "https://github.com/swapnonil2007/wannamath/blob/main/src/registry/curriculum.ts"
click node_registry "https://github.com/swapnonil2007/wannamath/blob/main/src/registry/index.ts"
click node_volume_manifests "https://github.com/swapnonil2007/wannamath/tree/main/src/registry"
click node_topic_shell "https://github.com/swapnonil2007/wannamath/blob/main/src/components/layout/TopicPageShell.tsx"
click node_lab_dispatch "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/DynamicLabRenderer.tsx"
click node_lab_loading "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/LabLoadingSkeleton.tsx"
click node_lab_families "https://github.com/swapnonil2007/wannamath/tree/main/src/components/visualizations"
click node_visual_primitives "https://github.com/swapnonil2007/wannamath/tree/main/src/components/visualizations/primitives"
click node_render_loop "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/primitives/demandRenderLoop.ts"
click node_math_input "https://github.com/swapnonil2007/wannamath/blob/main/src/components/math/MathExpressionInput.tsx"
click node_math_parser "https://github.com/swapnonil2007/wannamath/blob/main/src/lib/mathParser.ts"
click node_katex "https://github.com/swapnonil2007/wannamath/blob/main/src/components/math/KaTeXMath.tsx"
click node_hero_loader "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegralPreviewLoader.tsx"
click node_hero_preview "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegralPreview.tsx"
click node_hero_viewport "https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegral3DViewport.tsx"
click node_jsonld "https://github.com/swapnonil2007/wannamath/blob/main/src/components/seo/JsonLd.tsx"
click node_structured_data "https://github.com/swapnonil2007/wannamath/blob/main/src/lib/seo/structuredData.ts"
click node_site_config "https://github.com/swapnonil2007/wannamath/blob/main/src/lib/seo/siteConfig.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_volume_route,node_module_route,node_curriculum_data,node_registry,node_volume_manifests toneBlue
class node_chapter_route,node_topic_shell toneAmber
class node_lab_dispatch,node_lab_loading,node_lab_families,node_visual_primitives,node_render_loop toneMint
class node_math_input,node_math_parser,node_katex toneRose
class node_home,node_hero_loader,node_hero_preview,node_hero_viewport,node_jsonld,node_structured_data,node_site_config,node_learner toneIndigo
```

## Components

### Curriculum and Routes

- [Volume Page](https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/page.tsx): `src/app/[volume]/page.tsx`
- [Module Page](https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/%5Bmodule%5D/page.tsx): `src/app/[volume]/[module]/page.tsx`
- [Curriculum Catalog](https://github.com/swapnonil2007/wannamath/blob/main/src/registry/curriculum.ts): `src/registry/curriculum.ts`
- [Curriculum Registry](https://github.com/swapnonil2007/wannamath/blob/main/src/registry/index.ts): `src/registry/index.ts`
- [Volume Manifests](https://github.com/swapnonil2007/wannamath/tree/main/src/registry): `src/registry`

### Learning Experience

- [Chapter Page](https://github.com/swapnonil2007/wannamath/blob/main/src/app/%5Bvolume%5D/%5Bmodule%5D/%5Bchapter%5D/page.tsx): `src/app/[volume]/[module]/[chapter]/page.tsx`
- [Topic Page Shell](https://github.com/swapnonil2007/wannamath/blob/main/src/components/layout/TopicPageShell.tsx): `src/components/layout/TopicPageShell.tsx`

### Interactive Labs

- [Dynamic Lab Renderer](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/DynamicLabRenderer.tsx): `src/components/visualizations/DynamicLabRenderer.tsx`
- [Lab Loading State](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/LabLoadingSkeleton.tsx): `src/components/visualizations/LabLoadingSkeleton.tsx`
- [Curriculum Labs](https://github.com/swapnonil2007/wannamath/tree/main/src/components/visualizations): `src/components/visualizations`
- [Shared Visual Primitives](https://github.com/swapnonil2007/wannamath/tree/main/src/components/visualizations/primitives): `src/components/visualizations/primitives`
- [Demand Render Loop](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/primitives/demandRenderLoop.ts): `src/components/visualizations/primitives/demandRenderLoop.ts`

### Math Support

- [Expression Input](https://github.com/swapnonil2007/wannamath/blob/main/src/components/math/MathExpressionInput.tsx): `src/components/math/MathExpressionInput.tsx`
- [Expression Compiler](https://github.com/swapnonil2007/wannamath/blob/main/src/lib/mathParser.ts): `src/lib/mathParser.ts`
- [KaTeX Rendering](https://github.com/swapnonil2007/wannamath/blob/main/src/components/math/KaTeXMath.tsx): `src/components/math/KaTeXMath.tsx`

### Discovery and Metadata

- [Home Page](https://github.com/swapnonil2007/wannamath/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Preview Loader](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegralPreviewLoader.tsx): `src/components/visualizations/HeroIntegralPreviewLoader.tsx`
- [Integral Preview](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegralPreview.tsx): `src/components/visualizations/HeroIntegralPreview.tsx`
- [3D Preview Viewport](https://github.com/swapnonil2007/wannamath/blob/main/src/components/visualizations/HeroIntegral3DViewport.tsx): `src/components/visualizations/HeroIntegral3DViewport.tsx`
- [Structured Data Output](https://github.com/swapnonil2007/wannamath/blob/main/src/components/seo/JsonLd.tsx): `src/components/seo/JsonLd.tsx`
- [Structured Data Builders](https://github.com/swapnonil2007/wannamath/blob/main/src/lib/seo/structuredData.ts): `src/lib/seo/structuredData.ts`
- [Site Metadata Config](https://github.com/swapnonil2007/wannamath/blob/main/src/lib/seo/siteConfig.ts): `src/lib/seo/siteConfig.ts`

### Other components

- **Learner**

## Connections

- Learner → Home Page: opens (evidence: `README.md`)
- Home Page → Curriculum Catalog: loads volumes (evidence: `src/app/page.tsx`)
- Curriculum Catalog → Curriculum Registry: uses catalog (evidence: `src/registry/curriculum.ts`)
- Curriculum Registry → Volume Manifests: aggregates volumes (evidence: `src/registry/index.ts`)
- Learner → Volume Page: browses volumes (evidence: `README.md`)
- Learner → Module Page: browses modules (evidence: `README.md`)
- Learner → Chapter Page: opens chapter (evidence: `README.md`)
- Chapter Page → Curriculum Registry: resolves chapter (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
- Chapter Page → Topic Page Shell: renders within (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
- Chapter Page → Dynamic Lab Renderer: requests lab (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
- Dynamic Lab Renderer → Curriculum Labs: dispatches labs (evidence: `src/components/visualizations/DynamicLabRenderer.tsx`)
- Dynamic Lab Renderer → Lab Loading State: shows while loading (evidence: `src/components/visualizations/DynamicLabRenderer.tsx`)
- Curriculum Labs → Shared Visual Primitives: uses shared primitives (evidence: `src/components/visualizations/coordinate-systems/Curvilinear3DSurfacesAndElementLab.tsx`)
- Shared Visual Primitives → Demand Render Loop: exports render support (evidence: `src/components/visualizations/primitives/index.ts`)
- Learner → Expression Input: enters expressions (evidence: `README.md`)
- Expression Input → Expression Compiler: compiles expression (evidence: `src/components/math/MathExpressionInput.tsx`)
- Expression Input → KaTeX Rendering: typesets expression (evidence: `src/components/math/MathExpressionInput.tsx`)
- Chapter Page → KaTeX Rendering: renders equations (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
- Home Page → Preview Loader: shows preview (evidence: `src/app/page.tsx`)
- Preview Loader → Integral Preview: loads preview (evidence: `src/components/visualizations/HeroIntegralPreviewLoader.tsx`)
- Integral Preview → Expression Compiler: compiles inputs (evidence: `src/components/visualizations/HeroIntegralPreview.tsx`)
- Integral Preview → Expression Input: renders controls (evidence: `src/components/visualizations/HeroIntegralPreview.tsx`)
- Integral Preview → KaTeX Rendering: typesets formulas (evidence: `src/components/visualizations/HeroIntegralPreview.tsx`)
- Integral Preview → 3D Preview Viewport: renders 3D view (evidence: `src/components/visualizations/HeroIntegralPreview.tsx`)
- 3D Preview Viewport → Demand Render Loop: uses render loop (evidence: `src/components/visualizations/HeroIntegral3DViewport.tsx`)
- Home Page → Structured Data Builders: builds metadata (evidence: `src/app/page.tsx`)
- Chapter Page → Structured Data Builders: builds chapter data (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
- Structured Data Builders → Site Metadata Config: uses site config (evidence: `src/lib/seo/structuredData.ts`)
- Home Page → Structured Data Output: emits structured data (evidence: `src/app/page.tsx`)
- Chapter Page → Structured Data Output: emits structured data (evidence: `src/app/[volume]/[module]/[chapter]/page.tsx`)
