# dlddu/hackathon-pmyo architecture

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

- Interactive diagram: https://gitdiagram.com/dlddu/hackathon-pmyo
- Repository: https://github.com/dlddu/hackathon-pmyo

## Overview

##### Main Components

a. Client Layer
- Web Browsers/Mobile Clients
- Interaction with the application's controllers

b. Application Layer (Spring Boot)
- Controllers Package
- DashboardController
- GptsController
- MainController
- RecycleResultsController
- RefundPriceController
- UserController

c. Service Layer
- GptsService
- (Indicate potential for other services)

d. Data Layer
- Model Package
- Category
- RecycleResult
- User
- Database (indicated by Liquibase changelog files)

e. External Services
- AWS S3 (indicated by S3Config.java)
- AWS Cloud9 Environment

**[Client Layer]**
- ↓
**[Controllers Layer]**
- ↓
**[Service Layer]**
- ↓
**[Data Layer]**

##### Key Relationships to Highlight

a. Client-Controller Interactions:
- RESTful endpoints from controllers
- Related controllers (e.g., RecycleResults and RefundPrice)

b. Service Layer Dependencies:
- GptsService interactions
- Potential service-to-service communication

c. Data Flow:
- Model interactions with RecycleResultRepository
- Database operations through JPA/Hibernate
- S3 storage interactions

##### Technical Stack Elements

- Spring Boot Framework
- AWS S3 Storage
- Liquibase Database Migration
- Gradle Build System
- JPA/Hibernate ORM

Create distinct sections for:

##### Additional Notes

- Version information
- Database migration flow
- Security boundaries
- Async operations if present

Remember to include:
- Error handling flows
- Security boundaries
- Database transaction boundaries
- AWS service integration points
- API endpoints grouping

This will provide a comprehensive view of the application's architecture while maintaining clarity and usefulness for development and deployment discussions.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef client fill:#E1F5FE,stroke:#01579B
    classDef controller fill:#E3F2FD,stroke:#1565C0
    classDef service fill:#E8F5E9,stroke:#2E7D32
    classDef model fill:#FFF3E0,stroke:#E65100
    classDef database fill:#EFEBE9,stroke:#3E2723
    classDef external fill:#F3E5F5,stroke:#4A148C
    classDef aws fill:#FCE4EC,stroke:#880E4F

    %% Client Layer
    Client[Client Applications]:::client

    %% Controllers Layer
    subgraph Controllers
        DC["Dashboard Controller"]:::controller
        GC["GPTs Controller"]:::controller
        MC["Main Controller"]:::controller
        RRC["Recycle Results Controller"]:::controller
        RPC["Refund Price Controller"]:::controller
        UC["User Controller"]:::controller
    end

    %% Service Layer
    subgraph Services
        GS["GPTs Service"]:::service
    end

    %% Data Layer
    subgraph Models
        CM["Category Model"]:::model
        RRM["Recycle Result Model"]:::model
        UM["User Model"]:::model
        RR["Recycle Result Repository"]:::model
    end

    %% Database Layer
    DB[(Database)]:::database
    LQ["Liquibase Migrations"]:::database

    %% External Services
    subgraph AWS
        S3["AWS S3 Storage"]:::aws
        S3C["S3 Config"]:::aws
    end

    %% Relationships
    Client --> DC & GC & MC & RRC & RPC & UC
    
    GC --> GS
    RRC --> RR
    
    GS --> RRM
    RR --> DB
    
    RRM --> CM
    RRM --> UM
    
    S3C --> S3

    LQ --> DB

    %% Click Events
    click DC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/DashboardController.java"
    click GC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/GptsController.java"
    click MC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/MainController.java"
    click RRC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/RecycleResultsController.java"
    click RPC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/RefundPriceController.java"
    click UC "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/controller/UserController.java"
    click GS "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/service/GptsService.java"
    click CM "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/model/Category.java"
    click RRM "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/model/RecycleResult.java"
    click UM "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/model/User.java"
    click RR "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/model/RecycleResultRepository.java"
    click LQ "https://github.com/dlddu/hackathon-pmyo/tree/main/src/main/resources/db/changelog"
    click S3C "https://github.com/dlddu/hackathon-pmyo/blob/main/src/main/java/com/pmyo/pmyo/S3Config.java"
```
