# greekfetacheese/zeus architecture

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

- Interactive diagram: https://gitdiagram.com/greekfetacheese/zeus
- Repository: https://github.com/greekfetacheese/zeus

## Overview

- GUI Layer – Found in the src/gui directory, this layer contains all the user interface elements (windows, panels, authentication, dApps, settings, wallet views, etc.). It is responsible for presenting data to the user and capturing interactions.
- Core / Business Logic – Housed in src/core, this module implements the wallet management, transaction processing, user account handling, and utility functions (including Ethereum-specific operations and transaction tracing).
- Ethereum and Chain Integration – The crates/zeus-eth directory (and its sub-crates such as abi, amm, currency, wallet, revm‑utils, and types) deals with blockchain communications, building and interpreting transactions, and executing protocols like Uniswap.
- Theming and UI Customization – The crates/egui-theme module provides themes and styling support for the GUI, typically built on egui or a similar Rust-based UI toolkit.

##### Relationships and Interactions
- The GUI layer interacts with the Core business logic to fetch user account information, wallet balances, and to trigger crypto transactions. This interaction is most likely handled through method calls or event-driven signals.
- The Core layer, in turn, communicates with the zeus-eth subsystem for blockchain operations. It uses various modules within that crate to manage smart contract interactions (e.g., ERC20, Uniswap, WETH9) and to perform actions such as syncing pools or managing currency definitions.
- The token list module supplies token data and assets to the GUI, ensuring the user sees accurate visuals for each supported chain.
- The theming module provides the styling information that the GUI layer uses to render a consistent and maintainable user interface.

##### Architectural Patterns and Design Principles
- Separation of Concerns – The design clearly separates the GUI, core/business logic, blockchain communication, and asset management into discrete modules or crates.
- Modular Design – By having independent crates (e.g., zeus-eth, zeus-token-list, egui-theme), each with their own responsibilities, the project adheres to modular development practices. This makes maintenance and testing easier.
- Dependency Injection / Loose Coupling – Although implicit, the project structure suggests that components (like the RPC endpoint handling and theming) are designed to be swappable, following good architectural practices by not hardcoding resources like endpoints.
- Clean Interface Boundaries – The communication between core components (GUI, business logic, external blockchain interfaces) is managed via well-defined interfaces, likely with clear method calls across modules.

##### Final Assembly
- Provide annotations on major architectural choices (modularity, loose coupling, and separation of concerns).

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Tier
    subgraph "User Interface Tier"
        A["GUI (src/gui)"]:::gui
        B["Theming (crates/egui-theme)"]:::theming
    end

    %% Application Logic Tier
    subgraph "Application Logic Tier"
        C["Core Logic (src/core)"]:::core
    end

    %% Blockchain & Assets Tier
    subgraph "Blockchain & Assets Tier"
        D["Blockchain Integration (crates/zeus-eth)"]:::blockchain
        E["Token Management (crates/zeus-token-list & src/assets)"]:::token
    end

    %% External or Future Components
    F["Public RPC (Chainlist)"]:::external
    G["Future Integrations (dApps, CloudBackup)"]:::future

    %% Relationships & Data Flows
    A -->|"triggers"| C
    B -->|"applies_theme"| A
    C -->|"handles_txns"| D
    C -->|"fetches_token_data"| E
    D -->|"uses_RPC"| F
    C ---|"extension_possible"| G

    %% Click Events
    click A "https://github.com/greekfetacheese/zeus/tree/master/src/gui"
    click C "https://github.com/greekfetacheese/zeus/tree/master/src/core"
    click D "https://github.com/greekfetacheese/zeus/tree/master/crates/zeus-eth"
    click E "https://github.com/greekfetacheese/zeus/tree/master/crates/zeus-token-list"
    click E "https://github.com/greekfetacheese/zeus/tree/master/src/assets"
    click B "https://github.com/greekfetacheese/zeus/tree/master/crates/egui-theme"

    %% Styles
    classDef gui fill:#98FB98,stroke:#006400,stroke-width:2px;
    classDef core fill:#ADD8E6,stroke:#00008B,stroke-width:2px;
    classDef blockchain fill:#FFB6C1,stroke:#8B0000,stroke-width:2px;
    classDef token fill:#FFD700,stroke:#B8860B,stroke-width:2px;
    classDef theming fill:#FFA07A,stroke:#CD5C5C,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#696969,stroke-width:2px;
    classDef future fill:#E6E6FA,stroke:#4B0082,stroke-width:2px;
```
