# overhangio/tutor architecture

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

- Interactive diagram: https://gitdiagram.com/overhangio/tutor
- Repository: https://github.com/overhangio/tutor

## Overview

##### Main Components

a. Core System Components:
- CLI Interface (entry point)
- Configuration Management System
- Plugin System
- Template Engine
- Build System
- Deployment Managers (Local & K8s)

b. External Components:
- Docker Engine/Docker Compose
- Kubernetes (optional)
- Open edX Platform Components
- Database Systems
- Cache Systems (Redis)
- Load Balancer (Caddy)

##### Component Organization

Top Layer:
- User Interface (CLI, Web UI)
- Configuration Management
- Plugin System

Middle Layer:
- Template Engine
- Build System
- Deployment Managers

Bottom Layer:
- Container Infrastructure
- Persistent Storage
- External Services

##### Key Relationships to Highlight

- How the CLI commands flow through the system
- Plugin architecture and extension points
- Demonstrate the template rendering process
- Deployment workflows for both Docker Compose and K8s
- Configuration management flow

##### Specific Implementation Details

- Rectangles: Core components
- Hexagons: Plugin systems
- Clouds: External services

##### Component Details

Core Components (Blue):
- CLI Interface (/tutor/commands/)
- Config Manager (/tutor/config.py)
- Plugin System (/tutor/plugins/)
- Template Engine (/tutor/templates/)

Infrastructure Components (Green):
- Docker Compose Support
- Kubernetes Support
- Volume Management

Application Components (Orange):
- LMS
- CMS
- Caddy
- MySQL
- Redis

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        CLI["CLI Interface"]:::core
        WebUI["Web UI"]:::core
    end

    subgraph "Core Layer"
        Config["Configuration Manager"]:::core
        PluginSys["Plugin System"]:::core
        HookSystem["Core Hooks System"]:::core
        TemplateEngine["Template Engine"]:::core
        BuildSys["Build System"]:::core
    end

    subgraph "Deployment Layer"
        LocalDeploy["Local Deployment Manager"]:::deploy
        K8sDeploy["Kubernetes Deployment Manager"]:::deploy
    end

    subgraph "Infrastructure Layer"
        Docker["Docker Engine"]:::infra
        K8s["Kubernetes"]:::infra
        Volumes["Volume Management"]:::infra
    end

    subgraph "Application Layer"
        LMS["Learning Management System"]:::app
        CMS["Content Management System"]:::app
        Caddy["Caddy Load Balancer"]:::app
        MySQL["MySQL Database"]:::db
        Redis["Redis Cache"]:::db
    end

    CLI --> Config
    CLI --> PluginSys
    CLI --> BuildSys
    WebUI --> Config

    Config --> TemplateEngine
    PluginSys --> HookSystem
    HookSystem --> TemplateEngine
    TemplateEngine --> BuildSys

    BuildSys --> LocalDeploy
    BuildSys --> K8sDeploy

    LocalDeploy --> Docker
    K8sDeploy --> K8s

    Docker --> Volumes
    K8s --> Volumes

    Docker --> LMS
    Docker --> CMS
    Docker --> Caddy
    Docker --> MySQL
    Docker --> Redis

    %% Click Events
    click CLI "https://github.com/overhangio/tutor/blob/release/tutor/commands/cli.py"
    click Config "https://github.com/overhangio/tutor/blob/release/tutor/config.py"
    click PluginSys "https://github.com/overhangio/tutor/tree/release/tutor/plugins"
    click HookSystem "https://github.com/overhangio/tutor/tree/release/tutor/core/hooks"
    click TemplateEngine "https://github.com/overhangio/tutor/tree/release/tutor/templates"
    click BuildSys "https://github.com/overhangio/tutor/tree/release/tutor/templates/build"
    click LocalDeploy "https://github.com/overhangio/tutor/blob/release/tutor/commands/local.py"
    click K8sDeploy "https://github.com/overhangio/tutor/blob/release/tutor/commands/k8s.py"
    click Caddy "https://github.com/overhangio/tutor/tree/release/tutor/templates/apps/caddy"
    click Redis "https://github.com/overhangio/tutor/tree/release/tutor/templates/apps/redis"

    %% Styles
    classDef core fill:#2374ab,stroke:#2374ab,color:#fff
    classDef deploy fill:#48a9a6,stroke:#48a9a6,color:#fff
    classDef infra fill:#4ea5d9,stroke:#4ea5d9,color:#fff
    classDef app fill:#e4572e,stroke:#e4572e,color:#fff
    classDef db fill:#17bebb,stroke:#17bebb,color:#fff

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Deployment Components"]:::deploy
        L3["Infrastructure"]:::infra
        L4["Applications"]:::app
        L5["Databases"]:::db
    end
```
