# idelic-inc/idelic-js architecture

> Architecture diagram of the GitHub repository idelic-inc/idelic-js, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/idelic-inc/idelic-js
- Repository: https://github.com/idelic-inc/idelic-js

## Overview

##### Main Components Structure
a. formatron
b. formatron-react
c. safety-net
d. safety-suite-api

##### Package-Specific Components

For formatron:
- It as the core data modeling package
- Subcomponents for:
- Data Types (boolean, datetime, enum, etc.)
- Model Management
- Template System
- Type Definitions

For formatron-react:
- As a UI implementation layer
- Connections to:
- FluentUI Components
- Material UI Components
- Vanilla Components
- Form Management System
- Custom Hooks

For safety-net:
- As a utility/helper package
- Components for:
- Error Handling
- Promise Management
- Request/Response Handling
- Retry Logic

For safety-suite-api:
- As the main API integration layer
- Subcomponents for:
- API Services (Authentication, Claims, Configuration, etc.)
- Model Management
- React Integration
- User Management
- Permissions System

##### Dependencies and Relationships
- That formatron-react depends on formatron
- That safety-suite-api likely depends on safety-net
- External dependencies like FluentUI and Material-UI

##### Additional Elements
- A Docker container representation (shown by Dockerfile presence)
- Build/configuration nodes (TypeScript, ESLint, Prettier)
- Test infrastructure components

##### Notes Section
A notes section indicating:
- Monorepo management with Lerna
- TypeScript usage throughout
- Docker deployment capabilities
- Testing infrastructure

Remember to include version control and CI/CD aspects, as indicated by the presence of GitHub-related files and Docker configuration.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Package]:::package
        L2([Component]):::component
        L3{{External}}:::external
        L4[/API Service/]:::api
        L5{Core Function}:::core
    end

    subgraph "Idelic JS Monorepo"
        subgraph "External Dependencies"
            FluentUI{{FluentUI}}:::external
            MaterialUI{{Material UI}}:::external
            Docker{{Docker}}:::external
            Lerna{{Lerna}}:::external
        end

        subgraph "Safety Suite API"
            SSAPI[Safety Suite API]:::package
            APIServices[/API Services/]:::api
            ModelMgmt([Model Management]):::component
            ReactInteg([React Integration]):::component
            UserMgmt([User Management]):::component
            Permissions([Permissions System]):::component

            SSAPI --> APIServices
            SSAPI --> ModelMgmt
            SSAPI --> ReactInteg
            SSAPI --> UserMgmt
            SSAPI --> Permissions
        end

        subgraph "Safety Net"
            SafetyNet[Safety Net]:::package
            ErrorHandling([Error Handling]):::component
            PromiseMgmt([Promise Management]):::component
            ReqRes([Request/Response]):::component
            RetryLogic([Retry Logic]):::component

            SafetyNet --> ErrorHandling
            SafetyNet --> PromiseMgmt
            SafetyNet --> ReqRes
            SafetyNet --> RetryLogic
        end

        subgraph "Formatron React"
            FReact[Formatron React]:::package
            FluentComps([FluentUI Components]):::component
            MaterialComps([Material UI Components]):::component
            VanillaComps([Vanilla Components]):::component
            FormMgmt([Form Management]):::component
            CustomHooks([Custom Hooks]):::component

            FReact --> FluentComps
            FReact --> MaterialComps
            FReact --> VanillaComps
            FReact --> FormMgmt
            FReact --> CustomHooks
        end

        subgraph "Formatron Core"
            Formatron[Formatron]:::package
            DataTypes{Data Types}:::core
            ModelMgmtCore{Model Management}:::core
            TemplateSystem{Template System}:::core
            TypeDefs{Type Definitions}:::core

            Formatron --> DataTypes
            Formatron --> ModelMgmtCore
            Formatron --> TemplateSystem
            Formatron --> TypeDefs
        end

        %% Dependencies
        FReact --> Formatron
        SSAPI --> SafetyNet
        FluentComps --> FluentUI
        MaterialComps --> MaterialUI
    end

    %% Styles
    classDef package fill:#2196F3,stroke:#1565C0,color:white
    classDef component fill:#4CAF50,stroke:#388E3C,color:white
    classDef external fill:#FFA726,stroke:#F57C00,color:white
    classDef api fill:#EC407A,stroke:#D81B60,color:white
    classDef core fill:#7E57C2,stroke:#5E35B1,color:white

    %% Click Events
    click DataTypes "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron/src/dataTypes/"
    click ModelMgmtCore "https://github.com/idelic-inc/idelic-js/blob/master/packages/formatron/src/model.ts"
    click TemplateSystem "https://github.com/idelic-inc/idelic-js/blob/master/packages/formatron/src/template.ts"
    click FluentComps "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron-react/src/form/fluentui/"
    click MaterialComps "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron-react/src/form/materialui/"
    click VanillaComps "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron-react/src/form/vanilla/"
    click FormMgmt "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron-react/src/form/"
    click CustomHooks "https://github.com/idelic-inc/idelic-js/tree/master/packages/formatron-react/src/hooks/"
    click ErrorHandling "https://github.com/idelic-inc/idelic-js/blob/master/packages/safety-net/src/error.ts"
    click PromiseMgmt "https://github.com/idelic-inc/idelic-js/blob/master/packages/safety-net/src/promise.ts"
    click ReqRes "https://github.com/idelic-inc/idelic-js/blob/master/packages/safety-net/src/request.ts"
    click RetryLogic "https://github.com/idelic-inc/idelic-js/blob/master/packages/safety-net/src/retry.ts"
    click APIServices "https://github.com/idelic-inc/idelic-js/tree/master/packages/safety-suite-api/src/api/"
    click ModelMgmt "https://github.com/idelic-inc/idelic-js/tree/master/packages/safety-suite-api/src/api/models/"
    click ReactInteg "https://github.com/idelic-inc/idelic-js/tree/master/packages/safety-suite-api/src/react/"
    click UserMgmt "https://github.com/idelic-inc/idelic-js/tree/master/packages/safety-suite-api/src/api/userManagement/"
    click Permissions "https://github.com/idelic-inc/idelic-js/tree/master/packages/safety-suite-api/src/api/permission/"
```
