# rahim-gh/mypocket architecture

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

- Interactive diagram: https://gitdiagram.com/rahim-gh/mypocket
- Repository: https://github.com/rahim-gh/mypocket

## Overview

##### Main Components Identification
The system can be broken down into these key architectural layers:

- Presentation Layer (UI)
- Business Logic Layer
- Data Access Layer
- Utilities Layer
- Database Layer

##### Component Relationships

Key interactions:
- UI Controllers → Business Logic
- Business Logic → Data Access
- Data Access → Database
- Cross-cutting concerns (Utilities) → All Layers

##### Specific Implementation Details

Architectural patterns:
- MVC Pattern (Model-View-Controller)
- Models: Account.java
- Views: FXML files
- Controllers: *Controller.java files
- Repository Pattern for database access
- Service Layer Pattern for business logic

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[MyExpense System Architecture]:::title
    
    %% Layers
    subgraph UI
        LoginWindowFXML["loginWindow.fxml"]:::ui
        LoginWindowJava["LoginWindow.java"]:::ui
        MyExpenseWindowFXML["MyExpenseWindow.fxml"]:::ui
        AddTransactionFXML["addTransaction.fxml"]:::ui
        AddTransactionController["AddTransactionController.java"]:::ui
    end

    subgraph BusinessLogic
        AuthControl["AuthControl"]:::business
        TransactionControl["TransactionControl"]:::business
        InformationsControl["InformationsControl"]:::business
        Currency["Currency"]:::business
    end

    subgraph DataAccess
        DBConnection["DBConnection"]:::data
        DBQueries["DBQueries"]:::data
    end

    subgraph Utils
        ExceptionControl["ExceptionControl"]:::util
        LoggerControl["LoggerControl"]:::util
        PasswordHasher["PasswordHasher"]:::util
    end

    subgraph Models
        Account["Account"]:::model
    end

    subgraph Database
        SQLite[(SQLite Database)]:::database
    end

    %% Main Application
    MyExpense["MyExpense.java"]:::main

    %% External Dependencies
    SQLiteJDBC["sqlite-jdbc"]:::external

    %% Relationships
    MyExpense --> LoginWindowJava
    LoginWindowFXML --> LoginWindowJava
    LoginWindowJava --> AuthControl
    MyExpenseWindowFXML --> TransactionControl
    AddTransactionFXML --> AddTransactionController
    AddTransactionController --> TransactionControl

    AuthControl --> DBQueries
    TransactionControl --> DBQueries
    InformationsControl --> DBQueries
    DBQueries --> DBConnection
    DBConnection --> SQLite
    DBConnection --> SQLiteJDBC

    AuthControl --> PasswordHasher
    DBConnection --> ExceptionControl
    MyExpense --> LoggerControl

    TransactionControl --> Account
    InformationsControl --> Currency

    %% Click Events
    click LoginWindowFXML "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/ui/loginWindow.fxml"
    click LoginWindowJava "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/ui/LoginWindow.java"
    click MyExpenseWindowFXML "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/ui/MyExpenseWindow.fxml"
    click AddTransactionFXML "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/ui/addTransaction.fxml"
    click AddTransactionController "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/ui/AddTransactionController.java"
    click AuthControl "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/logic/AuthControl.java"
    click TransactionControl "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/logic/TransactionControl.java"
    click InformationsControl "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/logic/InformationsControl.java"
    click Currency "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/logic/Currency.java"
    click DBConnection "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/database/DBConnection.java"
    click DBQueries "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/database/DBQueries.java"
    click ExceptionControl "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/utils/ExceptionControl.java"
    click LoggerControl "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/utils/LoggerControl.java"
    click PasswordHasher "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/utils/PasswordHasher.java"
    click Account "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/models/Account.java"
    click MyExpense "https://github.com/rahim-gh/MyPocket/blob/master/src/myexpense/MyExpense.java"
    click SQLiteJDBC "https://github.com/rahim-gh/MyPocket/blob/master/lib/sqlite-jdbc-3.47.1.0.jar"

    %% Styles
    classDef title fill:#f9f,stroke:#333,stroke-width:4px
    classDef ui fill:#a8d1f0,stroke:#333
    classDef business fill:#90EE90,stroke:#333
    classDef data fill:#FFE5B4,stroke:#333
    classDef util fill:#D3D3D3,stroke:#333
    classDef model fill:#DDA0DD,stroke:#333
    classDef database fill:#B19CD9,stroke:#333
    classDef main fill:#FF9999,stroke:#333
    classDef external fill:#E6E6FA,stroke:#333
```
