# reorx/jsoncv architecture

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

- Interactive diagram: https://gitdiagram.com/reorx/jsoncv
- Repository: https://github.com/reorx/jsoncv

## Overview

##### Main Components Overview

- Schema System
- Editor Interface
- CV HTML Generator
- Converters
- Build System

##### Detailed Component Breakdown

- JSON Schema (draft-07)
- Custom extensions (sideProjects, meta.name)
- Validation layer

- Left Panel: Navigation Sidebar
- Middle Panel: Schema Form
- Right Panel: Live Preview
- Local Storage Integration

- Theme Engine
- Template Processor
- Style Processor
- Build Pipeline

- Vite Configuration
- Asset Processing
- Bundle Generation

**User Input -> Editor Interface**
- ↓
**Schema Validation**
- ↓
**Local Storage <-> Editor State**
- ↓
**Template Processing -> Theme Application**
- ↓
**Final HTML/CSS Generation**
- ↓
**Export Options (HTML/PDF)**

##### Key Design Patterns to Highlight

a. Component Architecture:
- Modular theme system
- Converter pipeline
- Demonstrate the template rendering flow

b. Data Flow:
- JSON data validation path
- Theme application process
- Export pipeline

##### Implementation Details

a. File Structure Organization:
- src/
- editor/
- lib/
- preview/
- themes/
- converters/
- schema/

b. Build Process Flow:
- Development server
- Production build
- Static site generation

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Components"]
        direction TB
        Schema["Schema System"]
        Editor["Editor Interface"]
        Generator["CV HTML Generator"]
        Conv["Converters"]
        Build["Build System"]
    end

    subgraph SchemaSystem["Schema Layer"]
        direction TB
        JSONSchema["JSON Schema (draft-07)"]
        CustomExt["Custom Extensions"]
        Validation["Validation Layer"]
    end

    subgraph EditorInterface["Editor Interface"]
        direction TB
        NavPanel["Navigation Sidebar"]
        SchemaForm["Schema Form"]
        LivePreview["Live Preview"]
        LocalStore["Local Storage"]
    end

    subgraph GeneratorSystem["Generator System"]
        direction TB
        ThemeEngine["Theme Engine"]
        TemplateProc["Template Processor"]
        StyleProc["Style Processor"]
        BuildPipe["Build Pipeline"]
    end

    subgraph BuildSystem["Build Infrastructure"]
        direction TB
        ViteConfig["Vite Configuration"]
        AssetProc["Asset Processing"]
        BundleGen["Bundle Generation"]
    end

    subgraph External["External Systems"]
        direction TB
        PrintAPI["Browser Print API"]
        FileSystem["Local File System"]
        WebHost["Web Hosting"]
    end

    UserInput[/"User Input"/] --> Editor
    Editor --> Validation
    LocalStore <--> Editor
    Editor --> TemplateProc
    TemplateProc --> ThemeEngine
    ThemeEngine --> Generator
    Generator --> ExportOpt[/"Export (HTML/PDF)"/]

    Schema --> Validation
    Generator --> BuildPipe
    BuildPipe --> BundleGen
    Conv --> Generator

    classDef core fill:#2374ab,stroke-dasharray: 5 5,rx:10
    classDef schema fill:#2a9d8f,stroke-dasharray: 5 5,rx:10
    classDef editor fill:#e9c46a,stroke-dasharray: 5 5,rx:10
    classDef generator fill:#f4a261,stroke-dasharray: 5 5,rx:10
    classDef build fill:#264653,stroke-dasharray: 5 5,rx:10
    classDef external fill:#e76f51,stroke-dasharray: 5 5,rx:10
    classDef input fill:#grey,rx:10
    classDef default rx:10

    class Schema,Editor,Generator,Conv,Build core
    class JSONSchema,CustomExt,Validation schema
    class NavPanel,SchemaForm,LivePreview,LocalStore editor
    class ThemeEngine,TemplateProc,StyleProc,BuildPipe generator
    class ViteConfig,AssetProc,BundleGen build
    class PrintAPI,FileSystem,WebHost external
    class UserInput,ExportOpt input

    click Schema "https://github.com/reorx/jsoncv/blob/master//schema/jsoncv.schema.json"
    click Editor "https://github.com/reorx/jsoncv/blob/master//src/editor/main.js"
    click Generator "https://github.com/reorx/jsoncv/blob/master//src/themes/index.js"
    click Conv "https://github.com/reorx/jsoncv/blob/master//converters/rxresume-to-jsonresume.js"
    click Build "https://github.com/reorx/jsoncv/blob/master//vite.config.js"
    click ThemeEngine "https://github.com/reorx/jsoncv/blob/master//src/themes/reorx/index.ejs"
    click StyleProc "https://github.com/reorx/jsoncv/blob/master//src/scss/cv-base.css"
    click LocalStore "https://github.com/reorx/jsoncv/blob/master//src/lib/store.js"
    click LivePreview "https://github.com/reorx/jsoncv/blob/master//src/preview/main.js"
    click SchemaForm "https://github.com/reorx/jsoncv/blob/master//src/editor/je-theme.js"
    click TemplateProc "https://github.com/reorx/jsoncv/blob/master//src/templates/meta.ejs"
    click ViteConfig "https://github.com/reorx/jsoncv/blob/master//src/lib/vite-plugins.js"
```
