# takashicc/slack-approval architecture

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

- Interactive diagram: https://gitdiagram.com/takashicc/slack-approval
- Repository: https://github.com/takashicc/slack-approval

## Overview

##### Main Components
- GitHub Workflows & Runner: Represent the GitHub Actions environment where the custom action is invoked. This includes workflow definitions (under .github/workflows) and the Taskfile.yml for local task management.
- Custom Action Container: The Rust application compiled from the contents of src (with main.rs as the entry point). This container may be built using the Dockerfile.
- Service Modules: Within the Rust application, there are clearly separated modules:
- GitHub Service (in src/services/github) – responsible for handling GitHub-specific inputs and related logic.
- Slack Service (e.g., src/services/slack.rs) – manages communications with Slack (sending messages, processing button clicks).
- External APIs:
- Slack API – where the message is sent using the provided tokens and channel IDs.
- (Optionally) any GitHub API calls if part of the workflow feedback loop.

##### Relationships and Interactions
- One connects to the Slack Service, which sends an interactive message to Slack.

##### Architectural Patterns and Design Principles
- Modular Design: Emphasize that the source code is divided into modular services – GitHub integration and Slack messaging – for clear separation of concerns.
- Containerization: Note that a Dockerfile is present; thus, the application is containerized for consistent deployment.
- CI/CD Integration: The existence of multiple workflows (.github/workflows/ci.yml, test.yml, etc.) indicates automated testing and deployment pipelines.

##### Relevant Technologies and Frameworks
- Rust: The primary programming language (see Cargo.toml and Cargo.lock).
- Docker: For containerizing the action.
- GitHub Actions: For orchestrating workflows that include the custom action.
- Slack API: For sending interactive approval messages.
- GitHub API (if applicable): For processing the results from Slack actions.

## Diagram (Mermaid)

```mermaid
graph TD
    A["GitHub Workflows & Runner"]:::external
    B["Custom Action Container (Rust Application)"]:::internal
    C["GitHub Service Module"]:::internal
    D["Slack Service Module"]:::internal
    E["Slack API"]:::external

    A -->|"Trigger"| B
    B -->|"ProcessGitHubInput"| C
    B -->|"ComposeSlackMessage"| D
    D -->|"SendInteractiveMessage"| E

    click A "https://github.com/takashicc/slack-approval/tree/main/.github/workflows"
    click B "https://github.com/takashicc/slack-approval/blob/main/src/main.rs"
    click C "https://github.com/takashicc/slack-approval/tree/main/src/services/github"
    click D "https://github.com/takashicc/slack-approval/blob/main/src/services/slack.rs"

    classDef external fill:#f9d6d5,stroke:#333,stroke-width:2px;
    classDef internal fill:#d5e8d4,stroke:#333,stroke-width:2px;
```
