# serbanu/misyshackathon architecture

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

- Interactive diagram: https://gitdiagram.com/serbanu/misyshackathon
- Repository: https://github.com/serbanu/misyshackathon

## Overview

##### Project type and purpose
- This repo contains two separate Visual Studio solutions:
- ConsoleApplication1 – a .NET Framework command-line tool (ConsoleApplication1.csproj) that appears to perform I/O operations and handle “TablesCorrespondents” logic, using Npgsql for PostgreSQL connectivity.
- OutlookAddIn22 – a VSTO add-in for Microsoft Outlook (OutlookAddIn22.csproj) that hooks into Outlook events via the Office Tools runtime and provides custom functionality (PictureDispConverter, ThisAddIn.cs).
- The README simply labels it “MisysHackathon,” suggesting these are proof-of-concept/hackathon utilities rather than a single unified product.

##### File structure
- Each solution follows the standard VS layout:
· /<SolutionFolder>/*.sln, *.suo at root
· /<ProjectFolder>/*.csproj, *.Designer.cs, Properties/, Resources/
· /bin/Debug and /obj/Debug build outputs
- Key directories and files:
· ConsoleApplication1/IO_Operations.cs and TablesCorrespondents.cs – business-logic classes
· ConsoleApplication1/App.config – DB connection strings or other settings
· OutlookAddIn22/ThisAddIn.cs – entry point for the VSTO add-in
· OutlookAddIn22/PictureDispConverter.cs – custom utility class
· OutlookAddIn22/Properties/Resources.resx, Settings.settings – add-in configuration

##### README for additional insights
· Both projects reference .NET Framework assemblies.
· The console app references Npgsql (PostgreSQL driver).
· The add-in depends on Microsoft.Office.Tools.Outlook.v4.0 and the VSTO runtime.

##### Core components
a. Components
- ConsoleApplication1 (CLI application)
– IO Operations module
– TablesCorrespondents module
– Configuration (App.config)
– Data Access via Npgsql (.NET PostgreSQL driver)
- OutlookAddIn22 (VSTO add-in)
– ThisAddIn event handler (load/unload Outlook events)
– PictureDispConverter utility
– Resources & Settings for the add-in
– Dependency on Microsoft Office Tools runtime
- External Systems
– PostgreSQL database instance
– Microsoft Outlook application & COM interop / VSTO runtime

b. Relationships and interactions
– The console app reads from/writes to the PostgreSQL database using Npgsql and executes business logic in IO_Operations and TablesCorrespondents.
– The Outlook add-in runs inside Outlook, listens to mail/calendar events, invokes PictureDispConverter or other modules, and may also connect to the same database (if configured) or push data via a service.

c. Architectural patterns & design principles
– Layered architecture:
· Presentation layer (Console CLI vs. Outlook UI hooks)
· Business logic layer (IO_Operations, TablesCorrespondents, PictureDispConverter)
· Data access layer (Npgsql calls, App.config)
– VSTO Add-in pattern for Office extensibility
– Configuration-driven database connectivity

d. Relevant technologies/frameworks
– .NET Framework (C#)
– VSTO (Microsoft.Office.Tools.Outlook.v4.0)
– Npgsql (PostgreSQL .NET data provider)
– Visual Studio build outputs (.exe, .vsto)

##### Detailed breakdown to capture essential elements
- On the left, stack the ConsoleApplication1 layers:
[CLI UI] → [Business Logic: IO_Operations / TablesCorrespondents] → [Data Access: Npgsql] → [PostgreSQL DB]
- On the right, stack the Outlook add-in:
[Outlook Host (COM/VSTO)] → [ThisAddIn.cs (Event Handler)] → [Business Logic: PictureDispConverter] → (optional)[DB]
- Config files (App.config, Settings.settings) attached to each module
- Build artefacts (bin/Debug/*.exe, .vsto) as deployment outputs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Console Application Section
    subgraph "ConsoleApplication1 (.NET CLI)"
        SLN_Console["ConsoleApplication1.sln"]:::artifact
        CLIExe["ConsoleApplication1.exe"]:::artifact
        Config["App.config"]:::config
        IO["IO_Operations.cs"]:::logic
        TC["TablesCorespondents.cs"]:::logic
        NpgsqlPDB["Npgsql.pdb"]:::data
        NpgsqlXML["Npgsql.xml"]:::data
    end

    %% Outlook Add-in Section
    subgraph "OutlookAddIn22 (VSTO Add-in)"
        SLN_Outlook["OutlookAddIn22.sln"]:::artifact
        Host["Outlook Host (COM/VSTO)"]:::external
        ThisAddin["ThisAddIn.cs"]:::logic
        Converter["PictureDispConverter.cs"]:::logic
        ResourcesResx["Resources.resx"]:::config
        ResourcesDesigner["Resources.Designer.cs"]:::config
        SettingsSettings["Settings.settings"]:::config
        SettingsDesigner["Settings.Designer.cs"]:::config
        OfficeUtils1["Microsoft.Office.Tools.Outlook.v4.0.Utilities.xml"]:::external
        OfficeUtils2["Microsoft.Office.Tools.Common.v4.0.Utilities.xml"]:::external
        VSTOArtifact["OutlookAddIn22.vsto"]:::artifact
    end

    %% External Database
    DB["PostgreSQL DB"]:::datastore

    %% Console Application Flows
    SLN_Console --> CLIExe
    CLIExe --> IO
    CLIExe --> TC
    CLIExe --> Config
    IO --> NpgsqlPDB
    IO --> NpgsqlXML
    TC --> NpgsqlPDB
    TC --> NpgsqlXML
    NpgsqlPDB --> DB
    NpgsqlXML --> DB

    %% Outlook Add-in Flows
    SLN_Outlook --> VSTOArtifact
    Host --> ThisAddin
    ThisAddin --> Converter
    ThisAddin --> ResourcesResx
    ThisAddin --> ResourcesDesigner
    ThisAddin --> SettingsSettings
    ThisAddin --> SettingsDesigner
    ThisAddin --> OfficeUtils1
    ThisAddin --> OfficeUtils2
    Converter -.-> DB

    %% Click Events for ConsoleApplication1
    click SLN_Console "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1.sln"
    click CLIExe "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/bin/Debug/ConsoleApplication1.exe"
    click Config "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/App.config"
    click IO "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/IO_Operations.cs"
    click TC "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/TablesCorespondents.cs"
    click NpgsqlPDB "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/bin/Debug/Npgsql.pdb"
    click NpgsqlXML "https://github.com/serbanu/misyshackathon/blob/master/ConsoleApplication1/ConsoleApplication1/bin/Debug/Npgsql.xml"

    %% Click Events for OutlookAddIn22
    click SLN_Outlook "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22.sln"
    click ThisAddin "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/ThisAddIn.cs"
    click Converter "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/PictureDispConverter.cs"
    click ResourcesResx "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/Properties/Resources.resx"
    click ResourcesDesigner "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/Properties/Resources.Designer.cs"
    click SettingsSettings "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/Properties/Settings.settings"
    click SettingsDesigner "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/Properties/Settings.Designer.cs"
    click OfficeUtils1 "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/bin/Debug/Microsoft.Office.Tools.Outlook.v4.0.Utilities.xml"
    click OfficeUtils2 "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/bin/Debug/Microsoft.Office.Tools.Common.v4.0.Utilities.xml"
    click VSTOArtifact "https://github.com/serbanu/misyshackathon/blob/master/OutlookAddIn22/OutlookAddIn22/bin/Debug/OutlookAddIn22.vsto"

    %% Styles
    classDef logic fill:#D6EAF8,stroke:#1B4F72,color:#1B2631
    classDef data fill:#D1F2EB,stroke:#196F3D,color:#0E6251
    classDef config fill:#FCF3CF,stroke:#7D6608,color:#7E5109
    classDef external fill:#F5B7B1,stroke:#922B21,color:#641E16
    classDef artifact fill:#E8DAEF,stroke:#6C3483,color:#4A235A
    classDef datastore fill:#ABEBC6,stroke:#1D8348,color:#0E6251
```
