How four-uncles/saramara-community-server works
Project type and purpose
• This is a Spring-Boot backend monolith (“사라마라 서버”) providing REST APIs for a community platform where users can post “boards,” comment, vote, and upload files.
• Key domain modules: board (게시글), comment (댓글), vote (투표), member (회원), bucket (파일 업로드).
File structure
• Standard Gradle/Spring-Boot layout under src/main/java/com/kakao/saramaracommunity.
• Top-level packages:
• board/… (controller, service, repository, entity, exception, DTOs)
• comment/…
• vote/…
• member/…
• bucket/… implements hexagonal pattern (controller-port, service-port, infrastructure adapters: AwsS3Uploader, MinioUploader)
• common/… (shared DTOs, base entities, global exception handler, ApiResponse, TokenDto)
• config/… (Spring beans: AWS/Minio configs, JPA, security, CORS, Swagger)
• filter/, handler/ (Spring‐Security filters & auth handlers)
• util/ (file validators)
• Infrastructure/config files: application.yml, Dockerfile, docker-compose.yml, build.gradle.
README for additional insights
• Confirms purpose: a backend service for “사라마라” community sharing purchase decisions.
a. Main components
• Clients (Web/Mobile)
• HTTP/API Layer: Spring-Security filters → Controllers
• Business Layer: Service interfaces & implementations
• Persistence Layer: JPA Repositories → Relational Database (e.g., PostgreSQL/MySQL)
• Object Storage: AWS S3 or Minio (selectable via config)
• Cross-cutting: GlobalExceptionHandler, DTO converters, Swagger-UI
b. Relationships & interactions
• Client → Load Balancer (if any) → API endpoint
• API calls flow through CorsConfig → SecurityConfig → custom filters → controllers
• Controller receives RequestDTO → invokes Service
• Service implements business logic, may call:
• Repositories for CRUD on Board, Comment, Vote, Member
• BucketService → ObjectStorageClient → S3/Minio
• Service returns ServiceResponse DTO → Controller maps to ResponseDTO → ApiResponse → JSON to client
• GlobalExceptionHandler captures and wraps errors into consistent error responses
c. Architectural patterns & design principles
• Layered architecture (Controller → Service → Repository)
• Hexagonal/Ports & Adapters for bucket (abstract ObjectStorageClient, two adapter implementations)
• DTO segregation by layer (API vs. business)
• Configuration via Spring beans, profiles to switch between AWS S3 & Minio
• Filters for authentication (session or JWT), custom success handler
• Usage of Swagger for API documentation
d. Technologies, frameworks & libraries
• Java + Spring-Boot + Spring-Data-JPA + Hibernate
• Object storage: AWS SDK S3, Minio
• Security: Spring-Security, custom filters
• Build: Gradle
• Containerization: Docker & docker-compose
• API docs: Springfox/Swagger
• Testing: JUnit, Mockito, integration tests (with fake & real S3/Minio), architecture tests
Details to capture
• GlobalExceptionHandler intercepting errors across controllers.
• Config components (e.g., JwtFilter, CorsConfig) upstream of controllers.
• Build & deploy artifacts (Docker image, docker-compose orchestrating DB + service).