# sokmontrey/cyphex architecture

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

- Interactive diagram: https://gitdiagram.com/sokmontrey/cyphex
- Repository: https://github.com/sokmontrey/cyphex

## Overview

##### Main Components

A. Frontend Layer (SvelteKit Application)
- User Interface Components
- Image Processing Interface
- Steganography Methods Manager
- Pipeline Processing System

B. Core Processing Layer
- Steganography Methods Implementation
- Image Processing Utilities
- Error Handling System
- File Management System

##### Key Relationships to Highlight

- Flow of data through the pipeline using railway-oriented programming style:
- Success track (main flow)
- Error track (parallel error handling flow)
- Clear separation between:
- User interaction components
- Processing logic
- Utility functions

##### Technical Details

- SvelteKit as the framework
- Tailwind CSS for styling
- TypeScript type definitions
- Image processing capabilities
- File handling systems

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Legend"
        UI[UI Component]:::frontend
        PL[Pipeline Component]:::pipeline
        UT[Utility Component]:::utility
        style Legend fill:#f0f0f0,stroke:#333
    end

    subgraph "Frontend Layer"
        II[ImageInput]:::frontend
        AP[ApplyPayload]:::frontend
        EP[ExtractPayload]:::frontend
        SM[SettingManager]:::frontend
        MT[Method]:::frontend
        ML[Main Layout]:::frontend
        MP[Main Page]:::frontend
    end

    subgraph "Processing Pipeline"
        IP[Input Processing]:::pipeline
        SMS[Method Selection]:::pipeline
        IMG[Image Processing]:::pipeline
        PH[Payload Handling]:::pipeline
        
        subgraph "Steganography Methods"
            LSB[LSB Implementation]:::pipeline
            MTHD[Methods Manager]:::pipeline
        end
    end

    subgraph "Core Utilities"
        IU[Image Utils]:::utility
        FU[File Utils]:::utility
        TU[Text Utils]:::utility
        EH[Error Handler]:::utility
        FP[FP Utils]:::utility
        SU[Steg Utils]:::utility
    end

    II --> IP
    AP --> SMS
    EP --> SMS
    SM --> MTHD
    MT --> MTHD

    IP --> IMG
    SMS --> LSB
    LSB --> IMG
    IMG --> PH

    IMG --> IU
    PH --> FU
    PH --> TU
    IP --> EH
    LSB --> SU
    MTHD --> FP

    classDef frontend fill:#e1f5fe,stroke:#01579b
    classDef pipeline fill:#fff3e0,stroke:#e65100
    classDef utility fill:#e8f5e9,stroke:#1b5e20

    click II "https://github.com/sokmontrey/cyphex/blob/master/src/lib/components/ImageInput.svelte"
    click AP "https://github.com/sokmontrey/cyphex/blob/master/src/lib/components/ApplyPayload.svelte"
    click EP "https://github.com/sokmontrey/cyphex/blob/master/src/lib/components/ExtractPayload.svelte"
    click SM "https://github.com/sokmontrey/cyphex/blob/master/src/lib/components/SettingManager.svelte"
    click MT "https://github.com/sokmontrey/cyphex/blob/master/src/lib/components/Method.svelte"
    click ML "https://github.com/sokmontrey/cyphex/blob/master/src/routes/+layout.svelte"
    click MP "https://github.com/sokmontrey/cyphex/blob/master/src/routes/+page.svelte"
    click LSB "https://github.com/sokmontrey/cyphex/blob/master/src/lib/steg_methods/lsb.ts"
    click MTHD "https://github.com/sokmontrey/cyphex/blob/master/src/lib/steg_methods/methods.ts"
    click IU "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/image.ts"
    click FU "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/file.ts"
    click TU "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/text.ts"
    click EH "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/error.ts"
    click FP "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/functional.ts"
    click SU "https://github.com/sokmontrey/cyphex/blob/master/src/lib/utils/steg.ts"
```
