How human-final/found-spring works
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: FoundMapper.java MyBatis Persistence · SearchController.java Search · UserServiceImpl.java User Lifecycle · FoundApplication.java Spring Boot App
Components 25
Web Boundary
- Spring Boot App
src/main/java/com/human/found/FoundApplication.java - MVC Views · Server-rendered HTML pages.
src/main/resources/templates - Security Config
src/main/java/com/human/found/global/config/SecurityConfig.java - WebSocket Config
src/main/java/com/human/found/global/config/WebSocketConfig.java - Exception Handler
src/main/java/com/human/found/global/common/advice/GlobalExceptionHandler.java
Content Domains
- Found Board · Found-post pages and attachment workflows.
src/main/java/com/human/found/domain/found/controller/FoundController.java - Found Service
src/main/java/com/human/found/domain/found/service/FoundServiceImpl.java - Lost Board · Lost-post domain workflow.
src/main/java/com/human/found/domain/lost/service/LostServiceImpl.java - Board Comments · Separate comment services attach to found and lost posts.
src/main/java/com/human/found/domain/comment/service/FoundCommentServiceImpl.java - Notices · Managed notice stream with files.
src/main/java/com/human/found/domain/notice/controller/NoticeController.java - Notice Service
src/main/java/com/human/found/domain/notice/service/NoticeServiceImpl.java
Search & Integrations
- Search · Structured and LLM-oriented search paths.
src/main/java/com/human/found/domain/search/controller/SearchController.java - LLM Search
src/main/java/com/human/found/domain/search/service/LlmSearchService.java - Kakao Maps
src/main/java/com/human/found/infrastructure/map/MapService.java - Found Portal Ingestion · Scheduled remote portal ingestion into local data.
src/main/java/com/human/found/infrastructure/policeAPI/foundAPI/scheduler/FoundPortalScheduler.java - Police Lost API
src/main/java/com/human/found/infrastructure/policeAPI/lostAPI/service/LostPoliceServiceImpl.java - MyBatis Persistence · Mapper interfaces and XML SQL form the persistence boundary.
src/main/java/com/human/found/domain/found/mapper/FoundMapper.java - Local Data Store · Stores board, user, file, chat, and search data.
- File Handling · Common attachment handling for board-specific file mappers.
src/main/java/com/human/found/infrastructure/file/FileUtil.java
Identity & Platform
- Administration · User and board moderation.
src/main/java/com/human/found/domain/admin/controller/UserManageController.java - User Lifecycle · Registration, recovery, profiles, and dormant accounts.
src/main/java/com/human/found/domain/user/service/UserServiceImpl.java - User Authentication
src/main/java/com/human/found/domain/auth/service/CustomUserDetailsService.java - Dormant Account Job
src/main/java/com/human/found/domain/user/scheduler/DormantScheduler.java - Chat Socket · Real-time chat endpoint.
src/main/java/com/human/found/domain/chat/controller/ChatSocketController.java - Chat Service · Rooms, messages, and chat files.
src/main/java/com/human/found/domain/chat/service/ChatServiceImpl.java
Connections 29
- 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