# karanveersp/cypherfs architecture

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

- Interactive diagram: https://gitdiagram.com/karanveersp/cypherfs
- Repository: https://github.com/karanveersp/cypherfs

## Overview

##### Project type and purpose
- This is an open-source, Windows-targeted command-line password manager (“CypherFS”) written in F#/.NET.
- It provides a CLI front end (CypherCLI.Fs) that uses a core library (CypherCLI.Lib) to encrypt/decrypt text, and an automated test project (CypherCLI.Tests).

##### File structure
- Top-level solution (CypherFS.sln) ties together three F# projects and a test project.
- CypherCLI.Fs: the executable. Contains Program.fs (entry point), Model.fs (data structures), Util.fs (I/O helpers), and README.md for its submodule.
- CypherCLI.Lib: holds Crypto.fs with the core cryptographic routines.
- CypherCLI.Tests: unit tests validating encryption/decryption logic.
- .github/workflows: CI pipeline (dotnet build/test).
- global.json: pins .NET SDK version.
- images/: project assets (logo, demo GIF).

##### README for additional insights
- Describes the tool’s function: encrypt text on the command line, share securely.
- Emphasizes Windows support, pending cross-platform work.
- No external dependencies beyond .NET and built-in cryptography.

##### Key details to capture
- Clearly separate the three F# projects and their concerns
- One-way dependency of the CLI on the library, and the library’s independence from I/O
- Entry points (Program.fs) and modules (Model.fs, Util.fs, Crypto.fs)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    User("User (Console)"):::external
    FileSystem("File System"):::external
    CIService("GitHub Actions"):::ci

    %% CLI Front End Subgraph
    subgraph "CLI Front End (CypherCLI.Fs)"
        direction TB
        Program["Program.fs\n(entry point)"]:::presentation
        Model["Model.fs\n(Configuration/Settings)"]:::presentation
        Util["Util.fs\n(I/O Utilities)"]:::infra
    end

    %% Core Library Subgraph
    subgraph "Core Library (CypherCLI.Lib)"
        direction TB
        Crypto["Crypto.fs\n(Domain Logic)"]:::domain
    end

    %% Tests Subgraph
    subgraph "Tests (CypherCLI.Tests)"
        direction TB
        Tests["Tests.fs\n(Unit Tests)"]:::ci
    end

    %% CI Pipeline Node
    CIService -->|triggers build & test| Program

    %% User interactions
    User -->|runs commands| Program
    Program -->|parses commands & flags| Model
    Program -->|calls I/O utilities| Util
    Program -->|encrypt/decrypt calls| Crypto
    Crypto -->|returns encrypted/decrypted data| Program
    Util -->|read/write files| FileSystem
    Program -->|persist encrypted blobs| FileSystem

    %% Tests interactions
    Tests -->|tests domain logic| Crypto

    %% Click events
    click Program "https://github.com/karanveersp/cypherfs/blob/main/CypherCLI.Fs/Program.fs"
    click Model "https://github.com/karanveersp/cypherfs/blob/main/CypherCLI.Fs/Model.fs"
    click Util "https://github.com/karanveersp/cypherfs/blob/main/CypherCLI.Fs/Util.fs"
    click Crypto "https://github.com/karanveersp/cypherfs/blob/main/CypherCLI.Lib/Crypto.fs"
    click Tests "https://github.com/karanveersp/cypherfs/blob/main/CypherCLI.Tests/Tests.fs"
    click CIService "https://github.com/karanveersp/cypherfs/blob/main/.github/workflows/dotnet-ci.yml"

    %% Styles
    classDef presentation fill:#D6EAF8,stroke:#1B4F72,color:#1B4F72;
    classDef domain fill:#D5F5E3,stroke:#186A3B,color:#186A3B;
    classDef infra fill:#F2F3F4,stroke:#616A6B,color:#616A6B;
    classDef ci fill:#FCF3CF,stroke:#B9770E,color:#B9770E;
    classDef external fill:#F8F9F9,stroke:#7B7D7D,color:#7B7D7D;
```
