How ssavice/be works
1. Overall shape
This is a single Spring Boot backend application (SsaviceApplication) organized as a modular monolith. The code is split by business domain rather than by technical layer, and most domains follow the same internal structure: HTTP controller → application service → repository/entity → external adapter if needed.
2. Core domain modules
The main business modules are user, account, auth, company, book, serviceItem, review, wish, payment, imageResource, chatmember, address, region, and refund. Each module owns its own entities, request/response DTOs, service classes, and persistence repositories, which makes the domain boundaries fairly explicit for diagramming.
3. Typical request flow
Most synchronous flows start in a controller, map into a command/model DTO, and then pass through a read/write service split. Many modules expose separate ReadService, WriteService, and facade-style Service classes, indicating a deliberate separation between query logic and mutation logic.
4. Persistence boundary
The application uses JPA/Hibernate for persistence, with repositories under each module’s infrastructure/repository. There is a shared BaseEntity, shared SQL schema/data bootstrap files, and some custom repository implementations where query complexity requires it, such as book and serviceItem. The global/config/JpaConfig and QueryDSLConfig suggest a mix of standard JPA and QueryDSL-based querying.
5. Authentication and authorization
Auth is centralized in the auth package and reinforced by global infrastructure. The app has a JWT filter, authentication and authorization interceptors, custom argument resolvers for injecting the current auth/refresh token, and custom annotations such as @PermitAll, @RequireRole, and @CurrentAuth. This means security is enforced both at the HTTP filter layer and inside controller method handling.
6. User/account/company onboarding
user, account, and company form the identity and seller/business onboarding area. company is more complex than a simple CRUD module: it includes business verification flow, a signup verification token, and an adapter/client for an external business-number validation service. account appears to manage provider-linked accounts, while user holds the core application user profile.
7. External service integrations
Several domains delegate to external platforms through adapter/client packages:
• oauth integrates with Kakao for social login.
• company integrates with an NTS-based verification API.
• payment integrates with Toss for payment confirm/cancel.
• serviceItem integrates with OpenSearch for search.
• s3 abstracts AWS S3 for image/object storage.
These adapters are isolated behind client/service interfaces, which keeps vendor-specific DTOs out of the core domains.
8. Eventing and async processing
The architecture includes multiple asynchronous/event-driven paths. Kafka is present via KafkaProducer, event handlers, and config. There is also an outbox pattern: domain events are stored as OutboxEvent, processed by an OutboxScheduler, and then published outward. SQS is used for thumbnail-related messaging, with event DTOs and a consumer/listener pipeline. This suggests the system uses async messaging for side effects, retries, and decoupling.
9. Media and image pipeline
imageResource and s3 together implement the file/media pipeline. Image metadata is stored in the database, while the binary object is handled through S3. S3 events and object-key generation are separated from image domain logic, and there are explicit validation/error cases for content type and size. This is likely a two-step flow: metadata lifecycle in DB, object lifecycle in storage.
10. Commerce-like transaction flows
payment, refund, wish, review, and book indicate the product supports transactional marketplace behavior. Payments are confirmed/canceled through Toss, refunds are represented explicitly, and reviews/wishes are separate user-generated domain modules. book and serviceItem likely represent inventory/listing-style objects, with search/filtering support on serviceItem.
11. Shared infrastructure and cross-cutting concerns
The global package contains shared exception handling, properties, constants, DTOs, utilities, and infrastructure config. It also includes OpenSearch, Kafka, S3, ShedLock, Swagger, and web MVC configuration. That indicates the repo is not just a domain model but a production-oriented backend with scheduled jobs, API docs, distributed locks, and standardized error handling.
12. Runtime/deployment and verification
The repository is built with Gradle and packaged for Docker; it also includes GitHub Actions workflows for CI and deployment, plus docker-compose.yml for local orchestration. Test coverage is broad across domain services, repositories, integration flows, and infrastructure adapters, which suggests the system’s architecture is intended to be validated at multiple boundaries rather than only through unit tests.
Main entry points: SsaviceApplication.java Ssavice app · serviceItem Service items · company Company · outbox Outbox
Components 24
Application
Spring Boot entrypoint and core runtime
- Ssavice app · Main Spring Boot application bootstrap
src/main/java/teamssavice/ssavice/SsaviceApplication.java
Core domains
Primary business modules and their service/repository boundaries
- Users · User profile management with controller, service split, and JPA repository
src/main/java/teamssavice/ssavice/user - Accounts · Provider-linked account records and account services
src/main/java/teamssavice/ssavice/account - Company · Business onboarding, verification flow, signup token, and persistence
src/main/java/teamssavice/ssavice/company - Books · Book listing module with custom repository queries
src/main/java/teamssavice/ssavice/book - Service items · Service listing module with OpenSearch-backed search and custom queries
src/main/java/teamssavice/ssavice/serviceItem - Payments · Payment confirmation, cancellation, and persistence around Toss integration
src/main/java/teamssavice/ssavice/payment - Refunds · Refund information and refund service handling
src/main/java/teamssavice/ssavice/refund - Reviews · Review creation and retrieval module
src/main/java/teamssavice/ssavice/review - Wishes · Wish list and bookmarking module
src/main/java/teamssavice/ssavice/wish - Images · Image resource lifecycle and metadata persistence
src/main/java/teamssavice/ssavice/imageresource - Chat members · Chat room membership persistence and service layer
src/main/java/teamssavice/ssavice/chatmember - Regions · Regional reference data and read service
src/main/java/teamssavice/ssavice/region
Integrations
External vendors and adapters
- Kakao OAuth · Kakao login adapter and API client
src/main/java/teamssavice/ssavice/oauth/infrastructure/kakao - NTS verify · Business-number verification adapter and client
src/main/java/teamssavice/ssavice/company/infrastructure/nts - Toss payments · Toss confirm/cancel adapter and Feign client
src/main/java/teamssavice/ssavice/payment/infrastructure/toss - OpenSearch · OpenSearch client and search document mapping for service items
src/main/java/teamssavice/ssavice/serviceItem/infrastructure/opensearch - S3 storage · S3 service, key generation, and object/event handling
src/main/java/teamssavice/ssavice/s3
Platform
Cross-cutting infrastructure and shared concerns
- Web core · Filters, interceptors, resolvers, annotations, MVC config, and exception handling
src/main/java/teamssavice/ssavice/global - Data config · JPA, QueryDSL, and storage-related configuration plus base entity support
src/main/java/teamssavice/ssavice/global/config - Auth · JWT token issuance, refresh tokens, and authentication responses
src/main/java/teamssavice/ssavice/auth
Async flows
Eventing, outbox, and background processing
- Kafka · Kafka producer, event model, and handler layer
src/main/java/teamssavice/ssavice/kafka - Outbox · Outbox event persistence, scheduler, and publisher bridge
src/main/java/teamssavice/ssavice/outbox - Thumbnail SQS · Thumbnail event listener and SQS consumer pipeline
src/main/java/teamssavice/ssavice/sqs
Connections 26
- Ssavice app → Web core: bootstraps · Registers shared web/security infrastructure
- Ssavice app → Data config: bootstraps · Enables persistence and query configuration
- Ssavice app → Users: loads · Starts user domain components
- Ssavice app → Company: loads · Starts company onboarding components
- Ssavice app → Service items: loads · Starts listing/search components
- Users → Auth: uses · User-facing requests rely on token auth
- Accounts → Auth: uses · Provider-linked account flows depend on tokens
- Company → NTS verify: verifies · Delegates business-number validation externally
- Auth → Kakao OAuth: social login · Supports Kakao OAuth sign-in
- Service items → OpenSearch: indexes/searches · Uses OpenSearch for search and filtering
- Payments → Toss payments: confirms/cancels · Delegates payment gateway operations
- Images → S3 storage: stores objects · Persists image binaries in object storage
- Service items → Images: attaches media · Service listings can reference image resources
- Reviews → Users: references · Reviews are authored by users
- Wishes → Users: references · Wish records belong to users
- Books → Company: references · Book listings relate to sellers/companies
- Books → Regions: filters by · Regional lookup supports book querying
- Service items → Regions: filters by · Regional lookup supports service item discovery
- Web core → Kafka: hooks · HTTP layer cooperates with async eventing
- Company → Outbox: publishes · Stores domain events for reliable relay
- Payments → Outbox: publishes · Payment changes may be relayed through outbox
- Outbox → Kafka: dispatches · Relays persisted events to Kafka
- Outbox → Thumbnail SQS: dispatches · Can forward events into thumbnail processing
- Thumbnail SQS → S3 storage: consumes · Thumbnail pipeline interacts with stored objects
- Data config → Books: supports · Shared JPA/QueryDSL configuration backs repositories
- Data config → Service items: supports · Shared JPA/QueryDSL configuration backs repositories