Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f44f601
Sprint 1 과제 제출
Eunhye0k Jun 5, 2025
244826b
Merge branch 'codeit-bootcamp-spring:main' into sprint1
Eunhye0k Jun 5, 2025
b9e3968
Merge pull request #14 from Eunhye0k/sprint1
jinho-yoo-jack Jun 9, 2025
252fb19
생성 SprintMission7
cheis11 Aug 11, 2025
58f41af
Create SprintMission7 directory
cheis11 Aug 11, 2025
37f203b
Add SprintMission7 as normal folder
cheis11 Aug 11, 2025
d81197a
태스트 전 설정
cheis11 Aug 13, 2025
d829097
UserService 단위 테스트 작성
cheis11 Aug 13, 2025
03cbd50
BasicChannelServiceTest 생성
cheis11 Aug 14, 2025
e3335bf
BasicMessageServiceTest 생성
cheis11 Aug 14, 2025
17951e7
UserRepositoryTest 구현
cheis11 Aug 18, 2025
e21ff1a
MessageRepository 구현
cheis11 Aug 18, 2025
04d1449
애플리케이션 컨테이너화
cheis11 Aug 22, 2025
7445bc5
베이스 코드 및 애플리케이션 컨테이너화 복구
cheis11 Aug 25, 2025
cf98c96
애플리케이션 컨테이너화 수정
cheis11 Aug 25, 2025
addc1c3
AWS S3 테스트 완료
cheis11 Aug 25, 2025
5d584ef
S3BinaryContentStorage 수정
cheis11 Sep 1, 2025
9ce8003
SprintMission9 베이스코드 설정
cheis11 Sep 26, 2025
824cd6b
Spring Security 환경설정
cheis11 Sep 30, 2025
3f99982
CSRF 보호 설정
cheis11 Sep 30, 2025
710a8da
회원가입
cheis11 Sep 30, 2025
b5822ae
로그인 구현
cheis11 Sep 30, 2025
65eabca
현재 사용자 정보 조회 및 로그아웃
cheis11 Sep 30, 2025
7f3066b
인가 - 권한 정의
cheis11 Oct 1, 2025
7e883d4
인가 - 권한 적용
cheis11 Oct 1, 2025
9a6f91e
세션 무효화
cheis11 Oct 2, 2025
e35439f
UserStatus 관련 코드 삭제
cheis11 Oct 2, 2025
2331ab3
세션 관리 고도화
cheis11 Oct 2, 2025
c862796
로그인 고도화 - RememberMe
cheis11 Oct 2, 2025
5cea265
권한 적용 고도화
cheis11 Oct 2, 2025
72584cd
코드 스타일 정리
cheis11 Oct 2, 2025
29b4a60
코드 스타일 수정
cheis11 Oct 2, 2025
02e80ef
JWT 컴포넌트 구현
cheis11 Oct 15, 2025
1609313
리팩토링-로그인
cheis11 Oct 15, 2025
9149f14
파일 이름 변경
cheis11 Oct 16, 2025
9d30c5c
파일 삭제
cheis11 Oct 16, 2025
c742d73
베이스 코드 설정
cheis11 Oct 22, 2025
ea0172e
Spring Event - 파일 업로드 로직 분리하기
cheis11 Oct 23, 2025
ac7e73f
Spring Event - 알림 기능 추가하기
cheis11 Oct 23, 2025
75d1f19
비동기 적용 및 Spring Event 수정
cheis11 Oct 24, 2025
9360669
비동기 실패 처리하기
cheis11 Oct 24, 2025
5377a38
캐시 적용하기
cheis11 Oct 24, 2025
bed2ba8
Kafka 환경구성
cheis11 Oct 27, 2025
c69b6e4
Kafka 도입하기
cheis11 Oct 28, 2025
f54911f
Redis 도입하기
cheis11 Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

87 changes: 87 additions & 0 deletions SprintMission11/.github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: 배포

on:
push:
branches:
- release

jobs:
build-and-push:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ github.sha }}

steps:
- uses: actions/checkout@v4

- name: AWS CLI 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: us-east-1

- name: ECR 로그인
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public

- name: Docker 이미지 빌드 및 푸시
run: |
docker buildx build \
-t ${{ vars.ECR_REPOSITORY_URI }}:${{ github.sha }} \
-t ${{ vars.ECR_REPOSITORY_URI }}:latest \
--push \
.
deploy:
runs-on: ubuntu-latest
needs: build-and-push

steps:
- name: AWS CLI 설정
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
aws-region: ${{ vars.AWS_REGION }}

- name: ECS 태스크 정의 업데이트
run: |
TASK_DEFINITION=$(
aws ecs describe-task-definition \
--task-definition ${{ vars.ECS_TASK_DEFINITION }}
)

NEW_TASK_DEFINITION=$(
echo $TASK_DEFINITION | jq \
--arg IMAGE "${{ vars.ECR_REPOSITORY_URI }}:latest" \
'.taskDefinition | .containerDefinitions[0].image = $IMAGE | del(.taskDefinitionArn, .revision, .status, .requiresAttributes, .compatibilities, .registeredAt, .registeredBy)'
)

# 새로운 태스크 정의 등록
NEW_TASK_DEF_ARN=$(
aws ecs register-task-definition \
--cli-input-json "$NEW_TASK_DEFINITION" | \
jq -r '.taskDefinition.taskDefinitionArn'
)

# 환경 파일에 변수 저장 (다음 단계에서 사용 가능)
echo "NEW_TASK_DEF_ARN=$NEW_TASK_DEF_ARN" >> $GITHUB_ENV

- name: ECS 서비스 중지(프리티어 환경 고려)
run: |
aws ecs update-service \
--cluster ${{ vars.ECS_CLUSTER }} \
--service ${{ vars.ECS_SERVICE }} \
--desired-count 0

- name: ECS 서비스 업데이트
run: |
aws ecs update-service \
--cluster ${{ vars.ECS_CLUSTER }} \
--service ${{ vars.ECS_SERVICE }} \
--task-definition $NEW_TASK_DEF_ARN \
--desired-count 1 \
--force-new-deployment

30 changes: 30 additions & 0 deletions SprintMission11/.github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 테스트

on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: 체크아웃
uses: actions/checkout@v4

- name: JDK 17 설정
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'corretto'
cache: gradle

- name: 테스트 실행
run: ./gradlew test

- name: Codecov 테스트 커버리지 업로드
uses: codecov/codecov-action@v3
with:
files: build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.CODECOV_TOKEN }} # 퍼블릭 저장소라면 생략 가능
50 changes: 50 additions & 0 deletions SprintMission11/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store

### Discodeit ###
.discodeit

### 숨김 파일 ###
.*
!.gitignore


### Github Actions ###
!.github/
40 changes: 40 additions & 0 deletions SprintMission11/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 빌드 스테이지
FROM amazoncorretto:17 AS builder

# 작업 디렉토리 설정
WORKDIR /app

# Gradle Wrapper 파일 먼저 복사
COPY gradle ./gradle
COPY gradlew ./gradlew

# Gradle 캐시를 위한 의존성 파일 복사
COPY build.gradle settings.gradle ./

# 의존성 다운로드
RUN ./gradlew dependencies

# 소스 코드 복사 및 빌드
COPY src ./src
RUN ./gradlew build -x test


# 런타임 스테이지
FROM amazoncorretto:17-alpine3.21

# 작업 디렉토리 설정
WORKDIR /app

# 프로젝트 정보를 ENV로 설정
ENV PROJECT_NAME=discodeit \
PROJECT_VERSION=1.2-M8 \
JVM_OPTS=""

# 빌드 스테이지에서 jar 파일만 복사
COPY --from=builder /app/build/libs/${PROJECT_NAME}-${PROJECT_VERSION}.jar ./

# 80 포트 노출
EXPOSE 80

# jar 파일 실행
ENTRYPOINT ["sh", "-c", "java ${JVM_OPTS} -jar ${PROJECT_NAME}-${PROJECT_VERSION}.jar"]
22 changes: 22 additions & 0 deletions SprintMission11/HELP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Getting Started

### Reference Documentation
For further reference, please consider the following sections:

* [Official Gradle documentation](https://docs.gradle.org)
* [Spring Boot Gradle Plugin Reference Guide](https://docs.spring.io/spring-boot/3.4.0/gradle-plugin)
* [Create an OCI image](https://docs.spring.io/spring-boot/3.4.0/gradle-plugin/packaging-oci-image.html)
* [Spring Web](https://docs.spring.io/spring-boot/3.4.0/reference/web/servlet.html)

### Guides
The following guides illustrate how to use some features concretely:

* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/)
* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/)
* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/)

### Additional Links
These additional references should also help you:

* [Gradle Build Scans – insights for your project's build](https://scans.gradle.com#gradle)

5 changes: 5 additions & 0 deletions SprintMission11/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 0-spring-mission

스프린트 미션 모범 답안 리포지토리입니다.

[![codecov](https://codecov.io/gh/codeit-bootcamp-spring/0-sprint-mission/branch/s8%2Fadvanced/graph/badge.svg?token=XRIA1GENAM)](https://codecov.io/gh/codeit-bootcamp-spring/0-sprint-mission)
75 changes: 75 additions & 0 deletions SprintMission11/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'jacoco'
}

group = 'com.sprint.mission'
version = '2.2-M11'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
testCompileOnly {
extendsFrom testAnnotationProcessor
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.4'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'software.amazon.awssdk:s3:2.31.7'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'com.nimbusds:nimbus-jose-jwt:10.3'

runtimeOnly 'org.postgresql:postgresql'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
implementation 'org.mapstruct:mapstruct:1.6.3'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
testImplementation 'com.h2database:h2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

implementation 'org.springframework.retry:spring-retry'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'org.springframework.kafka:spring-kafka'
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
}

tasks.named('test') {
useJUnitPlatform()
}

test {
finalizedBy jacocoTestReport
}

jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
}
}
25 changes: 25 additions & 0 deletions SprintMission11/docker-compose-kafka.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# docker-compose-kafka.yaml
# https://developer.confluent.io/confluent-tutorials/kafka-on-docker/#the-docker-compose-file
services:
broker:
image: apache/kafka:latest
hostname: broker
container_name: broker
ports:
- 9092:9092
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:29093
KAFKA_LISTENERS: PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
14 changes: 14 additions & 0 deletions SprintMission11/docker-compose-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# docker-compose-redis.yml
# https://developer.confluent.io/confluent-tutorials/kafka-on-docker/#the-docker-compose-file
services:
redis:
image: redis:7.2-alpine
container_name: redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes

volumes:
redis-data:
Loading