How hunmin-dev/hunmin-backend works
Project Type and Purpose
• This is a Kotlin-based, multi-module backend server following a hexagonal (ports-and-adapters) architecture.
• It provides RESTful APIs (hunmin-api), business logic (hunmin-application), domain modeling (hunmin-domain), persistence (hunmin-persistence), external adapters (hunmin-adapter), shared utilities (hunmin-common), and a scheduled batch job (hunmin-batch).
Main Architectural Layers & Modules
a. API Layer (hunmin-api)
• Components: REST controllers (AuthController, CategoryController, TodayIssueController), DTOs, request/response models, global exception handlers, Swagger config.
• Entry point for HTTP clients.
b. Application Layer (hunmin-application)
• Components: AuthService, CategoryService, TodayIssueService, DomainEventInterceptor.
• Implements use cases defined in the domain ports (hunmin-domain). Coordinates transactions, security, events.
c. Domain Layer (hunmin-domain)
• Components: Domain entities (Auth, Category, TodayIssue), domain events, port interfaces (inbound/outbound), commands, value objects.
• Pure business logic and rules. No framework dependencies.
d. Persistence Layer (hunmin-persistence)
• Components: JPA entities, Spring Data repositories, mappers, config (persistence, auditing, QueryDSL).
• Implements the outbound ports (RepositoryPort) defined in the domain.
e. Adapter Layer (hunmin-adapter)
• Components: Adapters for auth encryption (Jasypt), adapter implementations of domain ports (AuthRepositoryAdapter, CategoryRepositoryAdapter, TodayIssueRepositoryAdapter).
• Bridges domain ports to persistence or external services.
f. Common Library (hunmin-common)
• Components: Cross-cutting concerns—authentication interceptors, JWT token provider, exception and logging utilities, global config.
g. Batch Module (hunmin-batch)
• Components: Scheduled Spring Batch job (TodayIssuesJobConfiguration), batch config classes.
• Periodically triggers domain/application services to generate today’s issues.
Diagramming Conventions
• Labels: Clearly name each module/component.
• API / Controllers – blue rectangles
• Application Services – green rectangles
• Domain & Ports – yellow rectangles
• Adapters – orange rectangles
• Batch – purple rectangle
• Common utilities – separate small grey rectangle