# sorairolake/abcrypt architecture

> Architecture diagram of the GitHub repository sorairolake/abcrypt, 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/sorairolake/abcrypt
- Repository: https://github.com/sorairolake/abcrypt

## Overview

##### Main Components
- Core Library (abcrypt): This is the heart of the project (located under crates/abcrypt). It defines the encryption format, the algorithms for encryption/decryption, and parameter management.
- CLI Tool (abcrypt-cli): Provides the command-line interface that leverages the core library functions.
- C Bindings (abcrypt-capi): Exposes a C API so that other applications written in C/C++ or other languages interfacing with C can use the encryption library.
- WebAssembly Bindings (abcrypt-wasm): Enables the library to be used in JavaScript/web contexts, typically distributed via npm.
- Python Bindings (abcrypt-py): Allows the core functionality to be accessed from Python applications.

##### Architectural Patterns & Design Principles
- Modularization: The project is effectively split into distinct modules (core, CLI, C API, WASM, Python), each isolated in its own crate. This separation makes it easy to develop, test, and deploy independently.
- Adapter/Wrapper Pattern: The CLI, C API, WASM, and Python components are adapters/wrappers around the core library, ensuring that the encryption functionality can be accessed in different environments.
- Documentation & DevOps: With the comprehensive docs (Antora and man pages) and automated workflows, there is a strong emphasis on maintainability and continuous integration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    CORE["abcrypt Core Library"]:::core
    CLI["CLI Tool (abcrypt-cli)"]:::adapter
    CAP["C API Bindings (abcrypt-capi)"]:::adapter
    WASM["WebAssembly Bindings (abcrypt-wasm)"]:::adapter
    PY["Python Bindings (abcrypt-py)"]:::adapter
    CI["CI/CD & Automated Testing"]:::infra
    DOC["Documentation & Examples"]:::infra

    CLI -->|"depends_on"| CORE
    CAP -->|"depends_on"| CORE
    WASM -->|"depends_on"| CORE
    PY -->|"depends_on"| CORE

    CI -->|"triggers"| CORE
    CI -->|"triggers"| CLI
    CI -->|"triggers"| CAP
    CI -->|"triggers"| WASM
    CI -->|"triggers"| PY

    DOC -->|"supports"| CORE
    DOC -->|"supports"| CLI
    DOC -->|"supports"| CAP
    DOC -->|"supports"| WASM
    DOC -->|"supports"| PY

    classDef core fill:#C4E1FF,stroke:#036,stroke-width:2px;
    classDef adapter fill:#CFF0CC,stroke:#0A3,stroke-width:2px;
    classDef infra fill:#F1E7FF,stroke:#804,stroke-width:2px;

    click CORE "https://github.com/sorairolake/abcrypt/tree/develop/crates/abcrypt"
    click CLI "https://github.com/sorairolake/abcrypt/tree/develop/crates/cli"
    click CAP "https://github.com/sorairolake/abcrypt/tree/develop/crates/capi"
    click WASM "https://github.com/sorairolake/abcrypt/tree/develop/crates/wasm"
    click PY "https://github.com/sorairolake/abcrypt/tree/develop/crates/python"
    click CI "https://github.com/sorairolake/abcrypt/tree/develop/.github/workflows"
    click DOC "https://github.com/sorairolake/abcrypt/tree/develop/docs"
```
