# human-final/found-spring architecture

> Architecture diagram of the GitHub repository human-final/found-spring, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/human-final/found-spring
- Repository: https://github.com/human-final/found-spring

## Overview

#### Purpose and Runtime
A Gradle-based Spring Boot server-side Lost & Found platform. It combines user-created lost/found posts with police/public-portal data, supports natural-language LLM search, and renders HTML views. Application bootstrap: `src/main/java/com/human/found/FoundApplication.java`; views live under `src/main/resources/templates`.

#### Web Entry and Cross-Cutting Boundaries
HTTP requests enter domain controllers, which return rendered pages or API-oriented responses, then delegate to services and MyBatis mappers. Shared MVC, security, WebSocket, and exception/message handling define the application boundary:
- `src/main/java/com/human/found/global/config/SecurityConfig.java`
- `src/main/java/com/human/found/global/config/WebSocketConfig.java`
- `src/main/java/com/human/found/global/common/advice/GlobalExceptionHandler.java`

#### Core Lost/Found Board Domain
The primary content model is separate lost and found boards, each with controller → service → mapper layering and associated attachment persistence. Board list/detail/write pages are server-rendered.
- `src/main/java/com/human/found/domain/found/controller/FoundController.java`
- `src/main/java/com/human/found/domain/found/service/FoundServiceImpl.java`
- `src/main/java/com/human/found/domain/lost/service/LostServiceImpl.java`

Comments are independently managed per board type but attach to lost/found posts:
- `src/main/java/com/human/found/domain/comment/service/FoundCommentServiceImpl.java`
- `src/main/java/com/human/found/domain/comment/service/LostCommentServiceImpl.java`

#### Persistence and Content Data Flow
Services use mapper interfaces backed by MyBatis XML SQL mappings; VOs carry board, user, file, chat, and result data. This is the main persistence boundary rather than an ORM entity model.
- `src/main/java/com/human/found/domain/found/mapper/FoundMapper.java`
- `src/main/resources/mapper/found/FoundMapper.xml`
- `src/main/resources/mapper/search/SearchMapper.xml`

Attachment operations are split into board-specific file mappers, with common file handling in `src/main/java/com/human/found/infrastructure/file/FileUtil.java`.

#### Search, Maps, and External Data Ingestion
Search accepts structured conditions and has both standard and LLM-oriented service paths, likely querying the unified local search data through mapper SQL.
- `src/main/java/com/human/found/domain/search/controller/SearchController.java`
- `src/main/java/com/human/found/domain/search/service/LlmSearchService.java`
- `src/main/java/com/human/found/domain/search/service/SearchServiceImpl.java`

Police API adapters ingest/search found and lost data; portal found data has a scheduler and transactional service, marking a boundary between remote API payloads and local persistence.
- `src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/service/FoundPortalServiceImpl.java`
- `src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/scheduler/FoundPortalScheduler.java`
- `src/main/java/com/human/found/infrastructure/policeAPI/lostAPI/service/LostPoliceServiceImpl.java`

Kakao Map integration is encapsulated in `src/main/java/com/human/found/infrastructure/map/MapService.java`.

#### Identity, User Lifecycle, and Administration
Spring Security authentication is backed by custom user lookup and login-success processing. User services handle registration, account recovery/profile behavior, and a scheduled dormant-account lifecycle.
- `src/main/java/com/human/found/domain/auth/service/CustomUserDetailsService.java`
- `src/main/java/com/human/found/domain/user/service/UserServiceImpl.java`
- `src/main/java/com/human/found/domain/user/scheduler/DormantScheduler.java`

Administrative controllers/services provide user and board moderation paths:
- `src/main/java/com/human/found/domain/admin/controller/UserManageController.java`
- `src/main/java/com/human/found/domain/admin/service/BoardManageServiceImpl.java`

#### Real-Time Chat and Notices
Chat has conventional page endpoints plus a socket controller, with rooms, messages, and files persisted through its mapper/service layer.
- `src/main/java/com/human/found/domain/chat/controller/ChatSocketController.java`
- `src/main/java/com/human/found/domain/chat/service/ChatServiceImpl.java`
- `src/main/resources/mapper/chat/ChatMapper.xml`

Notices form a separate managed content stream with files:
- `src/main/java/com/human/found/domain/notice/controller/NoticeController.java`
- `src/main/java/com/human/found/domain/notice/service/NoticeServiceImpl.java`

Main entry points: [`src/main/java/com/human/found/domain/found/mapper/FoundMapper.java`](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/mapper/FoundMapper.java) (MyBatis Persistence), [`src/main/java/com/human/found/domain/search/controller/SearchController.java`](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/search/controller/SearchController.java) (Search), [`src/main/java/com/human/found/domain/user/service/UserServiceImpl.java`](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/user/service/UserServiceImpl.java) (User Lifecycle), [`src/main/java/com/human/found/FoundApplication.java`](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/FoundApplication.java) (Spring Boot App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Boundary"]
  node_app{{"Spring Boot App<br/>bootstrap"}}
  node_mvc["MVC Views<br/>templates"]
  node_security["Security Config"]
  node_websocket["WebSocket Config"]
  node_exceptions["Exception Handler<br/>advice"]
end

subgraph group_content["Content Domains"]
  node_found_board["Found Board<br/>controller-service"]
  node_found_service["Found Service"]
  node_lost_board["Lost Board"]
  node_comments["Board Comments<br/>services"]
  node_notice["Notices<br/>controller-service"]
  node_notice_service["Notice Service"]
end

subgraph group_integration["Search &amp; Integrations"]
  node_search["Search<br/>controller-service"]
  node_llm_search["LLM Search"]
  node_map["Kakao Maps<br/>map-service<br/>[MapService.java]"]
  node_portal_job["Found Portal Ingestion<br/>scheduler-service"]
  node_police_lost["Police Lost API<br/>adapter-service"]
  node_mybatis[("MyBatis Persistence<br/>mapper-sql<br/>[FoundMapper.java]")]
  node_database[("Local Data Store<br/>database")]
  node_files["File Handling<br/>file-util<br/>[FileUtil.java]"]
end

subgraph group_platform["Identity &amp; Platform"]
  node_admin["Administration<br/>controller-service"]
  node_users["User Lifecycle"]
  node_user_auth["User Authentication<br/>user-details"]
  node_dormant_job["Dormant Account Job<br/>scheduler"]
  node_chat_socket["Chat Socket<br/>socket-controller"]
  node_chat_service["Chat Service"]
end

node_app -->|"configures"| node_security
node_app -->|"configures"| node_websocket
node_app -->|"handles errors with"| node_exceptions
node_found_board -->|"delegates to"| node_found_service
node_found_service -->|"uses"| node_mybatis
node_lost_board -->|"uses"| node_mybatis
node_comments -->|"persists via"| node_mybatis
node_notice -->|"delegates to"| node_notice_service
node_notice_service -->|"uses"| node_mybatis
node_found_board -->|"attachments"| node_files
node_notice_service -->|"attachments"| node_files
node_security -->|"authenticates through"| node_user_auth
node_user_auth -->|"loads users"| node_users
node_users -->|"uses"| node_mybatis
node_dormant_job -->|"updates accounts"| node_users
node_admin -->|"moderates users"| node_users
node_admin -->|"moderates boards via"| node_mybatis
node_websocket -->|"enables"| node_chat_socket
node_chat_socket -->|"routes messages to"| node_chat_service
node_chat_service -->|"persists via"| node_mybatis
node_search -->|"LLM path"| node_llm_search
node_search -->|"standard queries"| node_mybatis
node_llm_search -->|"queries local data"| node_mybatis
node_search -->|"map integration"| node_map
node_portal_job -->|"ingests into"| node_mybatis
node_police_lost -->|"syncs/searches"| node_mybatis
node_mybatis -->|"SQL mappings"| node_database
node_found_board -->|"renders"| node_mvc
node_search -->|"renders results"| node_mvc

click node_app "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/FoundApplication.java"
click node_mvc "https://github.com/human-final/found-spring/tree/main/src/main/resources/templates"
click node_security "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/config/SecurityConfig.java"
click node_websocket "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/config/WebSocketConfig.java"
click node_exceptions "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/common/advice/GlobalExceptionHandler.java"
click node_found_board "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/controller/FoundController.java"
click node_found_service "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/service/FoundServiceImpl.java"
click node_lost_board "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/lost/service/LostServiceImpl.java"
click node_comments "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/comment/service/FoundCommentServiceImpl.java"
click node_notice "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/notice/controller/NoticeController.java"
click node_notice_service "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/notice/service/NoticeServiceImpl.java"
click node_admin "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/admin/controller/UserManageController.java"
click node_users "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/user/service/UserServiceImpl.java"
click node_user_auth "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/auth/service/CustomUserDetailsService.java"
click node_dormant_job "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/user/scheduler/DormantScheduler.java"
click node_chat_socket "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/chat/controller/ChatSocketController.java"
click node_chat_service "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/chat/service/ChatServiceImpl.java"
click node_search "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/search/controller/SearchController.java"
click node_llm_search "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/search/service/LlmSearchService.java"
click node_map "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/map/MapService.java"
click node_portal_job "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/scheduler/FoundPortalScheduler.java"
click node_police_lost "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/policeAPI/lostAPI/service/LostPoliceServiceImpl.java"
click node_mybatis "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/mapper/FoundMapper.java"
click node_files "https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/file/FileUtil.java"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_mvc,node_security,node_websocket,node_exceptions toneBlue
class node_found_board,node_found_service,node_lost_board,node_comments,node_notice,node_notice_service toneAmber
class node_search,node_llm_search,node_map,node_portal_job,node_police_lost,node_mybatis,node_database,node_files toneMint
class node_admin,node_users,node_user_auth,node_dormant_job,node_chat_socket,node_chat_service toneRose
```

## Components

### Web Boundary

- [Spring Boot App](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/FoundApplication.java): bootstrap · `src/main/java/com/human/found/FoundApplication.java`
- [MVC Views](https://github.com/human-final/found-spring/tree/main/src/main/resources/templates): templates · Server-rendered HTML pages. · `src/main/resources/templates`
- [Security Config](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/config/SecurityConfig.java): security · `src/main/java/com/human/found/global/config/SecurityConfig.java`
- [WebSocket Config](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/config/WebSocketConfig.java): websocket · `src/main/java/com/human/found/global/config/WebSocketConfig.java`
- [Exception Handler](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/global/common/advice/GlobalExceptionHandler.java): advice · `src/main/java/com/human/found/global/common/advice/GlobalExceptionHandler.java`

### Content Domains

- [Found Board](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/controller/FoundController.java): controller-service · Found-post pages and attachment workflows. · `src/main/java/com/human/found/domain/found/controller/FoundController.java`
- [Found Service](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/service/FoundServiceImpl.java): service · `src/main/java/com/human/found/domain/found/service/FoundServiceImpl.java`
- [Lost Board](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/lost/service/LostServiceImpl.java): service · Lost-post domain workflow. · `src/main/java/com/human/found/domain/lost/service/LostServiceImpl.java`
- [Board Comments](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/comment/service/FoundCommentServiceImpl.java): services · Separate comment services attach to found and lost posts. · `src/main/java/com/human/found/domain/comment/service/FoundCommentServiceImpl.java`
- [Notices](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/notice/controller/NoticeController.java): controller-service · Managed notice stream with files. · `src/main/java/com/human/found/domain/notice/controller/NoticeController.java`
- [Notice Service](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/notice/service/NoticeServiceImpl.java): service · `src/main/java/com/human/found/domain/notice/service/NoticeServiceImpl.java`

### Search & Integrations

- [Search](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/search/controller/SearchController.java): controller-service · Structured and LLM-oriented search paths. · `src/main/java/com/human/found/domain/search/controller/SearchController.java`
- [LLM Search](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/search/service/LlmSearchService.java): service · `src/main/java/com/human/found/domain/search/service/LlmSearchService.java`
- [Kakao Maps](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/map/MapService.java): map-service · `src/main/java/com/human/found/infrastructure/map/MapService.java`
- [Found Portal Ingestion](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/scheduler/FoundPortalScheduler.java): scheduler-service · Scheduled remote portal ingestion into local data. · `src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/scheduler/FoundPortalScheduler.java`
- [Police Lost API](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/policeAPI/lostAPI/service/LostPoliceServiceImpl.java): adapter-service · `src/main/java/com/human/found/infrastructure/policeAPI/lostAPI/service/LostPoliceServiceImpl.java`
- [MyBatis Persistence](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/found/mapper/FoundMapper.java): mapper-sql · Mapper interfaces and XML SQL form the persistence boundary. · `src/main/java/com/human/found/domain/found/mapper/FoundMapper.java`
- **Local Data Store**: database · Stores board, user, file, chat, and search data.
- [File Handling](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/infrastructure/file/FileUtil.java): file-util · Common attachment handling for board-specific file mappers. · `src/main/java/com/human/found/infrastructure/file/FileUtil.java`

### Identity & Platform

- [Administration](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/admin/controller/UserManageController.java): controller-service · User and board moderation. · `src/main/java/com/human/found/domain/admin/controller/UserManageController.java`
- [User Lifecycle](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/user/service/UserServiceImpl.java): service · Registration, recovery, profiles, and dormant accounts. · `src/main/java/com/human/found/domain/user/service/UserServiceImpl.java`
- [User Authentication](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/auth/service/CustomUserDetailsService.java): user-details · `src/main/java/com/human/found/domain/auth/service/CustomUserDetailsService.java`
- [Dormant Account Job](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/user/scheduler/DormantScheduler.java): scheduler · `src/main/java/com/human/found/domain/user/scheduler/DormantScheduler.java`
- [Chat Socket](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/chat/controller/ChatSocketController.java): socket-controller · Real-time chat endpoint. · `src/main/java/com/human/found/domain/chat/controller/ChatSocketController.java`
- [Chat Service](https://github.com/human-final/found-spring/blob/main/src/main/java/com/human/found/domain/chat/service/ChatServiceImpl.java): service · Rooms, messages, and chat files. · `src/main/java/com/human/found/domain/chat/service/ChatServiceImpl.java`

## Connections

- Spring Boot App → Security Config: configures
- Spring Boot App → WebSocket Config: configures
- Spring Boot App → Exception Handler: handles errors with
- Found Board → Found Service: delegates to
- Found Service → MyBatis Persistence: uses
- Lost Board → MyBatis Persistence: uses
- Board Comments → MyBatis Persistence: persists via
- Notices → Notice Service: delegates to
- Notice Service → MyBatis Persistence: uses
- Found Board → File Handling: attachments
- Notice Service → File Handling: attachments
- Security Config → User Authentication: authenticates through
- User Authentication → User Lifecycle: loads users
- User Lifecycle → MyBatis Persistence: uses
- Dormant Account Job → User Lifecycle: updates accounts
- Administration → User Lifecycle: moderates users
- Administration → MyBatis Persistence: moderates boards via
- WebSocket Config → Chat Socket: enables
- Chat Socket → Chat Service: routes messages to
- Chat Service → MyBatis Persistence: persists via
- Search → LLM Search: LLM path
- Search → MyBatis Persistence: standard queries
- LLM Search → MyBatis Persistence: queries local data
- Search → Kakao Maps: map integration
- Found Portal Ingestion → MyBatis Persistence: ingests into
- Police Lost API → MyBatis Persistence: syncs/searches
- MyBatis Persistence → Local Data Store: SQL mappings
- Found Board → MVC Views: renders
- Search → MVC Views: renders results
