# facets-cloud/inca architecture

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

- Interactive diagram: https://gitdiagram.com/facets-cloud/inca
- Repository: https://github.com/facets-cloud/inca

## Overview

##### Main Components

a) Catalog Layer
- Should include the Intent Types Registry (based on the intent_types directory)
- Versioning structure (v1alpha1 format seen in the MySQL example)

b) Schema Definition Layer
- JSON schema system (evident from schema.json files)
- Validation and type definition components
- Relationship with intent types

c) Implementation Layer
- How different infrastructure providers can be plugged in
- Demonstrate the abstraction between intent and actual implementation
- Sample implementations (like MySQL shown in the intent_types)

##### Relationships to Highlight

**[Catalog Definition] → [Intent Type Registry] → [Schema Validation] → [Implementation Layer] → [Cloud Providers]**

##### Specific Elements

- Rectangle: Intent Type Registry
- Hexagon: Schema Validators

##### Hierarchical Structure

Top to Bottom:

##### Important Details to Capture

- Version control system for intent types (v1alpha1 structure)
- Schema validation flow
- Implementation flexibility
- Provider-agnostic nature
- Utility functions and tools

##### Specific Project Elements

- Intent type registration system
- MySQL as a sample intent type
- Schema validation flow
- Index management system (from utils/update_index.py)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef core fill:#2374AB,color:white
    classDef schema fill:#45B7D1,color:white
    classDef implementation fill:#FF8C42,color:white
    classDef provider fill:#848FA5,color:white
    classDef docs fill:#957DAD,color:white
    classDef utility fill:#7DBA84,color:white

    %% User/Client Layer
    Client[Client/User Interface]

    %% Catalog Abstract Layer
    subgraph CatalogLayer[Catalog Layer]
        CatalogCore[Catalog Core]:::core
        IntentRegistry[Intent Types Registry]:::core
        VersionMgmt[Version Management]:::core
    end

    %% Schema Layer
    subgraph SchemaLayer[Schema Definition Layer]
        SchemaVal[Schema Validation System]:::schema
        TypeDef[Intent Type Definition]:::schema
    end

    %% Implementation Layer
    subgraph ImplLayer[Implementation Layer]
        ImplCore[Implementation Core]:::implementation
        ImplExample[Implementation Examples]:::implementation
        ImplGuide[Implementation Guidelines]:::implementation
    end

    %% Provider Layer
    subgraph Providers[Cloud Providers]
        AWS[AWS]:::provider
        GCP[GCP]:::provider
        Azure[Azure]:::provider
    end

    %% Documentation
    subgraph Docs[Documentation]
        IntentDocs[Intent Type Documentation]:::docs
        UseCaseDocs[Use Case Documentation]:::docs
    end

    %% Utility
    IndexUtil[Index Management Utility]:::utility

    %% Relationships
    Client --> CatalogCore
    CatalogCore --> IntentRegistry
    IntentRegistry --> SchemaVal
    SchemaVal --> TypeDef
    TypeDef --> ImplCore
    ImplCore --> ImplExample
    ImplExample --> Providers
    IndexUtil --> IntentRegistry
    VersionMgmt --> SchemaVal
    ImplGuide --> ImplCore

    %% Click Events
    click CatalogCore "https://github.com/Facets-cloud/InCa/tree/main/intent_types/"
    click IntentRegistry "https://github.com/Facets-cloud/InCa/blob/main/intent_types/index.yaml"
    click SchemaVal "https://github.com/Facets-cloud/InCa/blob/main/intent_types/mysql/v1alpha1/schema.json"
    click TypeDef "https://github.com/Facets-cloud/InCa/blob/main/intent_types/mysql/v1alpha1/intent_type.json"
    click ImplExample "https://github.com/Facets-cloud/InCa/blob/main/intent_types/mysql/v1alpha1/sample.json"
    click VersionMgmt "https://github.com/Facets-cloud/InCa/tree/main/intent_types/mysql/v1alpha1/"
    click IndexUtil "https://github.com/Facets-cloud/InCa/blob/main/intent_types/utils/update_index.py"
    click ImplGuide "https://github.com/Facets-cloud/InCa/blob/main/intent_types/README.md"
    click IntentDocs "https://github.com/Facets-cloud/InCa/blob/main/docs/3_intent_type.md"
    click ImplGuide "https://github.com/Facets-cloud/InCa/blob/main/docs/4_adding_intent_types.md"
    click UseCaseDocs "https://github.com/Facets-cloud/InCa/blob/main/docs/5_usecases.md"

    %% Legend
    subgraph Legend
        CoreLegend[Core Components]:::core
        SchemaLegend[Schema Components]:::schema
        ImplLegend[Implementation Components]:::implementation
        ProviderLegend[Cloud Providers]:::provider
        DocsLegend[Documentation]:::docs
        UtilLegend[Utilities]:::utility
    end
```
