diff --git a/.dev/remove-mongo-volume.sh b/.dev/remove-mongo-volume.sh new file mode 100755 index 0000000..7549106 --- /dev/null +++ b/.dev/remove-mongo-volume.sh @@ -0,0 +1,6 @@ +echo "Really delete all flashcards data - including user data ? [y/n]" && read choice +[[ $choice = "y" ]] || exit; + +echo "Deleting container and volume ..." +docker ps -a --format '{{.Names}}' | grep '^flashcards' | xargs docker rm -f +docker volume ls -q --filter name=flashcards | xargs docker volume rm diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..6553990 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 4447715..34eaad9 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -21,9 +21,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' diff --git a/.gitignore b/.gitignore index 63cdd27..460e0ef 100644 --- a/.gitignore +++ b/.gitignore @@ -9,10 +9,10 @@ out/ *.p12 ### IntelliJ IDEA ### -.idea/modules.xml .idea/libraries/ .idea/sonarlint/ -!.idea/compiler.xml +.idea/modules/ +.idea/*.xml ### Mac OS ### .DS_Store diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index e40a389..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 3a9a7cd..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index fdc392f..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml deleted file mode 100644 index 966d5f5..0000000 --- a/.idea/jpa-buddy.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index e63ec06..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations/FlashcardsApplication.xml b/.idea/runConfigurations/FlashcardsApplication.xml new file mode 100644 index 0000000..60c2f36 --- /dev/null +++ b/.idea/runConfigurations/FlashcardsApplication.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/README.md b/README.md index e72b4dc..d92e8e0 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,27 @@ Project idea came up in the Hyperskill community team and will be realized by this team. +## Usage + +### Run the app +To run the application including startup of MongoDB container, use the stored Run configuration in IntelliJ IDEA. +You can transfer it to the Service tool window for convenience via Add Service -> Run configuration -> Spring. + +Alternatively run the following command: + +```shell +./gradlew bootRun +``` +### Purge docker resources (mongo-data volume and mongo container) +Take care, running this script deletes all persistent data of the mongo container. +```shell +.dev/remove-mongo-volume.sh +``` + ## Technology / External Libraries - Java 21 - Spring Boot 3.2.1 -- Support for Native image on GraalVM - Mongo DB via docker-compose - Vue 3 SPA-Frontend using component framework Vuetify 3 - Packaging with Vite @@ -14,6 +30,8 @@ Project idea came up in the Hyperskill community team and will be realized by th - Testcontainers - Gradle 8.5 +[//]: # (- Support for Native image on GraalVM) + ## Program description The application represents a digital flashcard app, that allows to create, store and retrieve flashcards via REST-endpoints. diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b4b581b..f68fecd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,5 @@ [versions] -spring-boot = "3.2.0" +spring-boot = "3.2.1" spring-dependency-management = "1.1.4" -graalvm-buildtools = "0.9.28" node-gradle = "7.0.1" -node-js = "21.5.0" \ No newline at end of file +node-js = "21.5.0" diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 5d3a9ed..db2ed6b 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -1,8 +1,9 @@ +import org.springframework.boot.gradle.tasks.run.BootRun + plugins { application id("org.springframework.boot") version libs.versions.spring.boot id("io.spring.dependency-management") version libs.versions.spring.dependency.management - id("org.graalvm.buildtools.native") version libs.versions.graalvm.buildtools } group = "org.hyperskill.community" @@ -43,6 +44,10 @@ dependencies { testImplementation("org.testcontainers:mongodb") } +tasks.withType { + workingDir = rootProject.projectDir +} + tasks.withType { useJUnitPlatform() }