Skip to content

Commit d3b18f1

Browse files
committed
2025.06.21
1 parent 63da671 commit d3b18f1

File tree

653 files changed

+6440
-11837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

653 files changed

+6440
-11837
lines changed

.github/workflows/main.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ env:
1616
AWS_CODE_DEPLOY_GROUP_RELEASE: imdang-release-deploy
1717

1818
jobs:
19+
# develop 브랜치
1920
deploy-develop:
2021
#if: github.ref == 'refs/heads/develop'
2122
if: false
@@ -58,10 +59,26 @@ jobs:
5859
- name: Build and Test
5960
run: ./gradlew imdang-container:clean imdang-container:assemble
6061

62+
- name: Build Batch Module
63+
run: ./gradlew batch:clean batch:assemble
64+
6165
# 빌드 파일을 zip 형식으로 압축 - S3에서는 jar 저장이 안되기 때문에 zip으로 생성
66+
# - name: Make zip file
67+
# run: zip -r ./$GITHUB_SHA.zip .
68+
# shell: bash
69+
70+
# backend(root)/
71+
# -- imdang-container/
72+
# ---- build/libs/imdang-container.jar
73+
# -- batch/
74+
# ---- build/libs/batch.jar
75+
# -- build.gradle
76+
# -- .github/workflows/main.yml
6277
- name: Make zip file
63-
run: zip -r ./$GITHUB_SHA.zip .
64-
shell: bash
78+
run: |
79+
mkdir deploy
80+
cp imdang-container/build/libs/*.jar deploy/
81+
cp batch/build/libs/*.jar
6582
6683
# AWS 권한
6784
- name: AWS credential 설정
@@ -79,6 +96,7 @@ jobs:
7996
- name: EC2에 배포
8097
run: aws deploy create-deployment --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} --deployment-config-name CodeDeployDefault.AllAtOnce --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} --s3-location bucket=$AWS_S3_BUCKET,key=$GITHUB_SHA.zip,bundleType=zip
8198

99+
# release 브랜치
82100
deploy-release:
83101
if: github.ref == 'refs/heads/release'
84102
runs-on: ubuntu-latest

README.md

Lines changed: 80 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,80 @@
1-
# Backend
2-
- Java, Spring Boot, MySQL, JPA
3-
4-
### 규칙
5-
- 커밋 컨벤션
6-
- 깃 브랜치 전략
7-
- 코드 컨벤션
8-
- 서버 아키텍처
9-
10-
### 기술 문서
11-
- CI/CD 파이프라인 구축
12-
- ERD
13-
- 시스템 아키텍처
14-
15-
### 개선 필요
16-
- 자주 조회되는 인사이트에 대해 캐싱 적용
17-
- 알림(notification) 조회 시 is_checked를 true로 변경할 때 일괄 바꾸는 것이 성능 측면에서 더 좋을 것이다. 헥사고날 아키텍처에서 어떻게 효과적으로 구현할 수 있을까?
1+
# 아파트임당(Imdang)
2+
3+
## 1. 프로젝트 개요 (Overview)
4+
- 임장 후기 공유 플랫폼
5+
[Link]
6+
7+
### # 주요 기능
8+
- 인사이트 등록/수정
9+
- 인사이트 교환(교환 요청/수락/거절)
10+
11+
## 2. 시스템 아키텍처 (System Architecture)
12+
### # 개요
13+
- Hexagonal Architecture 기반 설계 (참고: https://github.com/agelenler/food-ordering-system)
14+
- 레이어 모듈화
15+
```text
16+
|-- insight-application-service
17+
|-- insight-application-messaging
18+
|-- insight-domain
19+
|- infra
20+
```
21+
- Inbound Adapter (외부 → 시스템)
22+
- Application Layer
23+
- API 요청이 들어오는 레이어
24+
- `@RestController`
25+
- Messaging Layer
26+
- 메시지 브로커나 이벤트 시스템과의 연동
27+
- `@KafkaListener`
28+
- `@EventListener`
29+
- `@Scheduled`
30+
- Application Service : usecase 수행
31+
- Domain Application Layer
32+
- Application Service Layer : Use Case 정의, 도메인 로직 호출
33+
- Domain Core Layer : 도메인 로직을 담당
34+
- Outbound Adapter (시스템 → 외부)
35+
- Persistence Layer : 외부 데이터베이스 등과 통신 (Output)
36+
- `FeignClient`
37+
- `RestTemplate`
38+
- `KafkaTemplate`
39+
- `JpaRepository`
40+
- dependency : Application/Persistence → Domain Application → Domain Core
41+
- 역참조 방지
42+
- 주요 기술 스택
43+
- Backend: Spring Boot, Java 17, JPA, ~~Kafka, Redis,~~ Spring Batch
44+
- Database: MySQL
45+
- CI/CD: Github Actions, ~~Docker~~
46+
- Frontend: AOS, IOS
47+
- Infrastructure: AWS(EC2, RDS, S3, CodeDeploy)
48+
- ~~Load Test: Locust~~
49+
- 오픈 소스 부하 테스트 도구
50+
- 사용자가 Python으로 시나리오를 작성하여 웹 애플리케이션의 성능을 측정
51+
- ~~Monitoring~~
52+
53+
## 3. 모듈 구조 및 도메인 모델링
54+
### # backend(rootProject)
55+
56+
### # insight-service
57+
- 인사이트 관련 서비스
58+
- `Insight`
59+
### # member-service
60+
- `Member`
61+
### # setting-service
62+
- 알림 관련 서비스
63+
- `Notification`
64+
### ~~# admin-service~~
65+
### # common
66+
- 각 모듈에서 공통적으로 사용하는 클래스 모음
67+
### # batch
68+
### # infrastructure
69+
70+
## 4. 데이터베이스 설계 (Database Design, ERD)
71+
72+
## 5. 기능 정의 (Feature Specification)
73+
74+
## 6. CI/CD
75+
- 빌드, 서버 배포 자동화
76+
- `.github/workflows/main.yml`
77+
- `develop` 혹은 `release` 브랜치에 코드 push
78+
- 프로젝트 빌드
79+
- AWS S3에 zip으로 업로드
80+
- AWS CodeDeploy를 통해 EC2에 배포

TEST.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# 성능 테스트
2+
3+
### 성능 지표
4+
#### 1. 처리량(Throughput)
5+
- 시스템 측면의 성능을 평가하는 KPI
6+
7+
##### # TPS(Transactions per Seconds)
8+
- 단위 시간당 대상 시스템에서 처리되고 있는 요청 건수
9+
- 초당 발생하는 Business Transaction
10+
11+
#### 2. 응답시간(Response Time)
12+
- 사용자 측면에서의 성능을 평가하는 KPI
13+
- 사용자가 해당 업무를 요청한 시점부터 서버로부터 그 결과에 대한 응답을 받아서 사용자 화면에 디스플레이할 때까지 소요된 총 시간
14+
```text
15+
Response Time = Client Time + Network Time + Server Processing + Sending Time
16+
```
17+
### 처리량과 응답시간의 상관 관계
18+
- 부하가 증가할수록 (사용자의 요청이 증가할수록) 어느 수준까지는 처리량이 선형적으로 증가한다.
19+
- 그러나, 어느 시점에 이르면 처리량이 더 이상 증가하지 않고 일정한 수준을 유지하게 되는데, 이 변곡점을 포화점/임계점이라고 한다.
20+
21+
```text
22+
spring:
23+
datasource:
24+
hikari:
25+
minimum-idle: 10
26+
maximum-pool-size: 10
27+
idle-timeout: 30000
28+
connection-timeout: 20000
29+
```
30+
* minimum-idle
31+
- 최소 유휴 커넥션 수
32+
- 초기 설정 시 최소한의 커넥션만 유지
33+
- TPS가 낮을 때 리소스 절약 가능
34+
35+
* maximum-pool-size
36+
- 커넥션 풀의 최대 크기
37+
- TPS가 높아질 때 최대 N개의 커넥션까지 생성해서 요청을 처리
38+
39+
* idle-timeout
40+
- 지정된 시간(ms)동안 유휴 상태인 커넥션이 있을 경우 풀에서 제거
41+
- 트래픽이 낮아질 때 자동으로 풀 크기를 줄이는 데 기여
42+
43+
* connection-timeout
44+
- 커넥션을 얻기 위해 대기하는 최대 시간
45+
- 해당 시간 내에 커넥션을 확보하지 못하면 예외가 발생
46+
47+
48+
-

batch/.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/gradlew text eol=lf
2+
*.bat text eol=crlf
3+
*.jar binary

batch/.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/

batch/build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
plugins {
2+
id 'java'
3+
id 'org.springframework.boot' version '3.3.4'
4+
id 'io.spring.dependency-management' version '1.1.6'
5+
}
6+
7+
bootJar {
8+
enabled = true
9+
}
10+
jar {
11+
enabled = false
12+
}
13+
14+
dependencies {
15+
implementation 'org.springframework.boot:spring-boot-starter-batch'
16+
// implementation 'org.springframework.boot:spring-boot-starter-quartz'
17+
runtimeOnly 'com.mysql:mysql-connector-j'
18+
19+
// testRuntimeOnly 'com.h2database:h2:2.1.214'
20+
}
21+
22+
tasks.named('bootJar') {
23+
mainClass.set('com.project.imdang.BatchApplication')
24+
}
42.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)