Skip to content

Commit

Permalink
repository migration
Browse files Browse the repository at this point in the history
  • Loading branch information
sangminleee committed Oct 21, 2024
0 parents commit 6001b92
Show file tree
Hide file tree
Showing 365 changed files with 16,458 additions and 0 deletions.
194 changes: 194 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,macos,gradle,kotlin,java
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,macos,gradle,kotlin,java

### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### Java ###
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*

### Kotlin ###
# Compiled class file

# Log file

# BlueJ files

# Mobile Tools for Java (J2ME)

# Package Files #

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Gradle ###
.gradle
**/build/
!src/**/build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

### Gradle Patch ###
# Java heap dump
*.hprof

# End of https://www.toptal.com/developers/gitignore/api/intellij+all,macos,gradle,kotlin,java
docker/data
src/main/resources/application.yml

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# devooks-backend
112 changes: 112 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "3.2.3"
id("io.spring.dependency-management") version "1.1.4"
kotlin("plugin.serialization") version "1.8.0"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
id("com.google.osdetector") version "1.7.0"
}

group = "com.devooks"
version = "0.0.1"

java {
sourceCompatibility = JavaVersion.VERSION_17
}

repositories {
mavenCentral()
}

dependencies {
// spring
implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
if (osdetector.arch.equals("aarch_64")) {
implementation("io.netty:netty-resolver-dns-native-macos:4.1.89.Final:osx-aarch_64")
}
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor:3.0.4")

// r2dbc
implementation("org.springframework.boot:spring-boot-starter-data-r2dbc:3.0.4")
implementation("org.postgresql:r2dbc-postgresql:1.0.1.RELEASE")
runtimeOnly("org.postgresql:postgresql")

// feign client
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
implementation("org.springframework.cloud:spring-cloud-starter-loadbalancer")

// kotlin
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")

// validation
implementation("org.hibernate.validator:hibernate-validator:8.0.0.Final")

// jwt
val jwtVersion = "0.11.5"
implementation("io.jsonwebtoken:jjwt-api:$jwtVersion")
runtimeOnly("io.jsonwebtoken:jjwt-impl:$jwtVersion")
runtimeOnly("io.jsonwebtoken:jjwt-jackson:$jwtVersion")

// pdf
implementation("org.apache.pdfbox:pdfbox:2.0.27")

// test
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.springframework.boot:spring-boot-starter-test")

// test container
val testContainerVersion = "1.19.4"
testImplementation("org.testcontainers:testcontainers:$testContainerVersion")
testImplementation("org.testcontainers:r2dbc:$testContainerVersion")
testImplementation("org.testcontainers:postgresql:$testContainerVersion")
testImplementation("org.testcontainers:junit-jupiter:$testContainerVersion")

// swagger
implementation("org.springdoc:springdoc-openapi-starter-webflux-ui:2.1.0")

// json
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")

// coroutines test
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0-RC")
}

val springCloudVersion by extra("2023.0.0")
// feign client
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
}
}


tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

tasks.register("copyJar", Copy::class) {
dependsOn("bootJar")
val jarFile = "devooks-0.0.1.jar"
from("build/libs")
into(file("docker"))
include(jarFile)
}

tasks.named("build") {
dependsOn("copyJar")
}
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM openjdk:17-jdk-slim
WORKDIR /app
COPY ./devooks-1.0.0.jar app.jar
CMD ["java", "-jar", "app.jar"]
27 changes: 27 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.9'

services:
devooks-database:
image: postgres:14
container_name: devooks-database
environment:
POSTGRES_DB: "devooksdb"
POSTGRES_USER: "devooks"
POSTGRES_PASSWORD: "devooks"
volumes:
- ./data:/var/lib/postgresql/data
ports:
- "35432:5432"
devooks-application:
image: devooks-backend-app:latest
build:
context: .
container_name: devooks-application
depends_on:
- devooks-database
environment:
- DATABASE_URL=r2dbc:postgresql://devooks-database:5432/devooksdb
volumes:
- ./static:/app/static
ports:
- "80:8081"
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.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 6001b92

Please sign in to comment.