diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 0000000..8be29bc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,28 @@ +--- +name: "๐Ÿ›๏ธ Bug" +description: "๋ฒ„๊ทธ ๋ฐœ๊ฒฌ ๋ฐ ์ˆ˜์ •/ํ•ด๊ฒฐ" +title: "๐Ÿ›๏ธ[BUG]: " +labels: "๐Ÿ›bug" +assignees: '' + +--- + +## ๐Ÿ“Œ ๋ฒ„๊ทธ ์„ค๋ช… + + +- + +
+ +## โœ… ์ˆ˜์ •ํ•  ํ•ญ๋ชฉ + +- [ ] +- [ ] + +
+ +## ๐Ÿ’ฌ ๊ธฐํƒ€ ์ฐธ๊ณ  ์‚ฌํ•ญ (์„ ํƒ) + + + +- \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/chore.md b/.github/ISSUE_TEMPLATE/chore.md new file mode 100644 index 0000000..80b6784 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/chore.md @@ -0,0 +1,27 @@ +--- +name: "โš™๏ธ Chore" +description: "์„ธํŒ… ๋ฐ ์„ค์ •, ๋นŒ๋“œ, CICD ๊ด€๋ จ ์ž‘์—…" +title: "โš™๏ธ[CHORE]: " +labels: "โš™๏ธchore" +assignees: '' + +--- + +## ๐Ÿ“Œ ์ž‘์—… ๊ฐœ์š” + + +- + +
+ +## โœ… ์ž‘์—… ํ•ญ๋ชฉ + +- [ ] +- [ ] + +
+ +## ๐Ÿ’ฌ ๊ธฐํƒ€ ์ฐธ๊ณ  ์‚ฌํ•ญ (์„ ํƒ) + + +- diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000..f0339ed --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,27 @@ +--- +name: "๐Ÿ“„ Documentation" +description: "๋ฌธ์„œํ™” ์ž‘์—…" +title: "๐Ÿ“„[DOCS]: " +labels: "๐Ÿ“ƒdocs" +assignees: '' + +--- + +## ๐Ÿ“Œ ๋ฌธ์„œ ๋‚ด์šฉ ๊ฐœ์š” + + +- + +
+ +## โœ… ์ž‘์—… ํ•ญ๋ชฉ + +- [ ] +- [ ] + +
+ +## ๐Ÿ’ฌ ๊ธฐํƒ€ ์ฐธ๊ณ  ์‚ฌํ•ญ (์„ ํƒ) + + +- \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 0000000..91bed0e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,27 @@ +--- +name: "โœจ Feature" +description: "์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ ๋ฐ ์ˆ˜์ •" +title: "โœจ[Feature]: " +labels: "โœจfeature" +assignees: '' + +--- + +## ๐Ÿ“Œ ๊ธฐ๋Šฅ ์„ค๋ช… + + +- + +
+ +## โœ… ๊ตฌํ˜„ํ•  ๊ธฐ๋Šฅ ๋ชฉ๋ก + +- [ ] +- [ ] + +
+ +## ๐Ÿ’ฌ ๊ธฐํƒ€ ์ฐธ๊ณ  ์‚ฌํ•ญ (์„ ํƒ) + + +- \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/refactor.md b/.github/ISSUE_TEMPLATE/refactor.md new file mode 100644 index 0000000..40e8a4b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/refactor.md @@ -0,0 +1,27 @@ +--- +name: "๐Ÿช„ Refactor" +description: "๊ธฐ๋Šฅ ๊ฐœ์„  ๋ฐ ๊ธฐ์กด ์ฝ”๋“œ ๋ฆฌํŒฉํ† ๋ง" +title: "๐Ÿช„[REFACTOR]: " +labels: "๐Ÿช„refactor" +assignees: '' + +--- + +## ๐Ÿ“Œ ๋ฆฌํŒฉํ† ๋ง ์„ค๋ช… + + +- + +
+ +## โœ… ์ž‘์—… ํ•ญ๋ชฉ + +- [ ] +- [ ] + +
+ +## ๐Ÿ’ฌ ๊ธฐํƒ€ ์ฐธ๊ณ  ์‚ฌํ•ญ (์„ ํƒ) + + +- \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..5e14901 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,23 @@ +## ๐Ÿ“Œ ์ž‘์—… ๋‚ด์šฉ ๋ฐ ํŠน์ด์‚ฌํ•ญ + +- + +
+ +## ๐ŸŒฑ ๊ด€๋ จ ์ด์Šˆ + + +- close # + +
+ +## ๐Ÿ” ์ฐธ๊ณ ์‚ฌํ•ญ(์„ ํƒ) + +- + +
+ +## ๐Ÿ“š ๊ธฐํƒ€(์„ ํƒ) + + +- \ No newline at end of file diff --git a/.github/workflows/develop_pull_request.yml b/.github/workflows/develop_pull_request.yml new file mode 100644 index 0000000..1cb5ddc --- /dev/null +++ b/.github/workflows/develop_pull_request.yml @@ -0,0 +1,49 @@ +name: develop pull request Check and Test + +on: + pull_request: + branches: [ "develop" ] + +jobs: + test: + runs-on: ubuntu-latest + env: + DB_NAME: ${{ secrets.DATABASE_NAME }} + DB_USERNAME: ${{ secrets.DATABASE_USERNAME }} + DB_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} + + strategy: + matrix: + java-version: [ 17 ] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ matrix.java-version }} + distribution: 'temurin' + + - name: Run MySQL with Docker + run: | + docker run -d \ + --name mysql \ + -e MYSQL_ROOT_PASSWORD=$DB_PASSWORD \ + -e MYSQL_DATABASE=$DB_NAME \ + -p 3306:3306 \ + mysql:8.0 + + - name: Run Redis with Docker + run: | + docker run -d \ + --name redis \ + -p 6379:6379 \ + redis:7.0 + + - name: Grant Execute Permission for Gradlew + run: chmod +x ./gradlew + + - name: Run Gradle Check + run: ./gradlew check diff --git a/.gitignore b/.gitignore index d221371..c93ca88 100644 --- a/.gitignore +++ b/.gitignore @@ -36,5 +36,8 @@ out/ ### VS Code ### .vscode/ +### +.DS_Store + ### ENV *.env \ No newline at end of file diff --git a/build.gradle b/build.gradle index 15d6eb9..13a8a26 100644 --- a/build.gradle +++ b/build.gradle @@ -34,10 +34,6 @@ dependencies { annotationProcessor 'org.projectlombok:lombok' runtimeOnly 'com.mysql:mysql-connector-j' - // Flyway (Database Migration Tools) - //implementation 'org.flywaydb:flyway-core' - //implementation 'org.flywaydb:flyway-mysql' - // Validation implementation 'org.springframework.boot:spring-boot-starter-validation' @@ -58,11 +54,6 @@ dependencies { // Redis implementation 'org.springframework.boot:spring-boot-starter-data-redis' - // AWS - //implementation 'software.amazon.awssdk:s3:2.20.140' // ์ตœ์‹  ๋ฒ„์ „ ํ™•์ธ ํ›„ ์ ์šฉ - //implementation 'software.amazon.awssdk:auth:2.20.140' // IAM ์ธ์ฆ ๊ด€๋ จ - //implementation 'software.amazon.awssdk:sts:2.20.140' // STS (IAM Role ์ธ์ฆ ํ•„์š”์‹œ) - // Firebase-admin implementation 'com.google.firebase:firebase-admin:9.2.0' diff --git a/src/main/java/com/ject/studytrip/StudytripApplication.java b/src/main/java/com/ject/studytrip/StudytripApplication.java index 1f5c011..c58013a 100644 --- a/src/main/java/com/ject/studytrip/StudytripApplication.java +++ b/src/main/java/com/ject/studytrip/StudytripApplication.java @@ -9,5 +9,4 @@ public class StudytripApplication { public static void main(String[] args) { SpringApplication.run(StudytripApplication.class, args); } - } diff --git a/src/main/resources/application-datasource.yml b/src/main/resources/application-datasource.yml index 56adcd7..a1ab59a 100644 --- a/src/main/resources/application-datasource.yml +++ b/src/main/resources/application-datasource.yml @@ -5,6 +5,6 @@ spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://${MYSQL_HOST:localhost}:${MYSQL_PORT:3306}/${DB_NAME:}?useSSL=false - username: ${MYSQL_USERNAME:} - password: ${MYSQL_PASSWORD:} \ No newline at end of file + url: jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:}?useSSL=false&allowPublicKeyRetrieval=true + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:} \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index e572e48..ab39ea0 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -2,3 +2,12 @@ spring: config: activate: on-profile: "dev" + + jpa: + hibernate: + ddl-auto: update + +logging: + level: + org.springframework.orm.jpa: DEBUG + org.springframework.transaction: DEBUG diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index 4757dd6..f4679f7 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -3,3 +3,18 @@ spring: activate: on-profile: "local" + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.MySQL8Dialect + defer-datasource-initialization: true + open-in-view: false + +logging: + level: + org.springframework.orm.jpa: DEBUG + org.springframework.transaction: DEBUG \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 622c895..940b53c 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -2,3 +2,7 @@ spring: config: activate: on-profile: "prod" + + jpa: + hibernate: + ddl-auto: none diff --git a/src/main/resources/application-security.yml b/src/main/resources/application-security.yml index ccab047..91cb1ff 100644 --- a/src/main/resources/application-security.yml +++ b/src/main/resources/application-security.yml @@ -2,3 +2,16 @@ spring: config: activate: on-profile: "security" + +jwt: + secret: ${JWT_SECRET:} + access-expiration-time: ${JWT_ACCESS_EXPIRATION_TIME:7200} + refresh-expiration-time: ${JWT_REFRESH_EXPIRATION_TIME:604800} + +oauth: + kakao: + client-id: ${KAKAO_CLIENT_ID:} + client-secret: ${KAKAO_CLIENT_SECRET:} + redirect-uri: ${KAKAO_REDIRECT_URI:} + token-uri: "https://kauth.kakao.com/oauth/token" + user-info-uri: "https://kapi.kakao.com/v2/user/me" \ No newline at end of file diff --git a/src/main/resources/application-storage.yml b/src/main/resources/application-storage.yml deleted file mode 100644 index 0182854..0000000 --- a/src/main/resources/application-storage.yml +++ /dev/null @@ -1,4 +0,0 @@ -spring: - config: - activate: - on-profile: "storage" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index a6b501b..47b06ae 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,8 +1,19 @@ spring: profiles: - active: ${SPRING_PROFILES_ACTIVE:local} include: - datasource - redis - - storage - security + +springdoc: + default-consumes-media-type: application/json;charset=UTF-8 + default-produces-media-type: application/json;charset=UTF-8 + swagger-ui: + path: /swagger-ui + disable-swagger-default-url: true + display-request-duration: true + tags-sorter: alpha + operations-sorter: alpha + syntax-highlight: + theme: none + urls-primary-name: StudyTrip API DOCS diff --git a/src/test/java/com/ject/studytrip/StudytripApplicationTests.java b/src/test/java/com/ject/studytrip/StudytripApplicationTests.java index 4e43e9a..4d574f5 100644 --- a/src/test/java/com/ject/studytrip/StudytripApplicationTests.java +++ b/src/test/java/com/ject/studytrip/StudytripApplicationTests.java @@ -1,13 +1,18 @@ package com.ject.studytrip; import org.junit.jupiter.api.Test; +import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +@ActiveProfiles("test") +@AutoConfigureTestDatabase( + replace = AutoConfigureTestDatabase.Replace.NONE) // ํ…Œ์ŠคํŠธ ์‹œ ๋‚ด์žฅ๋œ ์ธ๋ฉ”๋ชจ๋ฆฌ DB๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š”๋‹ค๋Š” ์„ค์ • @SpringBootTest class StudytripApplicationTests { @Test void contextLoads() { + System.out.println("๐ŸŒ DB_HOST = " + System.getenv("DB_HOST")); } - } diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index c77a121..85d0292 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -2,3 +2,12 @@ spring: config: activate: on-profile: "test" + + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + format_sql: true + dialect: org.hibernate.dialect.MySQL8Dialect