# lsj8706/ios-image-compress-poc architecture

> Architecture diagram of the GitHub repository lsj8706/ios-image-compress-poc, 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/lsj8706/ios-image-compress-poc
- Repository: https://github.com/lsj8706/ios-image-compress-poc

## Overview

##### Main Components

A. User Interface Layer
- Main View Controller (ViewController.swift)
- Storyboards (Main.storyboard, LaunchScreen.storyboard)

B. Core Functionality Modules
- Compression Module (Compress folder)
- CompressType.swift (Compression options/configurations)
- ImageCompressor.swift (Main compression logic)

- Resize Module (Resize folder)
- ImageResizer.swift (Image resizing functionality)

C. Utility Layer
- Extensions (Utils folder)
- Data+ extensions
- UIImage+ extensions
- UILabel+ extensions

D. Application Support
- App Delegates
- AppDelegate.swift
- SceneDelegate.swift

**┌─────────────────────────────────────┐**
- UI Layer                  │
- (ViewController + Storyboards)     │
- ┬───────────────────┘
- ↓
**┌─────────────────────────────────────┐**
- Core Processing Layer          │
- ┐ ┌─────────────────┤
- Compression   │ │     Resize      │
- Module      │ │     Module      │
- ┘ └─────────────────┘
- ↑
**┌─────────────────────────────────────┐**
- Utility Layer               │
- (Extensions and Helpers)         │
- ┘

##### Important Elements to Highlight

a) Component Interactions:
- How the ViewController interacts with both Compression and Resize modules
- How the Utility layer supports all upper layers
- Demonstrate the flow of image data through the system

b) Module Responsibilities:
- Compression Module: Handles image compression strategies
- Resize Module: Manages image dimension modifications
- Utils: Provides extension support for core types

##### Technical Details

- Swift-specific components
- IOS framework dependencies
- Where UIKit integration occurs
- Extension points for future scalability

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef ui fill:#e1f5fe,stroke:#01579b
    classDef core fill:#e8f5e9,stroke:#1b5e20
    classDef utility fill:#f5f5f5,stroke:#424242
    classDef app fill:#fff3e0,stroke:#e65100

    %% UI Layer
    subgraph UI["User Interface Layer"]
        VC["ViewController"]
        MS["Main.storyboard"]
        LS["LaunchScreen.storyboard"]
    end

    %% Core Processing Layer
    subgraph Core["Core Processing Layer"]
        subgraph Compression["Compression Module"]
            CT["CompressType"]
            IC["ImageCompressor"]
        end
        
        subgraph Resize["Resize Module"]
            IR["ImageResizer"]
        end
    end

    %% Utility Layer
    subgraph Utils["Utility Layer"]
        DE["Data Extensions"]
        IE["UIImage Extensions"]
        LE["UILabel Extensions"]
    end

    %% Application Support
    subgraph App["Application Support"]
        AD["AppDelegate"]
        SD["SceneDelegate"]
    end

    %% Relationships
    VC --> CT
    VC --> IC
    VC --> IR
    CT --> IC
    IC --> IR
    
    Utils --> Core
    Utils --> UI
    
    AD --> VC
    SD --> VC

    %% Click Events
    click VC "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/ViewController.swift"
    click MS "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Base.lproj/Main.storyboard"
    click LS "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Base.lproj/LaunchScreen.storyboard"
    click CT "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Compress/CompressType.swift"
    click IC "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Compress/ImageCompressor.swift"
    click IR "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Resize/ImageResizer.swift"
    click DE "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Utils/Data+.swift"
    click IE "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Utils/UIImage+.swift"
    click LE "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/Utils/UILabel+.swift"
    click AD "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/App/AppDelegate.swift"
    click SD "https://github.com/lsj8706/iOS-Image-Compress-POC/blob/main/iOS-Image-Compress-POC/iOS-Image-Compress-POC/App/SceneDelegate.swift"

    %% Style Applications
    class VC,MS,LS ui
    class CT,IC,IR core
    class DE,IE,LE utility
    class AD,SD app
```
