diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..b4a0214
Binary files /dev/null and b/.DS_Store differ
diff --git a/.ebextensions-dev/00-makefiles.config b/.ebextensions-dev/00-makefiles.config
new file mode 100644
index 0000000..8030404
--- /dev/null
+++ b/.ebextensions-dev/00-makefiles.config
@@ -0,0 +1,12 @@
+files:
+ "/sbin/appstart":
+ mode: "000755"
+ owner: webapp
+ group: webapp
+ content: |
+ #!/usr/bin/env bash
+ JAR_PATH=/var/app/current/application.jar
+
+ # run app
+ killalljava
+ java -Dfile.encoding=UTF-8 -jar $JAR_PATH
\ No newline at end of file
diff --git a/.ebextensions-dev/01-set-timezone.config b/.ebextensions-dev/01-set-timezone.config
new file mode 100644
index 0000000..869275c
--- /dev/null
+++ b/.ebextensions-dev/01-set-timezone.config
@@ -0,0 +1,3 @@
+commands:
+ set_time_zone:
+ command: ln -f -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
\ No newline at end of file
diff --git "a/.github/ISSUE_TEMPLATE/\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md" "b/.github/ISSUE_TEMPLATE/\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md"
new file mode 100644
index 0000000..45cf640
--- /dev/null
+++ "b/.github/ISSUE_TEMPLATE/\354\235\264\354\212\210-\355\205\234\355\224\214\353\246\277.md"
@@ -0,0 +1,16 @@
+---
+name: 이슈 템플릿
+about: 이슈 생성시 해당 템플릿을 사용해주세요
+title: "[Feat/Refactor/Fix/Ci] + 제목"
+labels: ''
+assignees: ''
+
+---
+
+***
+### 세부내용
+
+***
+### 체크 리스트
+- [ ] 구현
+- [ ] 기능 테스트
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..6364938
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,13 @@
+## 개요
+
+## 작업사항
+
+## 변경로직
+
+### 변경 전
+
+### 변경 후
+
+## 사용방법
+
+## 기타
\ No newline at end of file
diff --git a/.github/workflows/dev_deploy.yml b/.github/workflows/dev_deploy.yml
new file mode 100644
index 0000000..94f1e4a
--- /dev/null
+++ b/.github/workflows/dev_deploy.yml
@@ -0,0 +1,61 @@
+name: Solution-friend Dev CI/CD
+
+on:
+ pull_request:
+ types: [ closed ]
+ workflow_dispatch: # (2).수동 실행도 가능하도록
+
+jobs:
+ build:
+ runs-on: ubuntu-latest # (3).OS환경
+ if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v2 # (4).코드 check out
+
+ - name: Set up JDK 11
+ uses: actions/setup-java@v3
+ with:
+ java-version: 11 # (5).자바 설치
+ distribution: 'adopt'
+
+ - name: Grant execute permission for gradlew
+ run: chmod +x ./gradlew
+ shell: bash # (6).권한 부여
+
+ - name: Build with Gradle
+ run: ./gradlew clean build -x test
+ shell: bash # (7).build시작
+
+ - name: Get current time
+ uses: 1466587594/get-current-time@v2
+ id: current-time
+ with:
+ format: YYYY-MM-DDTHH-mm-ss
+ utcOffset: "+09:00" # (8).build시점의 시간확보
+
+ - name: Show Current Time
+ run: echo "CurrentTime=$"
+ shell: bash # (9).확보한 시간 보여주기
+
+ - name: Generate deployment package
+ run: |
+ mkdir -p deploy
+ cp build/libs/*.jar deploy/application.jar
+ cp Procfile deploy/Procfile
+ cp -r .ebextensions-dev deploy/.ebextensions
+ cp -r .platform deploy/.platform
+ cd deploy && zip -r deploy.zip .
+
+ - name: Beanstalk Deploy
+ uses: einaregilsson/beanstalk-deploy@v20
+ with:
+ aws_access_key: ${{ secrets.AWS_ACTION_ACCESS_KEY_ID }}
+ aws_secret_key: ${{ secrets.AWS_ACTION_SECRET_ACCESS_KEY }}
+ application_name: solution-friend-dev
+ environment_name: Solution-friend-dev-env-1
+ version_label: github-action-${{ steps.current-time.outputs.formattedTime }}
+ region: ap-northeast-2
+ deployment_package: deploy/deploy.zip
+ wait_for_deployment: false
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c2065bc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,37 @@
+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/
diff --git a/.platform/nginx/conf.d/client_max_body_size.conf b/.platform/nginx/conf.d/client_max_body_size.conf
new file mode 100644
index 0000000..8e8277e
--- /dev/null
+++ b/.platform/nginx/conf.d/client_max_body_size.conf
@@ -0,0 +1 @@
+client_max_body_size 200M;
\ No newline at end of file
diff --git a/.platform/nginx/nginx.conf b/.platform/nginx/nginx.conf
new file mode 100644
index 0000000..0316306
--- /dev/null
+++ b/.platform/nginx/nginx.conf
@@ -0,0 +1,68 @@
+user nginx;
+error_log /var/log/nginx/error.log warn;
+pid /var/run/nginx.pid;
+worker_processes auto;
+worker_rlimit_nofile 33282;
+
+events {
+ use epoll;
+ worker_connections 1024;
+ multi_accept on;
+}
+
+http {
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ include conf.d/*.conf;
+
+ map $http_upgrade $connection_upgrade {
+ default "upgrade";
+ }
+
+ upstream springboot {
+ server 127.0.0.1:8080;
+ keepalive 1024;
+ }
+
+ server {
+ listen 80 default_server;
+ listen [::]:80 default_server;
+
+ location / {
+ proxy_pass http://springboot;
+ proxy_connect_timeout 3600;
+ proxy_send_timeout 3600;
+ proxy_read_timeout 3600;
+ # CORS 관련 헤더 추가
+# add_header 'Access-Control-Allow-Origin' '*';
+# add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
+# add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type';
+# add_header 'Access-Control-Allow-Credential' 'true';
+
+ proxy_http_version 1.1;
+ proxy_set_header Connection $connection_upgrade;
+ proxy_set_header Upgrade $http_upgrade;
+
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ }
+
+ access_log /var/log/nginx/access.log main;
+
+ client_header_timeout 60;
+ client_body_timeout 60;
+ keepalive_timeout 60;
+ gzip off;
+ gzip_comp_level 4;
+
+ # Include the Elastic Beanstalk generated locations
+ include conf.d/elasticbeanstalk/healthd.conf;
+ }
+}
\ No newline at end of file
diff --git a/Procfile b/Procfile
new file mode 100644
index 0000000..58dab8d
--- /dev/null
+++ b/Procfile
@@ -0,0 +1 @@
+web: appstart
\ No newline at end of file
diff --git a/README.md b/README.md
index caa8310..db72cef 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,61 @@
-# BE
\ No newline at end of file
+# 🗳️ 고민친구
+
+
+고민친구 백엔드 리포지토리
+
+
+
+## 🧑🤝🧑 프로젝트 개요
+투표 기반 의사결정 지원 웹 서비스
+
+
+
+
+
+
+## 🔎 주요 기능
+- 로그인 / 회원가입
+- 고민 투표 & 고민 후기 글/댓글 관리
+- 마이페이지 내 정보 관리
+- 댓글 작성 및 투표 마감 실시간 알림
+
+
+
+## 🔭 기술 스택
+- Java, Springboot
+- AWS EB, ElastiCache(Redis), RDS, VPC
+- Spring Security
+- SSE 실시간 알림
+
+
+
+## 👨👩👧👦 팀원 소개
+- PM 1명
+- Design 1명
+- Front-End(Web) 4명
+- Back-End 4명
+
+
+
+## 📖 커밋 규칙
+
+#{이슈번호} {type}: [작업한 내용]
+
+ex) #200 Feat: 사용자 뮤트 기능 추가
+
+
+| 커밋 유형 | 의미 |
+|-------|-----------|
+| Feat | 새로운 기능 추가 |
+| Fix | 버그 수정 |
+| Docs | 문서 수정 |
+| Style | 코드 formatting, 세미콜론 누락, 코드 자체의 변경이 없는 경우 |
+| Refactor | 코드 리팩토링 |
+| Test | 테스트 코드, 리팩토링 테스트 코드 추가 |
+| Chore | 패키지 매니저 수정, 그 외 기타 수정 ex) .gitignore |
+| Design | CSS 등 사용자 UI 디자인 변경 |
+| Comment | 필요한 주석 추가 및 변경 |
+| Rename | 파일 또는 폴더 명을 수정하거나 옮기는 작업만인 경우 |
+| Remove | 파일을 삭제하는 작업만 수행한 경우 |
+| !BREAKING CHANGE | 커다란 API 변경의 경우 |
+| !HOTFIX | 급하게 치명적인 버그를 고쳐야 하는 경우 |
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..a172b29
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,62 @@
+plugins {
+ id 'java'
+ id 'org.springframework.boot' version '2.7.17'
+ id 'io.spring.dependency-management' version '1.0.15.RELEASE'
+}
+
+group = 'friend'
+version = '0.0.1-SNAPSHOT'
+
+java {
+ sourceCompatibility = '11'
+}
+
+configurations {
+ compileOnly {
+ extendsFrom annotationProcessor
+ }
+}
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
+ implementation 'org.springframework.boot:spring-boot-starter-web'
+ compileOnly 'org.projectlombok:lombok'
+ runtimeOnly 'com.mysql:mysql-connector-j'
+ annotationProcessor 'org.projectlombok:lombok'
+ implementation 'org.springframework.boot:spring-boot-starter-validation'
+ testImplementation 'org.springframework.boot:spring-boot-starter-test'
+ implementation 'org.springdoc:springdoc-openapi-ui:1.6.15'
+ implementation 'io.springfox:springfox-swagger2:2.9.2'
+ implementation 'io.springfox:springfox-swagger-ui:2.9.2'
+
+ //user
+ implementation 'com.google.code.findbugs:jsr305:3.0.2'
+ //mail
+ implementation group: 'com.sun.mail', name: 'javax.mail', version: '1.6.2'
+ //jwt
+ implementation 'org.springframework.boot:spring-boot-starter-security'
+ implementation group: 'io.jsonwebtoken', name: 'jjwt-api', version: '0.11.4'
+ runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-impl', version: '0.11.4'
+ runtimeOnly group: 'io.jsonwebtoken', name: 'jjwt-jackson', version: '0.11.4'
+// redis
+ implementation 'org.springframework.boot:spring-boot-starter-data-redis'
+ //kakao
+// implementation 'org.springframework.boot:spring-boot-starter-webflux'
+ // S3
+ implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'
+ implementation platform('software.amazon.awssdk:bom:2.20.56')
+ implementation 'software.amazon.awssdk:s3'
+
+}
+
+tasks.named('test') {
+ useJUnitPlatform()
+}
+
+jar {
+ enabled = false
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..d64cd49
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..1af9e09
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100644
index 0000000..1aa94a4
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,249 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# Gradle start up script for POSIX generated by Gradle.
+#
+# Important for running:
+#
+# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+# noncompliant, but you have some other compliant shell such as ksh or
+# bash, then to run this script, type that shell name before the whole
+# command line, like:
+#
+# ksh Gradle
+#
+# Busybox and similar reduced shells will NOT work, because this script
+# requires all of these POSIX shell features:
+# * functions;
+# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+# * compound commands having a testable exit status, especially «case»;
+# * various built-in commands including «command», «set», and «ulimit».
+#
+# Important for patching:
+#
+# (2) This script targets any POSIX shell, so it avoids extensions provided
+# by Bash, Ksh, etc; in particular arrays are avoided.
+#
+# The "traditional" practice of packing multiple parameters into a
+# space-separated string is a well documented source of bugs and security
+# problems, so this is (mostly) avoided, by progressively accumulating
+# options in "$@", and eventually passing that to Java.
+#
+# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+# see the in-line comments for details.
+#
+# There are tweaks for specific operating systems such as AIX, CygWin,
+# Darwin, MinGW, and NonStop.
+#
+# (3) This script is generated from the Groovy template
+# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# within the Gradle project.
+#
+# You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
+ [ -h "$app_path" ]
+do
+ ls=$( ls -ld "$app_path" )
+ link=${ls#*' -> '}
+ case $link in #(
+ /*) app_path=$link ;; #(
+ *) app_path=$APP_HOME$link ;;
+ esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD=java
+ if ! command -v java >/dev/null 2>&1
+ then
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC2039,SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ for arg do
+ if
+ case $arg in #(
+ -*) false ;; # don't mess with options #(
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
+ [ -e "$t" ] ;; #(
+ *) false ;;
+ esac
+ then
+ arg=$( cygpath --path --ignore --mixed "$arg" )
+ fi
+ # Roll the args list around exactly as many times as the number of
+ # args, so each arg winds up back in the position where it started, but
+ # possibly modified.
+ #
+ # NB: a `for` loop captures its iteration list before it begins, so
+ # changing the positional parameters here affects neither the number of
+ # iterations, nor the values presented in `arg`.
+ shift # remove old arg
+ set -- "$@" "$arg" # push replacement arg
+ done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
+
+set -- \
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
+ -classpath "$CLASSPATH" \
+ org.gradle.wrapper.GradleWrapperMain \
+ "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+ die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+# set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+ xargs -n1 |
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+ tr '\n' ' '
+ )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..93e3f59
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..ebf1ef8
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1 @@
+rootProject.name = 'spring'
diff --git a/src/main/java/friend/spring/Application.java b/src/main/java/friend/spring/Application.java
new file mode 100644
index 0000000..2c83866
--- /dev/null
+++ b/src/main/java/friend/spring/Application.java
@@ -0,0 +1,27 @@
+package friend.spring;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
+import org.springframework.scheduling.annotation.EnableScheduling;
+
+import javax.annotation.PostConstruct;
+import java.time.LocalDateTime;
+import java.util.TimeZone;
+
+@SpringBootApplication
+@EnableJpaAuditing
+@EnableScheduling
+public class Application {
+
+ @PostConstruct
+ public void started() {
+ TimeZone.setDefault(TimeZone.getTimeZone("Asia/Seoul"));
+ }
+
+ public static void main(String[] args) {
+ SpringApplication.run(Application.class, args);
+ System.out.println("현재시간 " + LocalDateTime.now());
+ }
+
+}
diff --git a/src/main/java/friend/spring/OAuth/KakaoProfile.java b/src/main/java/friend/spring/OAuth/KakaoProfile.java
new file mode 100644
index 0000000..1ea73f6
--- /dev/null
+++ b/src/main/java/friend/spring/OAuth/KakaoProfile.java
@@ -0,0 +1,24 @@
+package friend.spring.OAuth;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import lombok.Getter;
+
+@Getter
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class KakaoProfile {
+
+ private Properties properties;
+ private KakaoAccount kakao_account;
+
+ @Getter
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public class Properties {
+ private String nickname;
+ }
+
+ @Getter
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public class KakaoAccount {
+ private String email;
+ }
+}
diff --git a/src/main/java/friend/spring/OAuth/OAuthToken.java b/src/main/java/friend/spring/OAuth/OAuthToken.java
new file mode 100644
index 0000000..1bfd95c
--- /dev/null
+++ b/src/main/java/friend/spring/OAuth/OAuthToken.java
@@ -0,0 +1,15 @@
+package friend.spring.OAuth;
+
+import lombok.Data;
+
+@Data
+public class OAuthToken {
+
+ private String access_token;
+ private String token_type;
+ private String refresh_token;
+ private String id_token;
+ private int expires_in;
+ private String scope;
+ private int refresh_token_expires_in;
+}
diff --git a/src/main/java/friend/spring/OAuth/provider/KakaoAuthProvider.java b/src/main/java/friend/spring/OAuth/provider/KakaoAuthProvider.java
new file mode 100644
index 0000000..1c6ee33
--- /dev/null
+++ b/src/main/java/friend/spring/OAuth/provider/KakaoAuthProvider.java
@@ -0,0 +1,104 @@
+package friend.spring.OAuth.provider;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import friend.spring.apiPayload.GeneralException;
+import friend.spring.apiPayload.code.status.ErrorStatus;
+import friend.spring.OAuth.KakaoProfile;
+import friend.spring.OAuth.OAuthToken;
+import friend.spring.security.PrincipalDetailService;
+import org.springframework.beans.factory.annotation.Value;
+import friend.spring.repository.UserRepository;
+import friend.spring.security.JwtTokenProvider;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.util.LinkedMultiValueMap;
+import org.springframework.util.MultiValueMap;
+import org.springframework.web.client.RestTemplate;
+
+@Component
+@RequiredArgsConstructor
+public class KakaoAuthProvider {
+
+ private final PrincipalDetailService principalDetailService;
+ private final UserRepository userRepository;
+ private final JwtTokenProvider jwtTokenProvider;
+
+ @Value("${kakao.auth.client}")
+ private String client;
+
+ @Value("${kakao.auth.redirect_uri}")
+ private String redirect;
+
+ @Value("${kakao.auth.secret_key}")
+ private String secretKey;
+
+ // code로 access 토큰 요청하기
+ public OAuthToken requestToken(String code) {
+ RestTemplate restTemplate = new RestTemplate();
+ HttpHeaders headers = new HttpHeaders();
+
+ headers.add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
+
+ MultiValueMap params = new LinkedMultiValueMap<>();
+ params.add("grant_type", "authorization_code");
+ params.add("client_id", client);
+ params.add("redirect_uri", redirect);
+ params.add("secret_key", secretKey);
+ params.add("code", code);
+
+ HttpEntity> kakaoTokenRequest =
+ new HttpEntity<>(params, headers);
+
+ ResponseEntity response =
+ restTemplate.exchange(
+ "https://kauth.kakao.com/oauth/token",
+ HttpMethod.POST,
+ kakaoTokenRequest,
+ String.class);
+
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ OAuthToken oAuthToken = null;
+
+ try {
+ oAuthToken = objectMapper.readValue(response.getBody(), OAuthToken.class);
+ } catch (JsonProcessingException e) {
+ throw new GeneralException(ErrorStatus.INVALID_REQUEST_INFO);
+ }
+
+ return oAuthToken;
+ }
+
+ // Token으로 정보 요청하기
+ public KakaoProfile requestKakaoProfile(String token) {
+ RestTemplate restTemplate = new RestTemplate();
+ HttpHeaders headers = new HttpHeaders();
+ headers.add("Content-type", "application/x-www-form-urlencoded;charset=utf-8");
+ headers.add("Authorization", "Bearer " + token);
+
+ HttpEntity> kakaoProfileRequest = new HttpEntity<>(headers);
+
+ ResponseEntity response =
+ restTemplate.exchange(
+ "https://kapi.kakao.com/v2/user/me",
+ HttpMethod.POST,
+ kakaoProfileRequest,
+ String.class);
+
+ ObjectMapper objectMapper = new ObjectMapper();
+ KakaoProfile kakaoProfile = null;
+
+ try {
+ kakaoProfile = objectMapper.readValue(response.getBody(), KakaoProfile.class);
+ } catch (JsonProcessingException e) {
+ throw new GeneralException(ErrorStatus.INVALID_REQUEST_INFO);
+ }
+
+ return kakaoProfile;
+ }
+}
diff --git a/src/main/java/friend/spring/apiPayload/ApiResponse.java b/src/main/java/friend/spring/apiPayload/ApiResponse.java
new file mode 100644
index 0000000..edea1b1
--- /dev/null
+++ b/src/main/java/friend/spring/apiPayload/ApiResponse.java
@@ -0,0 +1,39 @@
+package friend.spring.apiPayload;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import friend.spring.apiPayload.code.BaseCode;
+import friend.spring.apiPayload.code.status.SuccessStatus;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor
+@JsonPropertyOrder({"isSuccess", "code", "message", "result"})
+public class ApiResponse {
+
+ @JsonProperty("isSuccess")
+ private final Boolean isSuccess;
+ private final String code;
+ private final String message;
+ @JsonInclude(JsonInclude.Include.NON_NULL)
+ private T result;
+
+
+ // 성공한 경우 응답 생성
+
+ public static ApiResponse onSuccess(T result) {
+ return new ApiResponse<>(true, SuccessStatus._OK.getCode(), SuccessStatus._OK.getMessage(), result);
+ }
+
+ public static ApiResponse of(BaseCode code, T result) {
+ return new ApiResponse<>(true, code.getReasonHttpStatus().getCode(), code.getReasonHttpStatus().getMessage(), result);
+ }
+
+
+ // 실패한 경우 응답 생성
+ public static ApiResponse onFailure(String code, String message, T data) {
+ return new ApiResponse<>(false, code, message, data);
+ }
+}
diff --git a/src/main/java/friend/spring/apiPayload/ExceptionAdvice.java b/src/main/java/friend/spring/apiPayload/ExceptionAdvice.java
new file mode 100644
index 0000000..f9737d2
--- /dev/null
+++ b/src/main/java/friend/spring/apiPayload/ExceptionAdvice.java
@@ -0,0 +1,120 @@
+package friend.spring.apiPayload;
+
+import friend.spring.apiPayload.code.ErrorReasonDTO;
+import friend.spring.apiPayload.code.status.ErrorStatus;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+import org.springframework.web.context.request.ServletWebRequest;
+import org.springframework.web.context.request.WebRequest;
+import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.ConstraintViolationException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Optional;
+
+@Slf4j
+@RestControllerAdvice(annotations = {RestController.class})
+public class ExceptionAdvice extends ResponseEntityExceptionHandler {
+
+
+ @org.springframework.web.bind.annotation.ExceptionHandler
+ public ResponseEntity