# nickvisionapps/denaro architecture

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

- Interactive diagram: https://gitdiagram.com/nickvisionapps/denaro
- Repository: https://github.com/nickvisionapps/denaro

## Overview

##### Main Components
- User Interface (UI) Layer: Represented by the NickvisionMoney.GNOME directory. This layer contains blueprints, controls, views, and resources (CSS, assets, screenshots). It is responsible for interacting with the user and handling the presentation using GNOME/GTK technologies.
- Application/Business Logic Layer: Found in the NickvisionMoney.Shared directory. It includes controllers (e.g., AccountSettingsDialogController, DashboardViewController), models (Account, Transaction, Transfer, etc.), events, and helpers. This layer implements the core functionalities like transaction management, account operations, and currency conversion.
- Testing Suite: The NickvisionMoney.Shared.Tests directory contains unit tests that verify the behavior of business logic components.
- Build and Deployment Components: The existence of CakeScripts, along with flatpak and snap directories, indicates that build automation, packaging, and deployment (to Flatpak, Snap, and even AUR builds) are streamlined with automated CI/CD workflows.

##### Relationships and Interactions
- The UI layer consumes the Application Logic layer. For example, UI views and controls in NickvisionMoney.GNOME (e.g., MainWindow, AccountView, dialogs) interact with corresponding controllers in the Shared project.
- Controllers manage user input and orchestrate calls to helper classes and models to carry out operations (like filtering transactions, importing/exporting data, or transferring funds).
- The testing module verifies that the controllers and models function correctly, ensuring business logic is decoupled from the presentation layer.
- The build and packaging system provides the integration layer that converts source code into distributable Snap/Flatpak packages, with CI/CD configured through GitHub workflows.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project is clearly split into UI (NickvisionMoney.GNOME), shared business logic (NickvisionMoney.Shared), and tests (NickvisionMoney.Shared.Tests). This separation supports maintainability and testability.
- MVC/MVVM-like Pattern: The structure hints at an MVC-like approach, where views (in the UI project) are separated from controllers (in the shared project) and models.
- Cross-Layer Communication: Controllers serve as a bridge between the UI and the model/higher-level business logic.
- Packaging/Deployment Abstraction: The use of CakeScripts and packaging directories (flatpak, snap) abstracts away the deployment concerns from the core application logic.

##### Major Technologies, Frameworks, and Tools
- .NET 8 as the runtime/framework.
- C# for application logic.
- GNOME/GTK (implicitly by the presence of GNOME-specific theming and blueprint files) for the UI.
- Build automation tools via Cake, with configurations for continuous integration/deployment via GitHub Actions and packaging formats like Flatpak and Snap.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer (GNOME Presentation)"
        UI_GNOME["NickvisionMoney.GNOME"]:::ui
        UI_Blueprints["Blueprints"]:::ui
        UI_Controls["Controls"]:::ui
        UI_Views["Views"]:::ui
        UI_Resources["Resources"]:::ui
        UI_Screenshots["Screenshots"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        BL["NickvisionMoney.Shared"]:::bl
        BL_Controllers["Controllers"]:::bl
        BL_Models["Models"]:::bl
        BL_Helpers["Helpers"]:::bl
        BL_Events["Events"]:::bl
        BL_Resources["Resources"]:::bl
        BL_Linux["Linux"]:::bl
    end

    %% Testing Suite
    subgraph "Testing Suite"
        TESTS["NickvisionMoney.Shared.Tests"]:::test
    end

    %% Build and Deployment Components
    subgraph "Build & Deployment"
        BS["CakeScripts"]:::build
        FP["flatpak"]:::build
        SNAP["snap"]:::build
        GH["GitHub Workflows"]:::build
    end

    %% Relationships between UI and Business Logic
    UI_Views -->|"calls"| BL_Controllers
    UI_Controls -->|"triggers"| BL_Controllers

    %% Internal Business Logic interactions
    BL_Controllers -->|"processes"| BL_Models
    BL_Controllers -->|"uses"| BL_Helpers
    BL_Controllers -->|"emits"| BL_Events

    %% Testing validates Business Logic
    TESTS -->|"tests"| BL_Controllers
    TESTS -->|"tests"| BL_Models

    %% Build & Deployment orchestration
    GH -->|"triggers"| BS
    BS -->|"builds"| UI_GNOME
    BS -->|"builds"| BL
    FP -->|"packages"| BS
    SNAP -->|"packages"| BS

    %% Styles
    classDef ui fill:#BBDEFB,stroke:#0D47A1,stroke-width:2px;
    classDef bl fill:#C8E6C9,stroke:#1B5E20,stroke-width:2px;
    classDef test fill:#FFE0B2,stroke:#E65100,stroke-width:2px;
    classDef build fill:#CFD8DC,stroke:#37474F,stroke-width:2px;

    %% Click Events for UI Layer
    click UI_GNOME "https://github.com/nickvisionapps/denaro/blob/main/NickvisionMoney.GNOME"
    click UI_Blueprints "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.GNOME/Blueprints"
    click UI_Controls "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.GNOME/Controls"
    click UI_Views "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.GNOME/Views"
    click UI_Resources "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.GNOME/Resources"
    click UI_Screenshots "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.GNOME/Screenshots"

    %% Click Events for Business Logic Layer
    click BL "https://github.com/nickvisionapps/denaro/blob/main/NickvisionMoney.Shared"
    click BL_Controllers "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Controllers"
    click BL_Models "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Models"
    click BL_Helpers "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Helpers"
    click BL_Events "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Events"
    click BL_Resources "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Resources"
    click BL_Linux "https://github.com/nickvisionapps/denaro/tree/main/NickvisionMoney.Shared/Linux"

    %% Click Event for Testing Suite
    click TESTS "https://github.com/nickvisionapps/denaro/blob/main/NickvisionMoney.Shared.Tests"

    %% Click Events for Build & Deployment
    click BS "https://github.com/nickvisionapps/denaro/tree/main/CakeScripts"
    click FP "https://github.com/nickvisionapps/denaro/tree/main/flatpak"
    click SNAP "https://github.com/nickvisionapps/denaro/tree/main/snap"
    click GH "https://github.com/nickvisionapps/denaro/tree/main/.github/workflows"
```
