# resnovas/smartcloud architecture

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

- Interactive diagram: https://gitdiagram.com/resnovas/smartcloud
- Repository: https://github.com/resnovas/smartcloud

## Overview

##### Main System Components

a) Core Action Components:
- Action Entry Point (action.yml, src/index.ts)
- Context Handlers (src/contexts/)
- Condition Evaluators (src/conditions/)
- Utility Services (src/utils/)

b) External Integrations:
- GitHub API Interface
- GitHub Events System
- Project Configuration System

**┌─────────────────────────────────────────────┐**
- GitHub Events                  │
- (Issues, PRs, Project Cards, Schedule)     │
- ┘
- ↓
**┌─────────────────────────────────────────────┐**
- Action Entry Point                │
- (Configuration Loading & Routing)       │
- ┘
- ↓
**┌─────────────────────────────────────────────┐**
- Context Handlers                  │
- ┬─────────────┬────────────────┤
- Issues    │    PRs      │    Projects    │
- ┴─────────────┴────────────────┘
- ↓
**┌─────────────────────────────────────────────┐**
- Condition System                  │
- ┬─────────────┬────────────────┤
- Labels    │  Workflow   │   Automation   │
- ┴─────────────┴────────────────┘
- ↓
**┌─────────────────────────────────────────────┐**
- Action Methods                    │
- ┬─────────────┬────────────────┤
- Labels    │  Projects   │   Releases     │
- ┴─────────────┴────────────────┘
- ↓
**┌─────────────────────────────────────────────┐**
- GitHub API                     │
- ┘

##### Component Details

For each major component, include:

a) Context Handlers:
- Issues Context
- Pull Requests Context
- Projects Context
- Schedule Context

b) Condition System:
- Branch Conditions
- Status Conditions
- Project Conditions

c) Action Methods:
- Project Assignment
- Release Management
- Branch Creation
- Milestone Management

##### Data Flow Indicators

- Event triggers (→)
- Data processing flow (⇢)
- API calls (⇄)
- Configuration loading (⇣)

##### Important Notes

- Configuration file interaction points
- Error handling paths
- Deprecated features (as mentioned in README)
- Integration points with external services

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "GitHub Events Layer"
        GE["GitHub Events"]
        Issues["Issues"]
        PRs["Pull Requests"]
        Projects["Project Cards"]
        Schedule["Schedule"]
        GE --> Issues
        GE --> PRs
        GE --> Projects
        GE --> Schedule
    end

    subgraph "Entry Layer"
        EP["Action Entry Point"]:::entry
        Config["Configuration System"]:::config
        Issues & PRs & Projects & Schedule --> EP
        EP <--> Config
    end

    subgraph "Context Handlers Layer"
        CH["Context Handlers"]
        IC["Issues Context"]:::context
        PRC["Pull Requests Context"]:::context
        PC["Projects Context"]:::context
        SC["Schedule Context"]:::context
        CH --> IC & PRC & PC & SC
    end

    subgraph "Condition System Layer"
        CS["Condition Evaluators"]
        LC["Label Conditions"]:::condition
        BC["Branch Conditions"]:::condition
        ProjC["Project Conditions"]:::condition
        SC2["Status Conditions"]:::condition
        CS --> LC & BC & ProjC & SC2
    end

    subgraph "Action Methods Layer"
        AM["Action Methods"]
        LM["Label Management"]:::method
        PA["Project Assignment"]:::method
        RM["Release Management"]:::method
        BC2["Branch Creation"]:::method
        MM["Milestone Management"]:::method
        AM --> LM & PA & RM & BC2 & MM
    end

    subgraph "GitHub API Layer"
        API["GitHub API Interface"]:::api
        Issues_API["Issues API"]:::api
        PR_API["Pull Requests API"]:::api
        Project_API["Projects API"]:::api
        Labels_API["Labels API"]:::api
        API --> Issues_API & PR_API & Project_API & Labels_API
    end

    EP --> CH
    CH --> CS
    CS --> AM
    AM --> API

    %% Click Events
    click EP "https://github.com/resnovas/smartcloud/blob/main/action.yml"
    click Config "https://github.com/resnovas/smartcloud/blob/main/schema/configs.json"
    click IC "https://github.com/resnovas/smartcloud/blob/main/src/contexts/issues.ts"
    click PRC "https://github.com/resnovas/smartcloud/blob/main/src/contexts/pull-requests.ts"
    click PC "https://github.com/resnovas/smartcloud/blob/main/src/contexts/projects.ts"
    click SC "https://github.com/resnovas/smartcloud/blob/main/src/contexts/schedule.ts"
    click BC "https://github.com/resnovas/smartcloud/blob/main/src/conditions/pr/branch-matches.ts"
    click LC "https://github.com/resnovas/smartcloud/blob/main/src/conditions/util/has-label.ts"
    click ProjC "https://github.com/resnovas/smartcloud/blob/main/src/conditions/project/on-column.ts"
    click LM "https://github.com/resnovas/smartcloud/blob/main/src/contexts/methods/apply-labels.ts"
    click PA "https://github.com/resnovas/smartcloud/blob/main/src/contexts/methods/assign-project.ts"
    click RM "https://github.com/resnovas/smartcloud/blob/main/src/contexts/methods/release.ts"
    click BC2 "https://github.com/resnovas/smartcloud/blob/main/src/contexts/methods/create-branch.ts"
    click MM "https://github.com/resnovas/smartcloud/blob/main/src/contexts/methods/handle-milestone.ts"
    click Issues_API "https://github.com/resnovas/smartcloud/blob/main/src/utils/api/issues.ts"
    click PR_API "https://github.com/resnovas/smartcloud/blob/main/src/utils/api/pull-requests.ts"
    click Project_API "https://github.com/resnovas/smartcloud/blob/main/src/utils/api/project.ts"
    click Labels_API "https://github.com/resnovas/smartcloud/blob/main/src/utils/api/labels.ts"

    %% Styling
    classDef entry fill:#90EE90
    classDef context fill:#FFB6C1
    classDef condition fill:#FFE4B5
    classDef method fill:#87CEEB
    classDef api fill:#DDA0DD
    classDef config fill:#F0E68C

    %% Legend
    subgraph Legend
        L1["Entry Components"]:::entry
        L2["Context Handlers"]:::context
        L3["Condition Components"]:::condition
        L4["Method Components"]:::method
        L5["API Components"]:::api
        L6["Config Components"]:::config
    end
```
