# 514-labs/moose architecture

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

- Interactive diagram: https://gitdiagram.com/514-labs/moose
- Repository: https://github.com/514-labs/moose

## Overview

##### Main Components Identification

The system should be divided into these major components:
- Framework CLI (Core Engine)
- Infrastructure Layer
- Language Support Systems
- Frontend Applications
- Templates System
- SDK/Libraries

##### Component Breakdown and Relationships

a) Framework CLI (Core):
- Command processing system (/apps/framework-cli/src/cli)
- Framework core logic (/apps/framework-cli/src/framework)
- Infrastructure management (/apps/framework-cli/src/infrastructure)
- Project management system (/apps/framework-cli/src/project)

b) Infrastructure Layer:
- OLAP Database (Clickhouse)
- Streaming Platform (Redpanda)
- Redis Cache
- API Endpoints

c) Language Support:
- TypeScript/JavaScript Support
- Python Support
- Protocol Buffers Interface

d) Frontend Applications:
- Landing Pages
- Documentation System
- Analytics Dashboard
- Logs Frontend

##### Specific Elements

**[Frontend Layer]**
- ↓
**[Framework CLI]**
- ↙     ↓     ↘
**[Python] [TypeScript] [Protobuf]**
- ↓         ↓           ↓
**[Infrastructure Layer]**
- ↙     ↓     ↘
**[OLAP] [Stream] [Cache]**

##### Key Interactions to Highlight

- CLI to Infrastructure provisioning
- Data flow through streaming platform
- Language-specific runtime execution
- Frontend to backend communication
- Template system integration

##### Implementation Details

- Hexagons for services
- Clear labels for all components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef core fill:#2196F3,color:white
    classDef infra fill:#4CAF50,color:white
    classDef lang fill:#FF9800,color:white
    classDef front fill:#9C27B0,color:white
    classDef sdk fill:#607D8B,color:white
    classDef template fill:#795548,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Infrastructure]:::infra
        L3[Language Support]:::lang
        L4[Frontend Apps]:::front
        L5[SDK/Libraries]:::sdk
        L6[Templates]:::template
    end

    %% Frontend Layer
    subgraph Frontend
        Landing[Landing Pages]
        Docs[Documentation]
        Analytics[Analytics Dashboard]
        LogsFront[Logs Frontend]
    end

    %% Framework CLI Core
    subgraph CoreEngine
        CLI[Command Processing]
        Framework[Framework Core]
        InfraMgmt[Infrastructure Management]
        ProjectMgmt[Project Management]
    end

    %% Infrastructure Layer
    subgraph Infrastructure
        OLAP[(OLAP/Clickhouse)]
        Stream[(Streaming/Redpanda)]
        Cache[(Redis Cache)]
        API[API Endpoints]
    end

    %% Language Support
    subgraph Languages
        TS[TypeScript Support]
        Python[Python Support]
        Protobuf[Protocol Buffers]
    end

    %% SDK/Libraries
    subgraph SDKs
        TSSDK[TypeScript SDK]
        PythonSDK[Python SDK]
    end

    %% Templates
    subgraph Templates
        TemplateSystem[Templates Directory]
        ProductTemplate[Product Analytics Template]
        LogsTemplate[Logs Template]
    end

    %% Relationships
    CoreEngine --> Languages
    Languages --> Infrastructure
    Frontend --> API
    API --> Infrastructure
    SDKs --> Languages
    Templates --> Languages

    %% Click Events
    click CLI "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/cli"
    click Framework "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/framework"
    click InfraMgmt "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/infrastructure"
    click ProjectMgmt "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/project"
    click OLAP "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/infrastructure/olap/clickhouse"
    click Stream "https://github.com/514-labs/moose/blob/main/apps/framework-cli/src/infrastructure/stream/redpanda.rs"
    click Cache "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/infrastructure/redis"
    click API "https://github.com/514-labs/moose/blob/main/apps/framework-cli/src/infrastructure/api.rs"
    click TS "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/framework/typescript"
    click Python "https://github.com/514-labs/moose/tree/main/apps/framework-cli/src/framework/python"
    click Protobuf "https://github.com/514-labs/moose/tree/main/packages/protobuf"
    click Landing "https://github.com/514-labs/moose/tree/main/apps/framework-landing"
    click Docs "https://github.com/514-labs/moose/tree/main/apps/framework-docs"
    click Analytics "https://github.com/514-labs/moose/tree/main/apps/product-analytics"
    click LogsFront "https://github.com/514-labs/moose/tree/main/apps/logs-frontend"
    click TSSDK "https://github.com/514-labs/moose/tree/main/packages/ts-moose-lib"
    click PythonSDK "https://github.com/514-labs/moose/tree/main/packages/py-moose-lib"
    click TemplateSystem "https://github.com/514-labs/moose/tree/main/templates"
    click ProductTemplate "https://github.com/514-labs/moose/tree/main/templates/product-analytics"
    click LogsTemplate "https://github.com/514-labs/moose/tree/main/templates/logs"

    %% Style Applications
    class CLI,Framework,InfraMgmt,ProjectMgmt core
    class OLAP,Stream,Cache,API infra
    class TS,Python,Protobuf lang
    class Landing,Docs,Analytics,LogsFront front
    class TSSDK,PythonSDK sdk
    class TemplateSystem,ProductTemplate,LogsTemplate template
```
