# haazzero/finalproject_homey architecture

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

- Interactive diagram: https://gitdiagram.com/haazzero/finalproject_homey
- Repository: https://github.com/haazzero/finalproject_homey

## Overview

##### Project Type and Purpose
- This is a monolithic, full-stack web application built on Spring MVC with MyBatis and Oracle.
- It serves as an interior-construction company’s customer portal: users browse services, submit requests, review projects, manage profiles, and administrators manage content.

##### High-Level Architectural Components
a. Client Tier
- Web browsers requesting JSP pages and static assets (JS/CSS/images)
b. Web/Application Server
- Apache Tomcat hosting the Spring MVC application
- Spring’s DispatcherServlet (front controller)
- Spring Security filter chain for authentication/authorization
c. Presentation Layer
- Controllers (org.homey.controller.*)
- JSP view layer under WEB-INF/views, resolved by InternalResourceViewResolver
d. Service Layer
- org.homey.service.* interfaces and their Impl classes
- Business logic, transaction boundaries, calls to persistence or external services
e. Persistence Layer
- MyBatis mappers (interfaces + XML in resources/org/homey/mapper)
- Data Transfer / Value Objects (VOs in org.homey.domain)
- Oracle Database accessed via JDBC/MyBatis
f. External Services
- EmailService invoking SMTP server
- (Potential future REST or third-party integrations)

##### Architectural Patterns & Principles
- MVC pattern: clear separation of concerns
- Layered architecture: presentation / service / persistence
- Dependency Injection (Spring) for controllers, services, mappers
- Transaction management at service layer
- Security via custom handlers and UserDetailsService

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Tier
    Browser["Web Browser\n(JS/CSS/HTML)"]:::external

    %% Web/Application Server
    subgraph "Web/Application Server"
        DispatcherServlet["DispatcherServlet\n(Spring MVC Front Controller)"]:::presentation
        SecurityFilterChain["Spring Security Filter Chain"]:::presentation
    end

    %% Presentation Layer
    subgraph "Presentation Layer"  
        Controllers["Controllers\n(org.homey.controller)"]:::presentation
        Views["JSP Views\n(InternalResourceViewResolver)"]:::presentation
        StaticAssets["Static Assets\n(JS/CSS/Images)"]:::presentation
    end

    %% Service Layer
    subgraph "Service Layer"
        ServiceComponents["Service Interfaces & Impl\n(org.homey.service)"]:::service
        EmailServiceNode["EmailService\n(SMTP Integration)"]:::external
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        MapperInterfaces["Mapper Interfaces\n(org.homey.mapper)"]:::persistence
        MyBatisXML["MyBatis XML Mappers\n(resources/org/homey/mapper)"]:::persistence
        VOs["Domain VOs\n(org.homey.domain)"]:::persistence
    end

    %% Database
    OracleDB["Oracle Database"]:::db

    %% External Services
    SMTPServer["SMTP Server"]:::external

    %% Flows
    Browser -->|"HTTP Request"| DispatcherServlet
    DispatcherServlet -->|"passes through"| SecurityFilterChain
    SecurityFilterChain -->|"dispatch"| Controllers
    Controllers -->|"method calls"| ServiceComponents
    ServiceComponents -->|"mapper calls"| MapperInterfaces
    MapperInterfaces -->|"SQL"| OracleDB
    OracleDB -->|"result set"| MapperInterfaces
    MapperInterfaces -->|"returns data"| ServiceComponents
    ServiceComponents -->|"returns object"| Controllers
    Controllers -->|"resolve view"| Views
    Views -->|"render JSP"| Browser
    Controllers -->|"serve static"| StaticAssets
    ServiceComponents -->|"send email"| EmailServiceNode
    EmailServiceNode -.->|"SMTP"| SMTPServer

    %% Legend
    subgraph "Legend"
        L1["Rectangles = Components"]:::legend
        L2["Blue = Presentation"]:::legend
        L3["Green = Service"]:::legend
        L4["Orange = Persistence"]:::legend
        L5["Gray = Database"]:::legend
        L6["Purple = External"]:::legend
        L7["Solid = Intra-app"]:::legend
        L8["Dashed = External/Async"]:::legend
    end

    %% Click Events
    click DispatcherServlet "https://github.com/haazzero/finalproject_homey/blob/main/Homey 팀 공유 프로젝트/src/main/webapp/WEB-INF/spring/appServelt/servlet-context.xml"
    click SecurityFilterChain "https://github.com/haazzero/finalproject_homey/blob/main/Homey 팀 공유 프로젝트/src/main/webapp/WEB-INF/spring/security-context.xml"
    click Controllers "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/java/org/homey/controller"
    click Views "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/webapp/WEB-INF/views"
    click StaticAssets "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/webapp/resources"
    click ServiceComponents "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/java/org/homey/service"
    click MapperInterfaces "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/java/org/homey/mapper"
    click MyBatisXML "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/resources/org/homey/mapper"
    click VOs "https://github.com/haazzero/finalproject_homey/tree/main/Homey 팀 공유 프로젝트/src/main/java/org/homey/domain"
    click EmailServiceNode "https://github.com/haazzero/finalproject_homey/blob/main/Homey 팀 공유 프로젝트/src/main/java/org/homey/service/EmailService.java"

    %% Styles
    classDef presentation fill:#D0E5FF,stroke:#333,stroke-width:1px
    classDef service fill:#D0FFD0,stroke:#333,stroke-width:1px
    classDef persistence fill:#FFD8A8,stroke:#333,stroke-width:1px
    classDef db fill:#CCCCCC,stroke:#333,stroke-width:1px
    classDef external fill:#EAD1DC,stroke:#333,stroke-width:1px
    classDef legend fill:#FFFFFF,stroke:#000,stroke-dasharray:2 2,stroke-width:1px,font-style:italic, font-size:10px
```
