# sardehmoghadam/asvscanvas architecture

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

- Interactive diagram: https://gitdiagram.com/sardehmoghadam/asvscanvas
- Repository: https://github.com/sardehmoghadam/asvscanvas

## Overview

ASVS Academy is a static-first OWASP ASVS training portal. Learners browse chapters and sections to reach individual controls, which present validated MDX lessons; they can also search the control corpus or consult contribution guidance. The map separates routes, structured learning content, reusable presentation, and search/metadata services. Some route and component source was not excerpted, so relationships are included only where the README or SOURCE INDEX documents them; the control MDX directory is described in the README but absent from the supplied tree.

Main entry points: [`lib/content/loader.ts`](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/loader.ts) (Control content loader), [`app/categories/[slug]/page.tsx`](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/categories/%5Bslug%5D/page.tsx) (Chapter page), [`app/page.tsx`](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/page.tsx) (Home page), [`app/controls/[slug]/page.tsx`](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/controls/%5Bslug%5D/page.tsx) (Control lesson)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["Learning routes"]
  node_home["Home page<br/>[page.tsx]"]
  node_chapter["Chapter page<br/>[page.tsx]"]
  node_section["Section page<br/>[page.tsx]"]
  node_control["Control lesson<br/>[page.tsx]"]
  node_searchpage["Search page<br/>[page.tsx]"]
  node_contribute["Contribute guide<br/>[page.tsx]"]
end

subgraph group_content["Learning content"]
  node_chapters["Chapter catalog<br/>[categories.ts]"]
  node_sections["Section catalog<br/>[sections.ts]"]
  node_controlcontent["Control content loader<br/>[loader.ts]"]
  node_schema["Content validation<br/>[schema.ts]"]
  node_standard["ASVS configuration<br/>[standard.ts]"]
  node_types["Content types<br/>[content.ts]"]
end

subgraph group_presentation["Presentation"]
  node_docs["Documentation layout<br/>[docs-layout.tsx]"]
  node_cards["Learning cards<br/>[cards.tsx]"]
  node_breadcrumbs["Breadcrumb navigation<br/>[breadcrumbs.tsx]"]
  node_searchbox["Search box<br/>[search-box.tsx]"]
  node_searchclient["Search results UI<br/>[search-client.tsx]"]
  node_headings["MDX headings<br/>[headings.ts]"]
  node_layout["Site shell<br/>[layout.tsx]"]
end

subgraph group_services["Search and metadata"]
  node_searchindex["Search index<br/>[search.ts]"]
  node_markdown["Markdown text<br/>[markdown-text.ts]"]
  node_siteconfig["Site metadata<br/>[site-config.ts]"]
  node_structured["Structured data<br/>[structured-data.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_home
node_learner -->|"searches"| node_searchpage
node_learner -->|"reads guidance"| node_contribute
node_home -->|"presents chapters"| node_chapters
node_home -->|"loads controls"| node_controlcontent
node_home -->|"renders cards"| node_cards
node_home -->|"renders search"| node_searchbox
node_chapter -->|"looks up chapter"| node_chapters
node_chapter -->|"loads sections"| node_sections
node_chapter -->|"loads controls"| node_controlcontent
node_chapter -->|"links to sections"| node_section
node_chapter -->|"links to controls"| node_control
node_chapter -->|"renders section cards"| node_cards
node_section -->|"loads controls"| node_controlcontent
node_section -->|"uses layout"| node_docs
node_section -->|"renders trail"| node_breadcrumbs
node_control -->|"loads and compiles"| node_controlcontent
node_control -->|"builds outline"| node_headings
node_control -->|"uses layout"| node_docs
node_control -->|"renders trail"| node_breadcrumbs
node_controlcontent -->|"validates frontmatter"| node_schema
node_controlcontent -->|"validates standard data"| node_standard
node_chapters -->|"uses types"| node_types
node_sections -->|"uses types"| node_types
node_searchpage -->|"builds index"| node_searchindex
node_searchpage -->|"renders search UI"| node_searchclient
node_searchindex -->|"indexes controls"| node_controlcontent
node_searchindex -->|"extracts body text"| node_markdown
node_searchclient -->|"filters entries"| node_searchindex
node_layout -->|"emits site data"| node_structured
node_layout -->|"sets metadata"| node_siteconfig
node_structured -->|"resolves URLs"| node_siteconfig
node_siteconfig -->|"reads identity"| node_standard

click node_home "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/page.tsx"
click node_chapter "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/categories/%5Bslug%5D/page.tsx"
click node_section "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/sections/%5Bslug%5D/page.tsx"
click node_control "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/controls/%5Bslug%5D/page.tsx"
click node_searchpage "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/search/page.tsx"
click node_contribute "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/contribute/page.tsx"
click node_chapters "https://github.com/sardehmoghadam/asvscanvas/blob/main/content/categories.ts"
click node_sections "https://github.com/sardehmoghadam/asvscanvas/blob/main/content/sections.ts"
click node_controlcontent "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/loader.ts"
click node_schema "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/schema.ts"
click node_standard "https://github.com/sardehmoghadam/asvscanvas/blob/main/config/standard.ts"
click node_types "https://github.com/sardehmoghadam/asvscanvas/blob/main/types/content.ts"
click node_docs "https://github.com/sardehmoghadam/asvscanvas/blob/main/components/docs-layout.tsx"
click node_cards "https://github.com/sardehmoghadam/asvscanvas/blob/main/components/cards.tsx"
click node_breadcrumbs "https://github.com/sardehmoghadam/asvscanvas/blob/main/components/breadcrumbs.tsx"
click node_searchbox "https://github.com/sardehmoghadam/asvscanvas/blob/main/components/search-box.tsx"
click node_searchclient "https://github.com/sardehmoghadam/asvscanvas/blob/main/components/search-client.tsx"
click node_headings "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/headings.ts"
click node_searchindex "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/search.ts"
click node_markdown "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/markdown-text.ts"
click node_siteconfig "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/site-config.ts"
click node_structured "https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/structured-data.ts"
click node_layout "https://github.com/sardehmoghadam/asvscanvas/blob/main/app/layout.tsx"

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_home,node_chapter,node_section,node_control,node_searchpage,node_contribute toneBlue
class node_chapters,node_sections,node_controlcontent,node_schema,node_standard,node_types toneAmber
class node_docs,node_cards,node_breadcrumbs,node_searchbox,node_searchclient,node_headings,node_layout toneMint
class node_searchindex,node_markdown,node_siteconfig,node_structured toneRose
class node_learner toneIndigo
```

## Components

### Learning routes

- [Home page](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/page.tsx): `app/page.tsx`
- [Chapter page](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/categories/%5Bslug%5D/page.tsx): `app/categories/[slug]/page.tsx`
- [Section page](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/sections/%5Bslug%5D/page.tsx): `app/sections/[slug]/page.tsx`
- [Control lesson](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/controls/%5Bslug%5D/page.tsx): `app/controls/[slug]/page.tsx`
- [Search page](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/search/page.tsx): `app/search/page.tsx`
- [Contribute guide](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/contribute/page.tsx): `app/contribute/page.tsx`

### Learning content

- [Chapter catalog](https://github.com/sardehmoghadam/asvscanvas/blob/main/content/categories.ts): `content/categories.ts`
- [Section catalog](https://github.com/sardehmoghadam/asvscanvas/blob/main/content/sections.ts): `content/sections.ts`
- [Control content loader](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/loader.ts): `lib/content/loader.ts`
- [Content validation](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/schema.ts): `lib/content/schema.ts`
- [ASVS configuration](https://github.com/sardehmoghadam/asvscanvas/blob/main/config/standard.ts): `config/standard.ts`
- [Content types](https://github.com/sardehmoghadam/asvscanvas/blob/main/types/content.ts): `types/content.ts`

### Presentation

- [Documentation layout](https://github.com/sardehmoghadam/asvscanvas/blob/main/components/docs-layout.tsx): `components/docs-layout.tsx`
- [Learning cards](https://github.com/sardehmoghadam/asvscanvas/blob/main/components/cards.tsx): `components/cards.tsx`
- [Breadcrumb navigation](https://github.com/sardehmoghadam/asvscanvas/blob/main/components/breadcrumbs.tsx): `components/breadcrumbs.tsx`
- [Search box](https://github.com/sardehmoghadam/asvscanvas/blob/main/components/search-box.tsx): `components/search-box.tsx`
- [Search results UI](https://github.com/sardehmoghadam/asvscanvas/blob/main/components/search-client.tsx): `components/search-client.tsx`
- [MDX headings](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/headings.ts): `lib/content/headings.ts`
- [Site shell](https://github.com/sardehmoghadam/asvscanvas/blob/main/app/layout.tsx): `app/layout.tsx`

### Search and metadata

- [Search index](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/search.ts): `lib/search.ts`
- [Markdown text](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/content/markdown-text.ts): `lib/content/markdown-text.ts`
- [Site metadata](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/site-config.ts): `lib/site-config.ts`
- [Structured data](https://github.com/sardehmoghadam/asvscanvas/blob/main/lib/structured-data.ts): `lib/structured-data.ts`

### Other components

- **Learner**

## Connections

- Learner → Home page: opens (evidence: `README.md`)
- Learner → Search page: searches (evidence: `README.md`)
- Learner → Contribute guide: reads guidance (evidence: `README.md`)
- Home page → Chapter catalog: presents chapters (evidence: `app/page.tsx`)
- Home page → Control content loader: loads controls (evidence: `app/page.tsx`)
- Home page → Learning cards: renders cards (evidence: `app/page.tsx`)
- Home page → Search box: renders search (evidence: `app/page.tsx`)
- Chapter page → Chapter catalog: looks up chapter (evidence: `app/categories/[slug]/page.tsx`)
- Chapter page → Section catalog: loads sections (evidence: `app/categories/[slug]/page.tsx`)
- Chapter page → Control content loader: loads controls (evidence: `app/categories/[slug]/page.tsx`)
- Chapter page → Section page: links to sections (evidence: `app/categories/[slug]/page.tsx`)
- Chapter page → Control lesson: links to controls (evidence: `app/categories/[slug]/page.tsx`)
- Chapter page → Learning cards: renders section cards (evidence: `app/categories/[slug]/page.tsx`)
- Section page → Control content loader: loads controls (evidence: `app/sections/[slug]/page.tsx`)
- Section page → Documentation layout: uses layout (evidence: `app/sections/[slug]/page.tsx`)
- Section page → Breadcrumb navigation: renders trail (evidence: `app/sections/[slug]/page.tsx`)
- Control lesson → Control content loader: loads and compiles (evidence: `app/controls/[slug]/page.tsx`)
- Control lesson → MDX headings: builds outline (evidence: `app/controls/[slug]/page.tsx`)
- Control lesson → Documentation layout: uses layout (evidence: `app/controls/[slug]/page.tsx`)
- Control lesson → Breadcrumb navigation: renders trail (evidence: `app/controls/[slug]/page.tsx`)
- Control content loader → Content validation: validates frontmatter (evidence: `lib/content/loader.ts`)
- Control content loader → ASVS configuration: validates standard data
- Chapter catalog → Content types: uses types (evidence: `content/categories.ts`)
- Section catalog → Content types: uses types (evidence: `content/sections.ts`)
- Search page → Search index: builds index (evidence: `app/search/page.tsx`)
- Search page → Search results UI: renders search UI (evidence: `app/search/page.tsx`)
- Search index → Control content loader: indexes controls (evidence: `lib/search.ts`)
- Search index → Markdown text: extracts body text (evidence: `lib/search.ts`)
- Search results UI → Search index: filters entries (evidence: `components/search-client.tsx`)
- Site shell → Structured data: emits site data (evidence: `app/layout.tsx`)
- Site shell → Site metadata: sets metadata (evidence: `app/layout.tsx`)
- Structured data → Site metadata: resolves URLs (evidence: `lib/structured-data.ts`)
- Site metadata → ASVS configuration: reads identity (evidence: `lib/site-config.ts`)
