# mateodelnorte/meta architecture

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

- Interactive diagram: https://gitdiagram.com/mateodelnorte/meta
- Repository: https://github.com/mateodelnorte/meta

## Overview

##### Main Components

a. Core Meta Engine:
- Represented by the main `lib` directory components
- Plugin registration system (`lib/registerPlugin.js`)
- Plugin discovery system (`lib/findPlugins.js`)

b. Plugin System:
- As a ring of components around the core
- Built-in plugins:
- meta-init
- meta-project
- meta-git
- meta-exec
- Extension points for third-party plugins

c. Command Line Interface:
- Entry point (`bin/meta`)
- Command routing system

d. Project Management Layer:
- Repository management
- Meta file handling (.meta configuration)
- Git operations coordination

##### Relationships and Data Flow

- Command flow from CLI → Core Engine → Plugins
- Plugin registration flow
- Repository management operations
- File system interactions

##### Architectural Pattern Representation

- Plugin-based architecture
- Command pattern implementation
- Event-driven operations

##### Implementation Details

- Blue rectangles: Core components
- Green circles: Plugins
- Yellow diamonds: Configuration files
- Red hexagons: External interfaces

##### Specific Elements

**[CLI Layer]**
- ↓
**[Command Router]**
- ↓
**[Core Meta Engine] ←→ [Plugin Registry]**
- ↓                      ↑
**[Repository Manager] ←→ [Built-in Plugins]**
- ↓                      ↑
**[File System Layer]    [Third-party Plugins]**

##### Technical Details to Highlight

- Node.js based architecture
- Git integration points
- Plugin system extensibility
- Command execution flow

- High-level architecture visibility
- Detailed component relationships
- Plugin system extensibility
- Command flow clarity

Remember to emphasize the tool's unique ability to handle both monorepo and multi-repo scenarios through its meta repository concept.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CLI
        CMD["Command Line Interface"]
        Router["Command Router"]
    end

    subgraph Core
        Engine["Core Meta Engine"]
        PlugReg["Plugin Registration"]
        PlugDisc["Plugin Discovery"]
        RepoMgr["Repository Manager"]
    end

    subgraph Plugins
        direction TB
        BuiltIn["Built-in Plugins"]
        ThirdParty["Third-party Plugins"]
        MetaInit["meta-init"]
        MetaProj["meta-project"]
        MetaGit["meta-git"]
        MetaExec["meta-exec"]
    end

    subgraph Infrastructure
        direction TB
        Tests["Testing Infrastructure"]
        Config["Configuration Management"]
        DevInfra["Development Infrastructure"]
        FSLayer["File System Layer"]
    end

    %% Relationships
    CMD --> Router
    Router --> Engine
    Engine --> PlugReg
    Engine --> PlugDisc
    Engine --> RepoMgr
    RepoMgr --> FSLayer
    PlugReg --> BuiltIn
    PlugReg --> ThirdParty
    BuiltIn --> MetaInit
    BuiltIn --> MetaProj
    BuiltIn --> MetaGit
    BuiltIn --> MetaExec

    %% Styling
    classDef core fill:#b3d1ff,stroke:#333
    classDef plugin fill:#90EE90,stroke:#333
    classDef infra fill:#FFE5CC,stroke:#333
    classDef cli fill:#FFB366,stroke:#333

    class Engine,PlugReg,PlugDisc,RepoMgr core
    class BuiltIn,ThirdParty,MetaInit,MetaProj,MetaGit,MetaExec plugin
    class Tests,Config,DevInfra,FSLayer infra
    class CMD,Router cli

    %% Click events
    click Engine "https://github.com/mateodelnorte/meta/tree/master/lib"
    click PlugReg "https://github.com/mateodelnorte/meta/blob/master/lib/registerPlugin.js"
    click PlugDisc "https://github.com/mateodelnorte/meta/blob/master/lib/findPlugins.js"
    click CMD "https://github.com/mateodelnorte/meta/tree/master/bin/meta"
    click Tests "https://github.com/mateodelnorte/meta/tree/master/__tests__"
    click Config "https://github.com/mateodelnorte/meta/blob/master/.meta"
    click DevInfra "https://github.com/mateodelnorte/meta/blob/master/.husky"

%% Legend
subgraph Legend
    CoreComp["Core Component"]:::core
    PluginComp["Plugin Component"]:::plugin
    InfraComp["Infrastructure Component"]:::infra
    CLIComp["CLI Component"]:::cli
end
```
