How sopt-all/36-sopkathon-server-web2 works
Project Type and Purpose
• This is a Spring Boot–based backend service (monolithic REST API) for the “솝커톤 웹2팀” application.
• It exposes endpoints for managing “pins” (geolocated markers), users, votes, and image uploads, persisting data in a relational database and storing images in AWS S3.
File-Structure Analysis
• Top-level build and config:
• Dockerfile, Gradle wrapper, build.gradle, settings.gradle → containerization & build.
• .github/workflows/main.yml → CI pipeline.
• Source code under src/main/java/com/sopkathon/teamweb:
• domain/*/controller → REST controllers.
• domain/*/service → business logic.
• domain/*/repository → Spring Data JPA repositories.
• domain/*/domain → JPA entities and constants.
• domain/*/dto → request/response DTOs.
• global/config → CORS, JPA auditing, S3, Swagger.
• infra/S3Service → AWS S3 integration.
• Test code under src/test.
README Insights
• Confirms this is the server component.
Diagramming the Architecture
a. Main Components
• External clients (e.g., Web app, mobile)
• API Layer (HTTP) → Controllers (PinController, ImageController, etc.)
• Service Layer → PinService, UserService, Vote logic, S3Service
• Persistence Layer → Spring Data JPA Repositories
• Database (e.g., MySQL, PostgreSQL)
• External Storage → AWS S3 bucket
• Configuration & Cross-cutting concerns → CORS, Swagger UI
b. Relationships & Data Flows
1. Client → HTTP(S) → Controller
2. Controller → Service → (optional) S3Service for images
3. Service → Repository → Database
4. Service → Repository → Vote/User/Pin tables
5. Async or direct HTTP to AWS S3 for image upload/download
c. Architectural Patterns
• Layered (Controller → Service → Repository)
• Domain-driven package structure
• Configuration classes centralize cross-cutting concerns
• Exception handling via GlobalExceptionHandler
d. Key Technologies
• Spring Boot (embedded Tomcat)
• Spring MVC (Controllers)
• Spring Data JPA & Hibernate
• AWS SDK (S3Service)
• Swagger (API docs)
• Gradle, Docker, GitHub Actions