# event-catalog/eventcatalog architecture

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

- Interactive diagram: https://gitdiagram.com/event-catalog/eventcatalog
- Repository: https://github.com/event-catalog/eventcatalog

## Overview

##### Main Components Identification

a) Core Application Components:
- Content Generation Engine (src/generate.js)
- File System Watcher (src/watcher.js)
- Configuration Manager (src/eventcatalog-config/)
- Collection Processors (src/utils/collections/)
- Node Graph Generators (src/utils/node-graphs/)

b) Frontend Components:
- MDX Components (eventcatalog/src/components/MDX/)
- Visualization Components (eventcatalog/src/components/MDX/NodeGraph/)
- UI Components (eventcatalog/src/components/)
- Routing System (eventcatalog/src/pages/)

**┌─ User Interface Layer ─────────────────────┐**
- Documentation Pages                      │
- Visualizer                              │
- Discovery Interface                      │
- Search Component                         │
- Application Layer ──────────────────────┐ │
- Content Generation Engine              │ │
- MDX Processing                         │ │
- Node Graph Generation                  │ │
- Schema Processing                      │ │
- Data Layer ───────────────────────────┐ │ │
- Markdown Files                       │ │ │
- Schema Files                         │ │ │
- Configuration Files                  │ │ │
- Version Control                      │ │ │
- ┴─┴─┘

##### Component Relationships

- Content Generation Engine → MDX Processing → UI Components
- File System Watcher → Content Generation Engine
- Node Graph Generators → Visualization Components
- Collection Processors → Documentation Pages
- Configuration Manager → All Components

##### Component Details

For each major component, include:
- Input/Output relationships
- Key responsibilities
- Technology stack (Astro, React, TypeScript)
- Integration points

##### Architectural Patterns

Following patterns:
- Event-Driven Documentation
- Component-Based UI
- Plugin Architecture
- Version Control Integration
- Static Site Generation

Remember to maintain a balance between detail and clarity, focusing on the core functionality while still showing the extensibility and flexibility of the system.

This system design should help developers understand how EventCatalog transforms markdown-based documentation into an interactive, searchable, and visually appealing documentation platform for event-driven architectures.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        UI["Documentation Pages"]:::frontend
        VIS["Visualizer"]:::frontend
        DI["Discovery Interface"]:::frontend
        SC["Search Component"]:::frontend
    end

    subgraph "Application Layer"
        CGE["Content Generation Engine"]:::core
        MDXP["MDX Processing"]:::core
        NGG["Node Graph Generation"]:::core
        SP["Schema Processing"]:::core
        FSW["File System Watcher"]:::core
        PA["Plugin Architecture"]:::core
        CM["Configuration Manager"]:::config
    end

    subgraph "Data Layer"
        MD["Markdown Files"]:::data
        SF["Schema Files"]:::data
        CF["Configuration Files"]:::data
        VC["Version Control"]:::data
    end

    %% Component Relationships
    MD --> CGE
    SF --> CGE
    CF --> CM
    CM --> CGE
    CM --> MDXP
    CM --> NGG
    CM --> SP
    
    FSW --> CGE
    CGE --> MDXP
    MDXP --> UI
    NGG --> VIS
    SP --> UI
    
    PA --> CGE
    PA --> MDXP
    
    %% Click Events
    click CGE "https://github.com/event-catalog/eventcatalog/blob/main/src/generate.js"
    click FSW "https://github.com/event-catalog/eventcatalog/blob/main/src/watcher.js"
    click CM "https://github.com/event-catalog/eventcatalog/blob/main/src/utils/eventcatalog-config/catalog.ts"
    click NGG "https://github.com/event-catalog/eventcatalog/tree/main/src/utils/node-graphs/"
    click MDXP "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/components/MDX/"
    click VIS "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/components/MDX/NodeGraph/"
    click UI "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/components/"
    click SP "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/components/MDX/SchemaViewer/"
    click DI "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/pages/discover/"
    click SC "https://github.com/event-catalog/eventcatalog/blob/main/eventcatalog/src/components/Search.astro"
    click PA "https://github.com/event-catalog/eventcatalog/tree/main/eventcatalog/src/remark-plugins/"

    %% Styling
    classDef core fill:#2374ab
    classDef frontend fill:#57cc99
    classDef data fill:#ffd60a
    classDef config fill:#ff7f51
    classDef viz fill:#9f86c0

    %% Legend
    subgraph Legend
        L1["Core Processing"]:::core
        L2["Frontend Components"]:::frontend
        L3["Data Storage"]:::data
        L4["Configuration"]:::config
        L5["Visualization"]:::viz
    end
```
