Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2차 멘토링 코드리뷰용 PR #26

Closed
wants to merge 106 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
9fcda8b
env: set project file
daeun084 Oct 9, 2024
fef5e49
docs: update issue templates
daeun084 Oct 9, 2024
c466bf9
docs: create pull_request_template.md
daeun084 Oct 9, 2024
109ab79
feat: Environmental settings, log-in, and implementation of membershi…
L-U-Ready Nov 2, 2024
838f762
Merge pull request #2 from LearnMate-Dev/feature/1-setting-up-and-log…
L-U-Ready Nov 2, 2024
f3ef562
:rocket: deploy config adapt
L-U-Ready Nov 5, 2024
25e791b
Merge pull request #5 from LearnMate-Dev/feature/3-implements-deploy-…
L-U-Ready Nov 5, 2024
df638c1
:rocket: deploy config update
L-U-Ready Nov 6, 2024
03a0a6e
:rocket: deploy config update
L-U-Ready Nov 6, 2024
6c1b416
:rocket: deploy config update
L-U-Ready Nov 6, 2024
2b4d9cd
:rocket: deploy config update
L-U-Ready Nov 6, 2024
4dfc213
:rocket: deploy config update
L-U-Ready Nov 6, 2024
247d65f
chore: annotation 추가
daeun084 Nov 6, 2024
4cbf368
add: entity 작성 및 연관관계 설정
daeun084 Nov 6, 2024
ee63d01
:rocket: deploy config update
L-U-Ready Nov 6, 2024
ad736ca
:rocket: deploy config update
L-U-Ready Nov 6, 2024
d9197f8
:rocket: deploy config update
L-U-Ready Nov 6, 2024
d46c1c9
:rocket: deploy config update
L-U-Ready Nov 6, 2024
1eed326
:rocket: deploy config update
L-U-Ready Nov 6, 2024
7774469
:rocket: deploy config update
L-U-Ready Nov 6, 2024
09b85f0
:rocket: deploy config update
L-U-Ready Nov 6, 2024
8618d7c
feat: 일기 작성 기능 임시 구현
daeun084 Nov 6, 2024
1d927a7
feat: 일기 수정 기능 구현
daeun084 Nov 6, 2024
7868497
feat: 일기 삭제 기능 구현
daeun084 Nov 6, 2024
94dc322
feat: 일기 상세 조회 기능 구현
daeun084 Nov 6, 2024
b373c18
chore: 감정 분석, 행동 요령 제안 API 호출 위치 변경
daeun084 Nov 6, 2024
a595580
chore: 일기 작성 기능 수정
daeun084 Nov 6, 2024
46782f5
chore: diary, emotion, actiontip 연관관계 설정 코드 수정
daeun084 Nov 6, 2024
347a121
Merge pull request #6 from LearnMate-Dev/feature/#4
daeun084 Nov 6, 2024
dbb782e
Merge pull request #10 from LearnMate-Dev/chore/#9
daeun084 Nov 6, 2024
128e9d6
add: cloud natural language api 사용을 위한 config 설정
daeun084 Nov 8, 2024
a92264a
feat: 감정 분석 기능 구현
daeun084 Nov 8, 2024
eaf8946
add: chat gpt API 연결 및 config 설정
daeun084 Nov 8, 2024
4dd72a3
Merge pull request #11 from LearnMate-Dev/feature/#7
daeun084 Nov 9, 2024
9ff0fd6
:rocket: deploy config update
L-U-Ready Nov 11, 2024
1c2e590
:rocket: deploy config update
L-U-Ready Nov 11, 2024
06b15db
:rocket: deploy config update
L-U-Ready Nov 11, 2024
66117af
:rocket: deploy config update
L-U-Ready Nov 11, 2024
0518b08
:rocket: deploy config update
L-U-Ready Nov 11, 2024
d4f4753
:rocket: deploy config update
L-U-Ready Nov 11, 2024
0f3e82f
:rocket: deploy config update
L-U-Ready Nov 11, 2024
ce87286
:rocket: deploy config update
L-U-Ready Nov 11, 2024
ea28d24
:rocket: deploy config update
L-U-Ready Nov 11, 2024
69ab6da
:rocket: deploy config update
L-U-Ready Nov 11, 2024
1ac2ba1
:rocket: deploy config update
L-U-Ready Nov 11, 2024
b6bf1d3
:rocket: deploy config update
L-U-Ready Nov 11, 2024
808fc8c
:rocket: deploy config update
L-U-Ready Nov 11, 2024
9308600
:rocket: deploy config update
L-U-Ready Nov 11, 2024
ff02ad5
:rocket: deploy config update
L-U-Ready Nov 11, 2024
f992ca4
:rocket: deploy config update
L-U-Ready Nov 11, 2024
7cbe547
:rocket: deploy config update
L-U-Ready Nov 11, 2024
3afccb8
:rocket: deploy config update
L-U-Ready Nov 11, 2024
0def0a0
:rocket: deploy config update
L-U-Ready Nov 11, 2024
76d5a02
:rocket: deploy config update
L-U-Ready Nov 11, 2024
88fc4ec
:rocket: deploy config update
L-U-Ready Nov 11, 2024
2bcd739
:rocket: deploy config update
L-U-Ready Nov 11, 2024
d01537e
:rocket: deploy config update
L-U-Ready Nov 11, 2024
76c2984
:rocket: deploy config update
L-U-Ready Nov 11, 2024
398564a
:rocket: deploy config update
L-U-Ready Nov 11, 2024
37d8ff6
:rocket: deploy config update
L-U-Ready Nov 11, 2024
83513f9
:rocket: deploy config update
L-U-Ready Nov 11, 2024
9f6ae7b
:rocket: deploy config update
L-U-Ready Nov 11, 2024
c33b135
:rocket: deploy config update
L-U-Ready Nov 11, 2024
67d089f
:rocket: deploy config update
L-U-Ready Nov 11, 2024
aac6cd8
:rocket: deploy config update
L-U-Ready Nov 11, 2024
412c4ff
:rocket: deploy config update
L-U-Ready Nov 11, 2024
0368671
:rocket: deploy config update
L-U-Ready Nov 11, 2024
3b000e4
:rocket: deploy config update
L-U-Ready Nov 11, 2024
d1349b7
:rocket: deploy config update
L-U-Ready Nov 11, 2024
06c8118
:rocket: deploy config update
L-U-Ready Nov 11, 2024
6e28c21
:rocket: deploy config update
L-U-Ready Nov 11, 2024
b6a54b1
:rocket: deploy config update
L-U-Ready Nov 11, 2024
e461708
:rocket: deploy config update
L-U-Ready Nov 11, 2024
44e481b
:rocket: deploy config update
L-U-Ready Nov 11, 2024
150aa89
:rocket: deploy config update
L-U-Ready Nov 11, 2024
239592d
:bug: signIn error fix
L-U-Ready Nov 11, 2024
49069d6
:bug: signIn response fix
L-U-Ready Nov 11, 2024
4674f3f
:sparkles: Implement Todo (plan)
L-U-Ready Nov 12, 2024
c25f3dc
Merge pull request #13 from LearnMate-Dev/feature/12-implement-todo-list
L-U-Ready Nov 12, 2024
074dcad
!hotfix: getEmotionAnalysis HTTP Method
daeun084 Nov 13, 2024
a16dedf
:rocket: secret keys add
L-U-Ready Nov 14, 2024
4eafec5
:rocket: secret keys add
L-U-Ready Nov 14, 2024
e03d4b0
feat: 행동 요령 제안 기능 구현
daeun084 Nov 17, 2024
f903924
ci: update deploy config
daeun084 Nov 17, 2024
222eb6b
chore: userId get method 추가
daeun084 Nov 17, 2024
668f9dd
Merge branch 'main' into feature/#8
daeun084 Nov 17, 2024
f2b7539
Merge pull request #15 from LearnMate-Dev/feature/#8
daeun084 Nov 17, 2024
093a34e
!hotfix: userdetail import
daeun084 Nov 17, 2024
f918e02
!hotfix: http method 변경
daeun084 Nov 17, 2024
2f1be02
ci: update deploy config
daeun084 Nov 17, 2024
0bf3c9b
feat: 감정 분석 레포트 조회 기능 구현
daeun084 Nov 17, 2024
f5350eb
refactor: 모든 감정의 개수가 모두 반환되도록 수정
daeun084 Nov 17, 2024
3470fac
Merge pull request #17 from LearnMate-Dev/feature/#16
daeun084 Nov 17, 2024
da52cf2
feat: 감정 분석 레포트 상세 조회 기능 구현
daeun084 Nov 17, 2024
a23f318
Merge pull request #21 from LearnMate-Dev/feature/#20
daeun084 Nov 17, 2024
6117e96
refactor: signIn, signUp 공통 함수 분리
daeun084 Nov 17, 2024
c3b4908
chore: report entity 제거
daeun084 Nov 17, 2024
9e6374b
feat: 홈 화면 조회 기능 구현
daeun084 Nov 17, 2024
5b43f5f
Merge pull request #22 from LearnMate-Dev/feature/#18
daeun084 Nov 17, 2024
0cd11b2
:sparkles: Implement Todo Guide
L-U-Ready Nov 18, 2024
a53d56a
Merge pull request #23 from LearnMate-Dev/feature/14-implement-todo-g…
L-U-Ready Nov 18, 2024
616a931
:rocket: git actions workflow update
L-U-Ready Nov 18, 2024
057d2b9
:sparkles: Add compliment card generation feature
L-U-Ready Nov 18, 2024
5fff442
Merge pull request #25 from LearnMate-Dev/feature/24-implement-compli…
L-U-Ready Nov 18, 2024
3f60f5a
:recycle: Mydifing Todo List
L-U-Ready Nov 18, 2024
0f9061d
:recycle: Mydifing Todo Guide
L-U-Ready Nov 18, 2024
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
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/learnmate-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: LearnMate issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---

### ✨ 이슈 내용
>

### 💡 작업 내용
- [ ]
- [ ]

### 📌 참고 사항
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### #️⃣ 관련 이슈
- closed #

### 💡 작업내용

### 📸 스크린샷(선택)

### 📝 기타
(참고사항, 리뷰어에게 전하고 싶은 말 등을 넣어주세요)
84 changes: 84 additions & 0 deletions .github/workflows/deploy.yml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EC2 스펙을 어떤걸 사용하는지 모르곘으나, t2.micro와 같은 낮은 사양에서는 'docker prune'과 같은 명령어를 통해 디스크를 확보해두는게 안정적입니다!

Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Deploy to EC2

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: 코드 체크아웃
uses: actions/checkout@v2

- name: Java 버전 설정
uses: actions/setup-java@v1
with:
java-version: '21'

- name: nlp.json 파일 생성
run: |
touch ./src/main/resources/nlp.json
echo "${{ secrets.GCP_CREDENTIALS_JSON }}" | base64 -d > ./src/main/resources/nlp.json

- name: 행동 요령 제안 프롬프트 생성
run: |
touch ./src/main/resources/action-tip-prompt.txt
echo "${{ secrets.ACTION_TIP_PROMPT }}" > ./src/main/resources/action-tip-prompt.txt
shell: bash

- name: Todo Guide 프롬프트 생성
run: |
touch ./src/main/resources/todo-guide-prompt.txt
echo "${{ secrets.TODO_GUIDE_PROMPT }}" > ./src/main/resources/todo-guide-prompt.txt
shell: bash

- name: 칭찬 카드 내용 프롬프트 생성
run: |
touch ./src/main/resources/compliment-card-content-prompt.txt
echo "${{ secrets.COMPLIMENT_CARD_CONTENT_PROMPT }}" > ./src/main/resources/compliment-card-content-prompt.txt
shell: bash

- name: 칭찬 카드 제목 프롬프트 생성
run: |
touch ./src/main/resources/compliment-card-title-prompt.txt
echo "${{ secrets.COMPLIMENT_CARD_TITLE_PROMPT }}" > ./src/main/resources/compliment-card-title-prompt.txt
shell: bash

- name: Docker 로그인
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: JIB로 Docker 이미지 빌드 및 푸시

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋습니다 ㅎㅎ

run: |
./gradlew jib --image=${{ secrets.DOCKER_USERNAME }}/learnmate:latest

- name: EC2에 Docker 컨테이너 배포
run: |
echo "${{ secrets.EC2_SSH_KEY }}" > ssh_key
chmod 600 ssh_key
ssh -o StrictHostKeyChecking=no -i ssh_key ec2-user@${{ secrets.EC2_HOST }} << 'EOF'
# 최신 이미지를 가져옴.
docker pull ${{ secrets.DOCKER_USERNAME }}/learnmate:latest

# 기존 컨테이너 중지 및 제거
docker stop learnmate-app || true
docker rm learnmate-app || true

# 새 컨테이너 실행
docker run -d \
--name learnmate-app \
-p 8080:8080 \
-e DATABASE_URL=${{ secrets.DATABASE_URL }} \
-e DATABASE_USERNAME=${{ secrets.DATABASE_USERNAME }} \
-e DATABASE_PASSWORD=${{ secrets.DATABASE_PASSWORD }} \
-e JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} \
-e JWT_ACCESS_TOKEN_EXPIRE=${{ secrets.JWT_ACCESS_TOKEN_EXPIRE }} \
-e JWT_REFRESH_TOKEN_EXPIRE=${{ secrets.JWT_REFRESH_TOKEN_EXPIRE }} \
-e OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }} \
-e OPENAI_MODEL=${{ secrets.OPENAI_MODEL }} \
-e GCP_CREDENTIALS_LOCATION="classpath:nlp.json" \
${{ secrets.DOCKER_USERNAME }}/learnmate:latest
EOF
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,51 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

HELP.md
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

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

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

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

### VS Code ###
.vscode/

### env
.env

### nlp.json
src/main/resources/nlp.json

### prompt
src/main/resources/*.txt
95 changes: 95 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.3.4'
id 'io.spring.dependency-management' version '1.1.6'
id 'com.google.cloud.tools.jib' version '3.3.2'

}

group = 'LearnMate'
version = '0.0.1-SNAPSHOT'

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

configurations {
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}

ext {
set('springAiVersion', "1.0.0-M2")
}

dependencies {
runtimeOnly 'com.mysql:mysql-connector-j'

implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-web'

compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'mysql:mysql-connector-java:8.0.33'

implementation 'me.paulschwarz:spring-dotenv:2.5.4'

implementation group: 'org.springdoc', name: 'springdoc-openapi-starter-webmvc-ui', version: '2.2.0'

// jwt & json
implementation 'io.jsonwebtoken:jjwt-api:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.11.5'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.11.5'

// gson
implementation 'com.google.code.gson:gson'

// json
implementation 'org.json:json:20230227'

// google natural language
implementation 'com.google.cloud:google-cloud-language:2.53.0'

// open-ai
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'

}

dependencyManagement {
imports {
mavenBom "org.springframework.ai:spring-ai-bom:${springAiVersion}"
}
}

jib {
from {
image = 'openjdk:21-jdk'
}
to {
image = "${System.getenv('DOCKER_USERNAME')}/learnMate"
tags = ['latest']
}
container {
ports = ['8080']
}
}
tasks.named('test') {
useJUnitPlatform()
}
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.8'

services:
app:
image: ${DOCKER_USERNAME}/learnmate:latest
container_name: learnmate-app
ports:
- "8080:8080"
env_file:
- .env
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading