# vazco/uniforms architecture

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

- Interactive diagram: https://gitdiagram.com/vazco/uniforms
- Repository: https://github.com/vazco/uniforms

## Overview

##### Project Type and Purpose
- This is a monorepo containing multiple npm packages. Its purpose is to supply a core React library that abstracts form rendering (the “Uniforms Core”) along with several theme integrations (like AntD, Bootstrap4, Bootstrap5, MUI, Semantic, and an unstyled version) and “bridge” packages that integrate support for different validation/ schema formats (JSON Schema, SimpleSchema2, Zod, etc.).
- Additionally, the repository includes documentation (the website folder), sample reproductions demonstrating usage, tests, configuration files, CI/CD workflows, and developer tooling.

##### High-Level Components
- Core Library Component:
- Theme Integration Modules:
- “theme” package as separate components. Examples include:
- Uniforms for AntD (packages/uniforms-antd)
- Uniforms for Bootstrap4 (packages/uniforms-bootstrap4)
- Uniforms for Bootstrap5 (packages/uniforms-bootstrap5)
- Uniforms for MUI (packages/uniforms-mui)
- Uniforms for Semantic (packages/uniforms-semantic)
- Uniforms Unstyled (packages/uniforms-unstyled)
- These packages extend the core functionality and offer UI-specific implementations.
- Bridge/Schema Integration Components:
- “bridge” packages that integrate various schema validation libraries:
- uniforms-bridge-json-schema
- uniforms-bridge-simple-schema-2
- uniforms-bridge-zod
- These components provide adapters that allow users to plug in different validation or schema types.
- Testing and Reproduction:
- A “Testing & Reproduction” module that encompasses the tests (found in __tests__ directories across packages) and the “reproductions” folder. This segment demonstrates usage and ensures integrity.
- Documentation and Website:
- A component for the Website/Docs (website folder). This part is built with Docusaurus (as indicated by the docusaurus.config.ts) and contains guides, API references, examples, and marketing content.
- CI/CD and Developer Tooling:
- Optionally, include a smaller component for developer workflows (GitHub workflows, husky pre-commit hooks, linting, prettier, eslint) that support continuous integration and enforce code quality.

##### Architectural Patterns and Design Principles
- The project embraces a modular monorepo setup where each package can be developed, versioned, and tested independently while sharing a common core.
- There is a clear separation of concerns: one part provides core form logic, another provides integration with UI toolkits, and yet another set provides schema adapters.

- Component is clearly label­ed.
- Aim to capture every essential aspect: not only the React libraries and theme packages but also the peripheral parts such as testing, reproductions, and website documentation.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Packages Subgraph
    subgraph "Packages"
        UC["Uniforms Core<br/>(AutoForm, BaseForm, QuickForm, etc.)"] 
        subgraph "Theme Integrations"
            UA["Uniforms for AntD<br/>(AntD theme implementation)"]
            UB4["Uniforms for Bootstrap4<br/>(Bootstrap4 theme)"]
            UB5["Uniforms for Bootstrap5<br/>(Bootstrap5 theme)"]
            UM["Uniforms for MUI<br/>(MUI integration)"]
            USem["Uniforms for Semantic<br/>(Semantic UI integration)"]
            UUnstyled["Uniforms Unstyled<br/>(No styling)"]
        end
        subgraph "Bridge Schema Integrations"
            BJSON["Bridge - JSON Schema<br/>(Adapter for JSON Schema)"]
            BSS["Bridge - SimpleSchema2<br/>(Adapter for SimpleSchema2)"]
            BZ["Bridge - Zod<br/>(Adapter for Zod)"]
        end
    end

    %% Peripheral Modules Subgraph
    subgraph "Peripheral Modules"
        TR["Testing & Reproduction<br/>(__tests__ & reproductions)"]
        Doc["Documentation and Website<br/>(Docusaurus)"]
        Tool["CI/CD and Developer Tooling<br/>(Workflows, husky, scripts)"]
    end

    %% Core to Themes
    UC -->|"depends"| UA
    UC -->|"depends"| UB4
    UC -->|"depends"| UB5
    UC -->|"depends"| UM
    UC -->|"depends"| USem
    UC -->|"depends"| UUnstyled

    %% Core to Bridges
    UC -->|"integrates"| BJSON
    UC -->|"integrates"| BSS
    UC -->|"integrates"| BZ

    %% Testing interactions with all packages
    TR ---|"tests"| UC
    TR ---|"tests"| UA
    TR ---|"tests"| UB4
    TR ---|"tests"| UB5
    TR ---|"tests"| UM
    TR ---|"tests"| USem
    TR ---|"tests"| UUnstyled
    TR ---|"tests"| BJSON
    TR ---|"tests"| BSS
    TR ---|"tests"| BZ

    %% Documentation connections
    Doc -->|"documents"| UC
    Doc -->|"documents"| UA
    Doc -->|"documents"| UB4
    Doc -->|"documents"| UB5
    Doc -->|"documents"| UM
    Doc -->|"documents"| USem
    Doc -->|"documents"| UUnstyled
    Doc -->|"documents"| BJSON
    Doc -->|"documents"| BSS
    Doc -->|"documents"| BZ

    %% CI/CD Tooling influences all components
    Tool -->|"CI/CD"| UC
    Tool -->|"CI/CD"| UA
    Tool -->|"CI/CD"| UB4
    Tool -->|"CI/CD"| UB5
    Tool -->|"CI/CD"| UM
    Tool -->|"CI/CD"| USem
    Tool -->|"CI/CD"| UUnstyled
    Tool -->|"CI/CD"| BJSON
    Tool -->|"CI/CD"| BSS
    Tool -->|"CI/CD"| BZ
    Tool -->|"CI/CD"| TR
    Tool -->|"CI/CD"| Doc

    %% Styles
    class UC core
    class UA,UB4,UB5,UM,USem,UUnstyled theme
    class BJSON,BSS,BZ bridge
    class TR testing
    class Doc documentation
    class Tool tooling

    classDef core fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef theme fill:#80dfff,stroke:#333,stroke-width:2px;
    classDef bridge fill:#d580ff,stroke:#333,stroke-width:2px;
    classDef testing fill:#ffb84d,stroke:#333,stroke-width:2px;
    classDef documentation fill:#b6e3a7,stroke:#333,stroke-width:2px;
    classDef tooling fill:#cccccc,stroke:#333,stroke-width:2px;

    %% Click Events
    click UC "https://github.com/vazco/uniforms/tree/master/packages/uniforms"
    click UA "https://github.com/vazco/uniforms/tree/master/packages/uniforms-antd"
    click UB4 "https://github.com/vazco/uniforms/tree/master/packages/uniforms-bootstrap4"
    click UB5 "https://github.com/vazco/uniforms/tree/master/packages/uniforms-bootstrap5"
    click UM "https://github.com/vazco/uniforms/tree/master/packages/uniforms-mui"
    click USem "https://github.com/vazco/uniforms/tree/master/packages/uniforms-semantic"
    click UUnstyled "https://github.com/vazco/uniforms/tree/master/packages/uniforms-unstyled"
    click BJSON "https://github.com/vazco/uniforms/tree/master/packages/uniforms-bridge-json-schema"
    click BSS "https://github.com/vazco/uniforms/tree/master/packages/uniforms-bridge-simple-schema-2"
    click BZ "https://github.com/vazco/uniforms/tree/master/packages/uniforms-bridge-zod"
    click TR "https://github.com/vazco/uniforms/tree/master/reproductions"
    click Doc "https://github.com/vazco/uniforms/tree/master/website"
    click Tool "https://github.com/vazco/uniforms/blob/master/.github"
```
