# irsgov/ides-data-preparation-dot-net architecture

> Architecture diagram of the GitHub repository irsgov/ides-data-preparation-dot-net, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/irsgov/ides-data-preparation-dot-net
- Repository: https://github.com/irsgov/ides-data-preparation-dot-net

## Overview

##### Project type and purpose
- This is a .NET Framework desktop application (WinForms) whose sole purpose is to prepare and securely transmit FATCA data to the IRS’s IDES service.
- Key indicators: Presence of Form1.cs/Form1.Designer.cs (UI layers), Program.cs entry point, and helper classes for encryption, XML management, zipping, and SFTP transfer.

##### File structure
- Top‐level files:
- Form1.* → Windows Forms UI
- Program.cs → Application bootstrap
- Helpers/ → Core domain logic packed into modular services
- README, LICENSE, and PDF guides → Documentation
- No “backend” server here—this is a single client‐side application. The “Helpers” directory implements discrete responsibilities (Encryption, XML, ZIP, SFTP).
- No database; external dependency is the IRS IDES SFTP endpoint.

##### Extract insights from the README
- This sample implements the “data preparation process” for IDES:
- XML Schema validation
- ZIP packaging
- AES encryption + RSA signature
- SFTP upload

##### Components & relationships
a. Main components
- Presentation Layer: WinForms (Form1)
- Core Services (Helpers directory):
– AesManager (symmetric encryption)
– RSAPKCS1SHA256SignatureDescription (digital signature)
– XmlManager (XML marshalling + schema validation)
– ZipManager (archive creation)
– SftpManager (secure file transfer)
– ExtensionMethods (utility functions)
- External Systems:
– Local File System (input CSV / other data files, output encrypted packages)
– IRS IDES SFTP Server (remote target)
b. Relationships & data flows
1. User launches application → UI prompts for input files / parameters
2. UI calls XmlManager to build and validate XML
3. UI calls ZipManager to archive the validated XML
4. UI triggers AesManager to encrypt the ZIP file
5. UI invokes RSAPKCS1SHA256SignatureDescription to sign the encrypted bundle
6. UI uses SftpManager to upload the encrypted + signed package to IRS IDES endpoint
7. UI displays success/failure status
c. Architectural patterns & principles
- Single Responsibility Principle: each Helper class does one thing
- Layered approach: Presentation → Service/Domain → External systems
- Dependency injection (if present) or clear service invocation from UI
d. Key technologies/frameworks
- .NET Framework WinForms
- .NET Cryptography APIs (AES, RSA)
- SSH.NET or equivalent SFTP library
- System.IO.Compression (ZIP)
- System.Xml for schema validation

##### Detail focus
- Configuration sources (e.g., credentials for SFTP).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Program["Program.cs"]:::ui
        FormDesigner["Form1.Designer.cs"]:::ui
        FormResx["Form1.resx"]:::ui
        FormCode["Form1.cs"]:::ui
    end

    %% Core Services
    subgraph "Core Services"
        direction TB
        XmlMgr["XmlManager\n(XML marshalling + schema validation)"]:::service
        ZipMgr["ZipManager\n(Archive creation)"]:::service
        AesMgr["AesManager\n(AES-256 encryption)"]:::service
        RsaSigner["RSAPKCS1SHA256SignatureDescription\n(RSA signature)"]:::service
        SftpMgr["SftpManager\n(SFTP upload)"]:::service
        ExtMethods["ExtensionMethods\n(Utilities)"]:::service
    end

    %% External Systems
    FileSys(("Local File System")):::fs
    IRS(("IRS IDES SFTP Server")):::external

    %% Flows
    Program -->|"launch"| FormCode
    FormCode -->|"build & validate XML"| XmlMgr
    XmlMgr -->|"validated XML"| FileSys
    FormCode -->|"archive XML"| ZipMgr
    ZipMgr -->|"ZIP file"| FileSys
    FormCode -->|"encrypt ZIP"| AesMgr
    AesMgr -->|"encrypted bundle"| FileSys
    FormCode -->|"sign bundle"| RsaSigner
    RsaSigner -->|"signed package"| FileSys
    FormCode -->|"upload package"| SftpMgr
    SftpMgr -->|"SFTP over SSH"| IRS
    IRS -->|"response status"| FormCode

    %% Click Events
    click Program "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Program.cs"
    click FormDesigner "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Form1.Designer.cs"
    click FormResx "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Form1.resx"
    click FormCode "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Form1.cs"
    click XmlMgr "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/XmlManager.cs"
    click ZipMgr "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/ZipManager.cs"
    click AesMgr "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/AesManager.cs"
    click RsaSigner "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/RSAPKCS1SHA256SignatureDescription.cs"
    click SftpMgr "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/SFTPManager.cs"
    click ExtMethods "https://github.com/irsgov/ides-data-preparation-dot-net/blob/master/Helpers/ExtensionMethods.cs"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#333,stroke-width:1px
    classDef service fill:#D5F5E3,stroke:#333,stroke-width:1px
    classDef fs fill:#DDDDDD,stroke:#333,stroke-width:1px
    classDef external fill:#FFE6CC,stroke:#333,stroke-width:1px
```
