Skip to content

Commit 76d5108

Browse files
committed
Feat: 초기 환경 구축 및 카카오 소셜 로그인 설계
0 parents  commit 76d5108

72 files changed

Lines changed: 2493 additions & 0 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: "🔔 새로운 기능"
2+
description: "새로운 기능을 만들어주세요"
3+
title: "[✨ Feature] "
4+
labels: "✨ Feature"
5+
body:
6+
- type: input
7+
attributes:
8+
label: 🔔 개요
9+
description: 새로운 기능에 대한 설명을 작성해 주세요.
10+
placeholder: 꼼꼼하게 적을수록 좋습니다!
11+
validations:
12+
required: true
13+
- type: textarea
14+
attributes:
15+
label: ✅ 해야 할 일
16+
description: 해야 할 일을 작성해 주세요.
17+
placeholder: |
18+
- [ ] 회원가입 API 구현
19+
- [ ] 회원가입 API 테스트 코드 작성
20+
- [ ] 회원가입 API 문서화
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: 🙏🏻 요구사항
26+
description: 개발시 유의해야 할 요구사항을 정리해 주세요.
27+
placeholder: |
28+
- [ ] 하나의 전화번호로 한 번만 가입할 수 있다.
29+
- [ ] 전화번호는 반드시 11글자여야 한다.
30+
validations:
31+
required: true
32+
- type: textarea
33+
attributes:
34+
label: 🙋🏻 덧붙일 말
35+
description: 더 하고 싶은 말이 있다면 작성해 주세요.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "🙌 개선하기"
2+
description: "이 기능을 개선해주세요"
3+
title: "[🔨 Refactor] "
4+
labels: "🔨 Refactor"
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: 🙌 개선 방향
9+
description: 개선 방향을 작성해 주세요.
10+
placeholder: 꼼꼼하게 적을수록 좋습니다!
11+
validations:
12+
required: true
13+
- type: textarea
14+
attributes:
15+
label: 💻 코드
16+
description: 관련 코드가 있다면 복붙해 주세요.
17+
validations:
18+
required: false
19+
- type: textarea
20+
attributes:
21+
label: 🏄‍♂️ 참고 자료
22+
description: 참고 자료가 있다면 작성해 주세요.

.github/ISSUE_TEMPLATE/report.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "🚨 버그 리포트"
2+
description: "버그가 발생했어요"
3+
title: "[🐞 Bug] "
4+
labels: "🐞 Bug"
5+
body:
6+
- type: textarea
7+
attributes:
8+
label: 🐞설명
9+
description: 버그에 대한 설명을 작성해 주세요.
10+
placeholder: 꼼꼼하게 적을수록 좋습니다!
11+
validations:
12+
required: true
13+
- type: textarea
14+
attributes:
15+
label: ⛰️ 맥락
16+
description: 버그가 발생한 맥락(=재현 방법)을 작성해 주세요.
17+
placeholder: |
18+
1. 회원가입을 한다.
19+
2. 새로운 창으로 이동한다.
20+
3. "로그인을 할 수 없습니다."라는 메시지가 뜬다.
21+
validations:
22+
required: true
23+
- type: textarea
24+
attributes:
25+
label: 🌏 환경
26+
description: 버그가 발생한 환경에 대해 작성해 주세요.
27+
placeholder: |
28+
OS: macOS 12.2.1
29+
validations:
30+
required: true
31+
- type: textarea
32+
attributes:
33+
label: 📄 로그
34+
description: 로그 있으면 복붙해 주세요.
35+
render: shell
36+
validations:
37+
required: false
38+
- type: textarea
39+
attributes:
40+
label: 🙋🏻 덧붙일 말
41+
description: 더 하고 싶은 말이 있다면 작성해 주세요.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## #️⃣연관된 이슈
2+
3+
> ex) #이슈번호, #이슈번호
4+
5+
## 📝작업 내용
6+
7+
> 이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)
8+
9+
### 스크린샷 (선택)
10+
11+
## 💬리뷰 요구사항(선택)
12+
13+
14+
> 리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요
15+
>
16+
> ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

.github/workflows/deploy.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: flowfit CI/CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# (1) 깃 체크아웃
14+
- name: Check out repository
15+
uses: actions/checkout@v2
16+
17+
# (2) ENV 파일 생성
18+
- name: Create env files
19+
run: |
20+
mkdir -p env
21+
echo "${{ secrets.ENV_VARS }}" > env/prod.env
22+
23+
# (3) JDK 17 세팅
24+
- name: Set up JDK 17
25+
uses: actions/setup-java@v2
26+
with:
27+
distribution: 'temurin'
28+
java-version: '17'
29+
30+
# (4) gradlew 실행 권한 부여
31+
- name: Grant execute permission for gradlew
32+
run: chmod +x gradlew
33+
34+
# (5) Gradle 빌드 (테스트 스킵)
35+
- name: Build with Gradle (skip tests)
36+
run: ./gradlew clean build -x test
37+
38+
# (6) Docker 이미지 빌드
39+
- name: Build Docker Image
40+
run: |
41+
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:latest .
42+
43+
# (7) DockerHub 로그인
44+
- name: DockerHub Login
45+
run: |
46+
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
47+
48+
# (8) Docker 이미지 푸시
49+
- name: Push Docker Image
50+
run: |
51+
docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:latest
52+
53+
# (8.5) EC2에 flowfit 디렉토리 생성 (없으면 만들기)
54+
- name: Create directory on EC2
55+
uses: appleboy/ssh-action@master
56+
with:
57+
host: ${{ secrets.SERVER_HOST }}
58+
username: ${{ secrets.SERVER_USERNAME }}
59+
key: ${{ secrets.SERVER_SSH_KEY }}
60+
script: |
61+
mkdir -p /home/ubuntu/flowfit # 경로가 없으면 만들기
62+
63+
# (8.6) docker-compose.yml 파일 EC2로 복사
64+
- name: Copy docker-compose.yml to EC2
65+
uses: appleboy/scp-action@master
66+
with:
67+
host: ${{ secrets.SERVER_HOST }}
68+
username: ${{ secrets.SERVER_USERNAME }}
69+
key: ${{ secrets.SERVER_SSH_KEY }}
70+
source: "docker-compose.yml"
71+
target: "/home/ubuntu/flowfit"
72+
73+
# (8.7) .env 파일 EC2로 복사 (환경 변수 문제 방지)
74+
- name: Copy .env file to EC2
75+
uses: appleboy/scp-action@master
76+
with:
77+
host: ${{ secrets.SERVER_HOST }}
78+
username: ${{ secrets.SERVER_USERNAME }}
79+
key: ${{ secrets.SERVER_SSH_KEY }}
80+
source: "env/prod.env"
81+
target: "/home/ubuntu/flowfit/.env"
82+
83+
# (9) SSH로 서버 접속 후 컨테이너 실행
84+
- name: Deploy to Server
85+
uses: appleboy/ssh-action@master
86+
with:
87+
host: ${{ secrets.SERVER_HOST }}
88+
username: ${{ secrets.SERVER_USERNAME }}
89+
key: ${{ secrets.SERVER_SSH_KEY }}
90+
script: |
91+
cd /home/ubuntu/flowfit
92+
sudo ln -s /usr/bin/docker-compose /usr/local/bin/docker-compose || true # 심볼릭 링크 생성 (이미 있으면 무시)
93+
docker compose down || true # 기존 컨테이너 종료 (V2 스타일)
94+
docker image prune -a -f
95+
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO_NAME }}:latest
96+
docker compose up -d # V2 스타일로 컨테이너 실행

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM openjdk:17
2+
ARG JAR_FILE=build/libs/*.jar
3+
COPY ${JAR_FILE} /app.jar
4+
COPY env/prod.env /env/prod.env
5+
EXPOSE 8080
6+
ENTRYPOINT ["java", "-jar", "/app.jar"]

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### 커밋 컨벤션
2+
3+
| Type | Description |
4+
|------------|--------------------------------------------------|
5+
| **feat** | 새로운 기능 추가 |
6+
| **fix** | 버그 수정 |
7+
| **refactor** | 코드 리팩토링 (기능 변경 없이 구조 개선) |
8+
| **test** | 테스트 코드 작성 |
9+
| **chore** | 기타 자잘한 작업 (빌드 설정, 패키지 관리 등) |
10+
| **docs** | 문서 추가 또는 수정 |
11+
| **delete** | 불필요한 코드나 파일 삭제 |
12+
| **build** | 빌드 관련 파일 및 설정 변경 |
13+
14+
---
15+
16+
### 커밋 메시지 형식
17+
- **형식**: `타입(#이슈번호) :: 변경 사항 요약`
18+
- **제목**은 50자 이내, **본문**은 선택적이지만 72자 이내로 요약 설명 권장.
19+
20+
---
21+
22+
### 주의 사항
23+
```
24+
이슈 만들고 브랜치 추가해주세요!!
25+
```

build.gradle

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
plugins {
2+
id 'java'
3+
id 'org.springframework.boot' version '3.3.8'
4+
id 'io.spring.dependency-management' version '1.1.7'
5+
}
6+
group = 'stdev'
7+
version = '0.0.1-SNAPSHOT'
8+
9+
ext {
10+
set('springCloudVersion', "2023.0.1")
11+
}
12+
java {
13+
toolchain {
14+
languageVersion = JavaLanguageVersion.of(17)
15+
}
16+
}
17+
18+
configurations {
19+
compileOnly {
20+
extendsFrom annotationProcessor
21+
}
22+
}
23+
24+
repositories {
25+
mavenCentral()
26+
}
27+
28+
dependencyManagement {
29+
imports {
30+
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
31+
}
32+
}
33+
34+
dependencies {
35+
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
36+
implementation 'software.amazon.awssdk:s3:2.20.56'
37+
38+
implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
39+
implementation 'io.jsonwebtoken:jjwt-api:0.12.5'
40+
41+
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
42+
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.5'
43+
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.12.5'
44+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
45+
implementation 'org.springframework.boot:spring-boot-starter-security'
46+
implementation 'org.springframework.boot:spring-boot-starter-validation'
47+
implementation 'org.springframework.boot:spring-boot-starter-web'
48+
implementation 'org.springframework.boot:spring-boot-starter-data-redis'
49+
implementation 'org.springframework.boot:spring-boot-starter-test'
50+
compileOnly 'org.projectlombok:lombok'
51+
runtimeOnly 'com.mysql:mysql-connector-j'
52+
runtimeOnly 'org.postgresql:postgresql'
53+
annotationProcessor 'org.projectlombok:lombok'
54+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
55+
testImplementation 'org.springframework.security:spring-security-test'
56+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
57+
}
58+
59+
tasks.named('test') {
60+
useJUnitPlatform()
61+
}

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
image: chltmdgh522/stdev:latest
6+
ports:
7+
- "8080:8080"
8+
environment:
9+
- SPRING_PROFILES_ACTIVE=prod
10+
- REDIS_HOST=redis # 컨테이너 이름으로 설정
11+
- REDIS_PORT=6379
12+
- REDIS_PASSWORD=${REDIS_PASSWORD}
13+
depends_on:
14+
- redis
15+
16+
redis:
17+
image: redis
18+
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
19+
ports:
20+
- "6379:6379"
21+
environment:
22+
- REDIS_PASSWORD=${REDIS_PASSWORD}

gradle/wrapper/gradle-wrapper.jar

42.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)