# surveyjs/survey-creator architecture

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

- Interactive diagram: https://gitdiagram.com/surveyjs/survey-creator
- Repository: https://github.com/surveyjs/survey-creator

## Overview

##### Project type and purpose
- This is a monorepo for a client-side, no-backend form-builder component suite (“SurveyJS Creator”).
- It provides a core engine in TypeScript plus framework-specific UI wrappers (Angular, React, Vue, Knockout/jQuery).
- Developers install one of the framework packages in their front-end app to embed a drag-and-drop JSON form designer.

##### File structure
- Top-level config and tooling: lerna.json, package.json, ESLint, Husky, GitHub Actions workflows, Azure pipelines.
- `/packages/survey-creator-core`: the engine and base UI components, built with Rollup, tested with Jest, bundled to multiple targets (themes, i18n, presets).
- `/packages/survey-creator-{angular, react, vue, js}`: framework adapters and example apps. Each has its own build config (angular.json, webpack or rollup, tsconfig), test setups (TestCafe, Playwright, Jest).
- `docs`, `CHANGELOG.md`, `CONTRIBUTING.md`, etc. provide user documentation and guides.
- Test suites: unit tests in core, functional and accessibility tests for packages, visual-regression tests.
- CI/CD manifests: GitHub Actions (`ci.yml`, release workflows), Azure pipelines, visual-regression workflows.

##### README for additional insights
- Emphasizes zero-server, 100% client form builder.
- Notes native support for React/Angular/Vue/Knockout via wrappers over the core.
- Highlights extensibility (custom questions, themes, localization) and integration points (export JSON schema, save to any backend).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Components
    subgraph "Runtime Components"
        Core["Core Engine"]:::runtime
        subgraph "Framework Adapters"
            Angular["Angular Adapter"]:::runtime
            React["React Adapter"]:::runtime
            Vue["Vue Adapter"]:::runtime
            JS["Knockout/JS Adapter"]:::runtime
        end
        subgraph "Example Applications"
            AEx["Angular Example App"]:::runtime
            REx["React Example App"]:::runtime
            VEx["Vue Example App"]:::runtime
        end
    end

    %% Build & Packaging
    subgraph "Build & Packaging"
        Lerna["Lerna (Monorepo Manager)"]:::build
        RollupCore["Core Rollup Builds"]:::build
        RollupAdapters["Adapters Bundle Builds"]:::build
    end

    %% Testing Infrastructure
    subgraph "Testing Infrastructure"
        Unit["Unit Tests (Jest)"]:::test
        E2E["E2E Tests (TestCafe/Playwright)"]:::test
        Visual["Visual Regression"]:::test
        Accessibility["Accessibility Tests"]:::test
    end

    %% CI/CD
    subgraph "CI/CD Pipelines"
        GHActions["GitHub Actions"]:::ci
        Azure["Azure Pipelines"]:::ci
        VRWorkflows["Visual-Regression Workflows"]:::ci
    end

    %% Documentation & Tooling
    subgraph "Documentation & Tooling"
        Docs["docs/ Site"]:::doc
        CLI["CLI Scripts & Generators"]:::doc
    end

    %% Dependencies & Flows
    Angular -->|"depends on"| Core
    React -->|"depends on"| Core
    Vue -->|"depends on"| Core
    JS -->|"depends on"| Core

    AEx -->|"imports"| Angular
    REx -->|"imports"| React
    VEx -->|"imports"| Vue

    Lerna --> RollupCore
    Lerna --> RollupAdapters
    RollupCore -->|"produces bundles for"| Core
    RollupAdapters -->|"produces bundles for"| Angular
    RollupAdapters -->|"produces bundles for"| React
    RollupAdapters -->|"produces bundles for"| Vue
    RollupAdapters -->|"produces bundles for"| JS

    GHActions -->|"triggers"| RollupCore
    GHActions -->|triggers| RollupAdapters
    GHActions -->|runs| Unit
    GHActions -->|runs| E2E
    GHActions -->|runs| Visual
    GHActions -->|runs| Accessibility

    Azure -->|"collects coverage"| Unit
    Azure -->|"executes"| E2E

    VRWorkflows -->|"executes visual tests"| Visual

    Docs -->|"reads metadata"| Core
    CLI -->|"updates versions & copies tests"| Core

    %% Click Events
    click Core "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-core"
    click Angular "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-angular"
    click React "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-react"
    click Vue "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-vue"
    click JS "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-js"
    click AEx "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-angular/example/angular-ui"
    click REx "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-react/example"
    click VEx "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-vue/example"
    click RollupCore "https://github.com/surveyjs/survey-creator/blob/master/packages/survey-creator-core/rollup.config.js"
    click Docs "https://github.com/surveyjs/survey-creator/tree/master/docs/"
    click CLI "https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-core/doc_generator"

    %% Styles
    classDef runtime fill:#ccf,stroke:#339,stroke-width:2px
    classDef build fill:#cfc,stroke:#393,stroke-width:2px
    classDef test fill:#ffc,stroke:#e90,stroke-width:2px
    classDef ci fill:#fcc,stroke:#933,stroke-width:2px
    classDef doc fill:#ddd,stroke:#666,stroke-width:2px
```
