# lunartown/actions-test architecture

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

- Interactive diagram: https://gitdiagram.com/lunartown/actions-test
- Repository: https://github.com/lunartown/actions-test

## Overview

##### Main Components

a) Application Core:
- Spring Boot Application Container
- Main application (JavaStarterApplication)
- Template application component
- Resource configurations (application.yml)

b) Infrastructure Components:
- Docker Environment
- MongoDB container (pre-configured)
- Optional MySQL container
- Optional Redis container

c) Development Tools:
- GitHub Actions Workflow System
- Template creation workflow
- Testing workflows
- Slack integration

**┌─────────────────────────────────────┐**
- GitHub Actions             │
- ┤
- Template Creation Workflow        │
- Testing Workflow                  │
- Slack Notifications              │
- ┘

**┌─────────────────────────────────────┐**
- Spring Boot Application        │
- ┤
- Main Application Component        │
- Template Component               │
- Configuration (application.yml)   │
- ┘

**┌─────────────────────────────────┐**
- Docker Environment         │
- ┤
- ┌─────────┐ ┌───────┐ ┌───────┐│
- MongoDB  │ │MySQL  │ │Redis  ││
- (Default)│ │(Opt.) │ │(Opt.) ││
- ┘ └───────┘ └───────┘│
- ┘

##### Important Details

a) Configuration Flow:
- How application.yml connects to different database services
- Initialization scripts (init-mongo.sh) connection to MongoDB

b) Environment Separation:
- Local development environment (docker-compose.local.yml)
- Production environment setup (docker-compose.yml)

##### Relationships to Highlight

- GitHub Actions → New Repository Creation
- Application → Database Connections
- Docker Compose → Container Management
- Configuration Files → Service Setup

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph CI ["CI/CD & Development Layer"]
        GHA["GitHub Actions"]
        TW["Testing Workflow"]:::workflow
        AT["Actions Testing"]:::workflow
        SI["Slack Integration"]:::workflow
        GHA --> TW
        GHA --> AT
        GHA --> SI
    end

    subgraph APP ["Application Layer"]
        MA["Main Application"]:::app
        TC["Template Component"]:::app
        AC["Application Configuration"]:::config
        MA --> TC
        MA --> AC
    end

    subgraph INFRA ["Infrastructure Layer"]
        subgraph DOCKER ["Docker Environment"]
            DF["Dockerfile"]:::docker
            DFL["Dockerfile Local"]:::docker
            DCP["Docker Compose Production"]:::docker
            DCL["Docker Compose Local"]:::docker
            ENV["Environment Config"]:::config
            
            DF --> DCP
            DFL --> DCL
            ENV --> DCP
            ENV --> DCL
        end

        subgraph DB ["Database Layer"]
            MONGO[("MongoDB")]:::db
            MYSQL[("MySQL")]:::optional
            REDIS[("Redis")]:::optional
            MI["MongoDB Init Script"]:::script
            
            MI --> MONGO
            DCP --> MONGO
            DCP -.-> MYSQL
            DCP -.-> REDIS
        end
    end

    APP --> INFRA
    CI --> APP

    %% Click Events
    click MA "https://github.com/lunartown/actions-test/blob/prod/template/src/main/java/kr/teamo2/starter/JavaStarterApplication.java"
    click TC "https://github.com/lunartown/actions-test/blob/prod/template/src/main/java/kr/teamo2/template/TemplateApplication.java"
    click AC "https://github.com/lunartown/actions-test/blob/prod/template/src/main/resources/application.yml"
    click DF "https://github.com/lunartown/actions-test/tree/prod/template/DockerFile"
    click DFL "https://github.com/lunartown/actions-test/blob/prod/template/DockerFile.local"
    click DCP "https://github.com/lunartown/actions-test/blob/prod/template/docker-compose.yml"
    click DCL "https://github.com/lunartown/actions-test/blob/prod/template/docker-compose.local.yml"
    click MI "https://github.com/lunartown/actions-test/blob/prod/template/docker/mongo/initdb/init-mongo.sh"
    click ENV "https://github.com/lunartown/actions-test/blob/prod/template/docker/example.env"
    click TW "https://github.com/lunartown/actions-test/blob/prod/.github/workflows/test.yml"
    click AT "https://github.com/lunartown/actions-test/blob/prod/.github/workflows/testActions.yml"
    click SI "https://github.com/lunartown/actions-test/blob/prod/.github/workflows/testSlack.yml"

    %% Styling
    classDef app fill:#b3e0ff,stroke:#333,stroke-width:2px
    classDef config fill:#ffe6cc,stroke:#333,stroke-width:2px
    classDef docker fill:#d9f2e6,stroke:#333,stroke-width:2px
    classDef db fill:#c2f0c2,stroke:#333,stroke-width:2px
    classDef workflow fill:#ffcc99,stroke:#333,stroke-width:2px
    classDef optional fill:#e6e6e6,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
    classDef script fill:#fff5e6,stroke:#333,stroke-width:2px
```
