# lauriebonete/ohf-budgetfy architecture

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

- Interactive diagram: https://gitdiagram.com/lauriebonete/ohf-budgetfy
- Repository: https://github.com/lauriebonete/ohf-budgetfy

## Overview

##### Main Architectural Components

a) Presentation Layer:
- Web Interface (Angular.js frontend)
- Controllers package (org.evey.controller & org.ohf.controller)
- HTML/JSP views

b) Business Layer:
- Service Layer (org.evey.service & org.ohf.service)
- Aspect Layer (for cross-cutting concerns like auditing)

c) Data Access Layer:
- DAO Layer (org.evey.dao & org.ohf.dao)
- JPA/Hibernate Implementation
- JDBC Implementation

d) Core Components:
- Security Module
- Audit System
- File Management
- Entity Models

##### Component Relationships

**[Web Layer (Angular.js)] ←→ [REST Controllers]**
- ↓
**[Service Layer with Security]**
- ↓
**[DAO Layer (JPA/JDBC)]**
- ↓
**[Database]**

##### Key Design Elements to Highlight

a) Core Features:
- User Management System
- Program Management
- Activity Tracking
- Voucher System
- Report Generation
- File Management

b) Cross-cutting Concerns:
- Security (Spring Security)
- Auditing (AuditLogAspect)
- Validation
- File Handling

##### Technical Stack Indicators

- Frontend: Angular.js, HTML5, CSS
- Backend: Java, Spring Framework
- Persistence: JPA/Hibernate, JDBC
- Security: Spring Security
- Build: Maven

##### Specific Implementation Details

Specific features:
- Authentication flow
- Program management workflow
- Voucher processing
- Report generation pipeline
- File upload/download mechanism

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef service fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef aspect fill:#9b59b6,stroke:#8e44ad,color:white

    %% Frontend Layer
    subgraph Frontend
        UI["Web Interface (Angular.js)"]
        HTML["HTML/JSP Views"]
    end
    click UI "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/webapp/base/angular/budgetfy-angular.js"
    click HTML "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/webapp/WEB-INF/html/"

    %% Controller Layer
    subgraph Controllers
        CTRL["REST Controllers"]
        FC["File Controller"]
        PC["Program Controller"]
        VC["Voucher Controller"]
        RC["Report Controller"]
    end
    click CTRL "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/controller/"
    click FC "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/evey/controller/FileDetailController.java"
    click PC "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/ohf/controller/ProgramController.java"
    click VC "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/ohf/controller/VoucherController.java"
    click RC "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/ohf/controller/ReportController.java"

    %% Service Layer
    subgraph Services
        SVC["Service Layer"]
        FS["File Service"]
        PS["Program Service"]
        VS["Voucher Service"]
    end
    click SVC "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/service/"
    click FS "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/evey/service/FileDetailService.java"
    click PS "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/ohf/service/ProgramService.java"
    click VS "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/ohf/service/VoucherService.java"

    %% Data Access Layer
    subgraph "Data Access"
        DAO["DAO Layer"]
        JPA["JPA/Hibernate"]
        JDBC["JDBC"]
    end
    click DAO "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/dao/"

    %% Cross-cutting Concerns
    subgraph "Cross-cutting Concerns"
        SEC["Security Module"]
        AUD["Audit System"]
        VAL["Validation"]
    end
    click SEC "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/security/"
    click AUD "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/evey/aspect/AuditLogAspect.java"
    click VAL "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/validator/"

    %% Core Components
    subgraph "Core Components"
        ENT["Entity Models"]
        REP["Report Generation"]
        FM["File Management"]
    end
    click ENT "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/bean/"
    click REP "https://github.com/lauriebonete/ohf-budgetfy/tree/master/src/main/java/org/evey/bean/report/"
    click FM "https://github.com/lauriebonete/ohf-budgetfy/blob/master/src/main/java/org/evey/utility/FileUtil.java"

    %% Database
    DB[(Database)]

    %% Relationships
    UI --> CTRL
    HTML --> CTRL
    CTRL --> SVC
    FC --> FS
    PC --> PS
    VC --> VS
    RC --> REP
    SVC --> DAO
    FS --> DAO
    PS --> DAO
    VS --> DAO
    DAO --> JPA
    DAO --> JDBC
    JPA --> DB
    JDBC --> DB

    %% Cross-cutting relationships
    SEC -.-> SVC
    AUD -.-> SVC
    VAL -.-> CTRL

    %% Style Applications
    class UI,HTML frontend
    class CTRL,FC,PC,VC,RC frontend
    class SVC,FS,PS,VS service
    class DAO,JPA,JDBC data
    class SEC security
    class AUD,VAL aspect

    %% Legend
    subgraph Legend
        L1["Frontend Components"]:::frontend
        L2["Service Components"]:::service
        L3["Data Components"]:::data
        L4["Security Components"]:::security
        L5["Cross-cutting Concerns"]:::aspect
    end
```
