{
    "$schema": "https://calm.finos.org/release/1.2/meta/calm.json",
    "unique-id": "finos-calm-monorepo",
    "name": "FINOS Architecture as Code (CALM) Monorepo",
    "description": "Architecture of the FINOS CALM (Common Architecture Language Model) open-source monorepo, including the CALM Hub backend, UI, CLI tooling, and VS Code extension.",
    "nodes": [
        {
            "unique-id": "architect",
            "node-type": "actor",
            "name": "Architect / Developer",
            "description": "Software architect or developer who uses CALM tooling to model, validate, and manage architectural artifacts."
        },
        {
            "unique-id": "calm-hub",
            "node-type": "service",
            "name": "CALM Hub",
            "description": "Quarkus/Java REST API backend for storing, retrieving, and serving CALM namespaces, architectures, patterns, flows, standards, and controls; also exposes an embedded MCP endpoint at /mcp.",
            "interfaces": [
                {
                    "unique-id": "calm-hub-rest-api",
                    "port": 8080,
                    "path": "/calm"
                },
                {
                    "unique-id": "calm-hub-mcp-endpoint",
                    "port": 8080,
                    "path": "/mcp"
                }
            ]
        },
        {
            "unique-id": "calm-hub-ui",
            "node-type": "webclient",
            "name": "CALM Hub UI",
            "description": "React single-page application for browsing, visualizing, and managing CALM architectures; built and served as static resources embedded inside CALM Hub."
        },
        {
            "unique-id": "calm-cli",
            "node-type": "service",
            "name": "CALM CLI",
            "description": "Node.js command-line tool providing generate, validate, template, docify, and init-ai commands for working with CALM architecture files."
        },
        {
            "unique-id": "mongodb",
            "node-type": "database",
            "name": "MongoDB",
            "description": "Document database storing CALM namespaces, architectures, patterns, standards, flows, controls, decorators, and user-access records.",
            "interfaces": [
                {
                    "unique-id": "mongodb-connection",
                    "port": 27017
                }
            ]
        },
        {
            "unique-id": "vscode-extension",
            "node-type": "service",
            "name": "CALM VS Code Extension",
            "description": "VS Code extension providing CALM architecture authoring, live validation, diagnostics, and graph visualization within the editor."
        },
        {
            "unique-id": "calm-hub-system",
            "node-type": "system",
            "name": "CALM Hub System",
            "description": "Logical grouping of the CALM Hub backend, UI, and database that together form the CALM Hub platform."
        },
        {
            "unique-id": "visual-studio-code",
            "node-type": "service",
            "name": "Visual Studio Code",
            "description": "Microsoft Visual Studio Code editor that hosts the CALM VS Code Extension."
        }
    ],
    "relationships": [
        {
            "unique-id": "architect-to-calm-tooling",
            "description": "Architects and developers interact with CALM tooling to author, validate, visualize, and manage architecture models.",
            "relationship-type": {
                "interacts": {
                    "actor": "architect",
                    "nodes": ["calm-hub-ui", "calm-cli", "vscode-extension"]
                }
            }
        },
        {
            "unique-id": "calm-hub-ui-to-calm-hub",
            "description": "Sends HTTP REST requests to read and write namespaces, patterns, architectures, flows, decorators, and ADRs.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub-ui"
                    },
                    "destination": {
                        "node": "calm-hub",
                        "interfaces": ["calm-hub-rest-api"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-hub-to-mongodb",
            "description": "Reads and writes all CALM namespace data, architectures, patterns, standards, flows, controls, and user-access records.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-hub"
                    },
                    "destination": {
                        "node": "mongodb",
                        "interfaces": ["mongodb-connection"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-cli-to-calm-hub",
            "description": "Fetches remote CALM patterns and schemas from CALM Hub when a --calm-hub-url is supplied.",
            "relationship-type": {
                "connects": {
                    "source": {
                        "node": "calm-cli"
                    },
                    "destination": {
                        "node": "calm-hub",
                        "interfaces": ["calm-hub-rest-api"]
                    }
                }
            }
        },
        {
            "unique-id": "calm-hub-system-composed-of",
            "description": "The CALM Hub System is composed of the CALM Hub UI, CALM Hub backend, and MongoDB database.",
            "relationship-type": {
                "composed-of": {
                    "container": "calm-hub-system",
                    "nodes": ["calm-hub-ui", "calm-hub", "mongodb"]
                }
            }
        },
        {
            "unique-id": "vscode-extension-deployed-in-vscode",
            "description": "The CALM VS Code Extension is deployed in and runs within Visual Studio Code.",
            "relationship-type": {
                "deployed-in": {
                    "container": "visual-studio-code",
                    "nodes": ["vscode-extension"]
                }
            }
        }
    ]
}
