# json-schema-org/tour architecture

> Architecture diagram of the GitHub repository json-schema-org/tour, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/json-schema-org/tour
- Repository: https://github.com/json-schema-org/tour

## Overview

##### Main System Components

The system architecture should be represented with these key components:

a) Frontend Layer:
- Next.js Application (Core)
- Interactive Components
- Content Rendering System
- State Management
- Client-side Functions

b) Content Management Layer:
- MDX Content System
- Schema Validation System
- Progress Tracking System

##### Detailed Component Breakdown

**┌─ Next.js Application ──────────────────────┐**

- ┌─ UI Components ─┐   ┌─ Content Flow ─┐ │
- NavBar         │   │ MDX Renderer   │ │
- CodeEditor     │   │ Content Router │ │
- Output         │   │ Progress Track │ │
- TestCaseWindow │   └───────────────┘ │
- ┘                      │

- ┌─ State Management ┐ ┌─ Validators ───┐ │
- Progress Store   │ │ JSON Schema    │ │
- Content Store    │ │ Test Cases     │ │
- ┘ └───────────────┘ │
- ┘

##### Component Relationships

a) Content Flow:
- Content Manager → MDX Components → Content Viewer
- File System → Content Router → Page Rendering

b) Interactive Flow:
- CodeEditor → Validators → Output
- User Input → Progress Storage → Progress Bar

##### Technical Details

Annotations for:
- Next.js 13+ App Router usage
- MDX processing pipeline
- Client-side validation system
- Progress persistence mechanism

##### Implementation Notes

- The separation between content and presentation
- The interactive nature of the learning platform
- The validation and feedback loop
- The progress tracking system

##### Core Functionality Layer (bottom)

Remember to highlight the project's educational nature and how it handles interactive JSON Schema validation while maintaining a smooth user experience.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI_Layer
        NavBar["Navigation Bar"]
        CodeEditor["Code Editor"]
        Output["Output Display"]
        TestCase["Test Case Window"]
        ProgressBar["Progress Bar"]
        ChapterNav["Chapter Navigation"]
        Outline["Outline System"]
        ContinueBtn["Continue Button"]
    end

    subgraph Content_Management
        MDXRenderer["MDX Renderer"]
        ContentViewer["Content Viewer"]
        ContentRouter["Content Router"]
        MDXContent["MDX Content"]
        ContentManager["Content Manager"]
        ContentVars["Content Variables"]
    end

    subgraph Core_Functionality
        Store["Store System"]
        Reducers["Reducers"]
        ProgressTrack["Progress Tracking"]
        Validators["Validators"]
        ClientFuncs["Client Functions"]
        ServerFuncs["Server Functions"]
        RootLayout["Root Layout"]
        MainPage["Main Page"]
        ContentLayout["Content Layout"]
    end

    %% Relationships
    NavBar --> ContentRouter
    CodeEditor --> Validators
    Validators --> Output
    TestCase --> Validators
    ContentManager --> MDXRenderer
    MDXRenderer --> ContentViewer
    ContentRouter --> ContentViewer
    Store --> ProgressBar
    ChapterNav --> ContentRouter
    Outline --> ContentRouter
    ContinueBtn --> ProgressTrack
    MDXContent --> ContentManager
    ContentVars --> ContentManager
    ProgressTrack --> Store
    Validators --> ClientFuncs
    Validators --> ServerFuncs
    ContentLayout --> RootLayout
    MainPage --> RootLayout

    %% Click Events
    click CodeEditor "https://github.com/json-schema-org/tour/tree/main/app/components/CodeEditor/"
    click Output "https://github.com/json-schema-org/tour/tree/main/app/components/Output/"
    click TestCase "https://github.com/json-schema-org/tour/tree/main/app/components/TestCaseWindow/"
    click NavBar "https://github.com/json-schema-org/tour/tree/main/app/components/NavBar/"
    click MDXRenderer "https://github.com/json-schema-org/tour/tree/main/app/components/Mdx/"
    click ContentViewer "https://github.com/json-schema-org/tour/tree/main/app/components/ContentViewer/"
    click ContentRouter "https://github.com/json-schema-org/tour/tree/main/app/content/[...markdownPath]/"
    click Store "https://github.com/json-schema-org/tour/blob/main/lib/stores.ts"
    click Reducers "https://github.com/json-schema-org/tour/blob/main/lib/reducers.ts"
    click ProgressTrack "https://github.com/json-schema-org/tour/blob/main/lib/progressSaving.ts"
    click MDXContent "https://github.com/json-schema-org/tour/tree/main/content/"
    click ContentManager "https://github.com/json-schema-org/tour/blob/main/lib/contentManager.ts"
    click ContentVars "https://github.com/json-schema-org/tour/blob/main/lib/contentVariables.ts"
    click Validators "https://github.com/json-schema-org/tour/blob/main/lib/validators.ts"
    click ClientFuncs "https://github.com/json-schema-org/tour/blob/main/lib/client-functions.ts"
    click ServerFuncs "https://github.com/json-schema-org/tour/blob/main/lib/server-functions.ts"
    click ProgressBar "https://github.com/json-schema-org/tour/tree/main/app/components/Progressbar/"
    click ChapterNav "https://github.com/json-schema-org/tour/tree/main/app/components/ChapterItem/"
    click Outline "https://github.com/json-schema-org/tour/tree/main/app/components/OutlineDrawer/"
    click ContinueBtn "https://github.com/json-schema-org/tour/tree/main/app/components/ContinueBtn/"
    click RootLayout "https://github.com/json-schema-org/tour/blob/main/app/layout.tsx"
    click MainPage "https://github.com/json-schema-org/tour/blob/main/app/page.tsx"
    click ContentLayout "https://github.com/json-schema-org/tour/blob/main/app/content/layout.tsx"

    %% Styling
    classDef ui fill:#2196F3,color:white
    classDef content fill:#4CAF50,color:white
    classDef core fill:#9C27B0,color:white

    class NavBar,CodeEditor,Output,TestCase,ProgressBar,ChapterNav,Outline,ContinueBtn ui
    class MDXRenderer,ContentViewer,ContentRouter,MDXContent,ContentManager,ContentVars content
    class Store,Reducers,ProgressTrack,Validators,ClientFuncs,ServerFuncs,RootLayout,MainPage,ContentLayout core
```
