# jaero0725/bkc architecture

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

- Interactive diagram: https://gitdiagram.com/jaero0725/bkc
- Repository: https://github.com/jaero0725/bkc

## Overview

##### And List the Main Components
- Frontend / Client Side:
- Web resources residing in src/main/webapp – includes JSP pages, JavaScript, CSS, images, and other static assets.
- Distinct UI sections for delivery, guest, admin, subpages, and payment.
- Backend / Application Server:
- Spring Controllers: Organized by functions (admin, delivery, user, customer service, event, youtube, etc.). They handle incoming requests. Look into packages such as com.bkc.admin.*, com.bkc.delivery.*, com.bkc/user, etc.
- Service Layer: Business logic implementations (e.g., BannerService, OrderService, UserService). Ensure to denote the interfaces and concrete implementations.
- DAO Layer and MyBatis Mappers: Data access objects for different functional areas (admin boards, coupons, menus, orders, etc.). The mapper XML files (located in src/main/resources/mapper) indicate the queries and mappings with the database.
- Utility Components / Filters: e.g., TestFilter, DateUtils.
- Security Components: Spring Security configuration in WEB-INF/spring/appServlet/security-context.xml and custom security classes under com.bkc.user.security.
- Database:
- Relationship among tables (e.g., one-to-many relationships between orders and order details) as part of the overall system design.
- External Services and Integrations:
- Social Authentication (Kakao, Naver) integrations.
- Payment API integration (e.g., using I’mportA).
- SMS APIs from coolSMS.
- AWS S3 integration (seen in the AwsS3.java class).
- External front-end libraries (jQuery, bootstrap, chart libraries, chart.js, slick, etc.).
- Infrastructure/Build Tools:
- Maven (pom.xml) for dependency management.
- Git-Flow is used for branch management, indicating CI/CD and release management processes.

##### Architectural Patterns and Design Principles
- MVC Pattern: Clearly differentiate between Controllers (handling HTTP requests/responses), the Service layer (business logic), and the DAO/Repository layer (data access).
- Separation of Concerns: Indicate that each module (admin, delivery, customer service, etc.) is responsible for different business domains.
- Layered Architecture: Emphasize the clear stack from web resources to controllers, services, DAOs, and down to the database.
- Use of patterns like Dependency Injection (through Spring) and clear data mapping via MyBatis.
- Cohesive naming conventions, as many directories follow a “controller, dao, service, vo” structure.

##### Incorporate Technologies and Frameworks
- Use of Spring MVC (and Spring Security) handling web requests.
- Maven for build automation and dependency management.
- MyBatis for database mapping.
- JSP (within WEB-INF/views) for the view layer.
- Java utilities and filters that add cross-cutting features.
- External integrations like AWS S3, Kakao and Naver APIs, coolSMS, and third-party libraries used for charting and UI components.

##### Final Checklist
- Every major component is clearly labeled.
- Annotations for important patterns (MVC, layered architecture, integration points, and Git-Flow branch management).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend"
        FE_C("Customer/Delivery/Guest UI"):::frontend
        FE_A("Admin UI"):::frontend
    end

    %% Controllers Layer
    subgraph "Controllers"
        G("General Controllers"):::controllers
        A("Admin Controllers"):::controllers
        C("Customer/Delivery Controllers"):::controllers
        U("User Controllers"):::controllers
    end

    %% Service Layer
    subgraph "Service Layer"
        S1("Admin Service"):::service
        S2("Customer Service"):::service
        S3("User Service"):::service
        S4("Event Service"):::service
        S5("Subpages Service"):::service
    end

    %% DAO and Database Layers
    DAO("DAO & MyBatis Mappers"):::dao
    DB("Database"):::database

    %% Utility Components
    subgraph "Utilities/Filters"
        UT1("DateUtils"):::utility
        UT2("TestFilter"):::utility
    end

    %% Security Components
    subgraph "Security"
        Sec1("Spring Security Config"):::security
        Sec2("Custom Security"):::security
    end

    %% External Services & Integrations
    subgraph "External Services"
        Ext1("AWS S3"):::external
        Ext2("Kakao Auth"):::external
        Ext3("Naver Auth"):::external
        Ext4("SMS APIs"):::external
    end

    %% Development Workflow (Git-Flow)
    subgraph "Development Workflow"
        Dev1("Master"):::development
        Dev2("Develop"):::development
        Dev3("Feature"):::development
        Dev4("Release"):::development
        Dev5("Hotfix"):::development
    end

    %% Connections from Frontend to Controllers
    FE_C --> G
    FE_C --> C
    FE_C --> U
    FE_A --> A

    %% Controllers to Service Layer
    G --> S5
    A --> S1
    C --> S2
    C --> S4
    U --> S3

    %% Service Layer to DAO and Database
    S1 --> DAO
    S2 --> DAO
    S3 --> DAO
    S4 --> DAO
    S5 --> DAO
    DAO --> DB

    %% Controllers integrating with Security Components
    G --- Sec1
    A --- Sec1
    C --- Sec1
    U --- Sec1
    G --- Sec2
    A --- Sec2
    C --- Sec2
    U --- Sec2

    %% Service Layer utilizes Utility Components (dotted connections)
    S1 -.-> UT1
    S2 -.-> UT1
    S3 -.-> UT1
    S4 -.-> UT1
    S5 -.-> UT1
    S1 -.-> UT2
    S2 -.-> UT2
    S3 -.-> UT2
    S4 -.-> UT2
    S5 -.-> UT2

    %% External Services integrations from Service Layer
    S1 --> Ext1
    S3 --> Ext2
    S3 --> Ext3
    S2 --> Ext4

    %% Development Workflow sequence
    Dev1 --> Dev2
    Dev2 --> Dev3
    Dev3 --> Dev4
    Dev4 --> Dev5

    %% Click Events
    click FE_C "https://github.com/jaero0725/bkc/tree/master/src/main/webapp"
    click FE_A "https://github.com/jaero0725/bkc/tree/master/src/main/webapp"
    click G "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/main/controller"
    click A "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/admin/controller"
    click C "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/delivery/controller"
    click U "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/user/controller"
    click S1 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/admin/pdf/service"
    click S2 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/delivery/service"
    click S3 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/user/service"
    click S4 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/event/service"
    click S5 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/subpages/brand/bkcstory/service"
    click DAO "https://github.com/jaero0725/bkc/tree/master/src/main/resources/mapper"
    click UT1 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/utils/DateUtils.java"
    click UT2 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/filter/TestFilter.java"
    click Sec1 "https://github.com/jaero0725/bkc/blob/master/src/main/webapp/WEB-INF/spring/appServlet/security-context.xml"
    click Sec2 "https://github.com/jaero0725/bkc/tree/master/src/main/java/com/bkc/user/security"
    click Ext1 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/admin/aws/AwsS3.java"
    click Ext2 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/user/kakao/KakaoLoginApi.java"
    click Ext3 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/user/naver/NaverLoginAPI.java"
    click Ext4 "https://github.com/jaero0725/bkc/blob/master/src/main/java/com/bkc/user/sms/Coolsms.java"

    %% Styles
    classDef frontend fill:#C1E1C1,stroke:#333,stroke-width:2px;
    classDef controllers fill:#F9D5E5,stroke:#333,stroke-width:2px;
    classDef service fill:#F9E79F,stroke:#333,stroke-width:2px;
    classDef dao fill:#AED6F1,stroke:#333,stroke-width:2px;
    classDef database fill:#D5F5E3,stroke:#333,stroke-width:2px,stroke-dasharray:5,5;
    classDef utility fill:#D2B4DE,stroke:#333,stroke-width:2px;
    classDef security fill:#A9DFBF,stroke:#333,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#333,stroke-width:2px;
    classDef development fill:#F5B7B1,stroke:#333,stroke-width:2px;
```
