Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 57 additions & 13 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,83 @@ jobs:
rsync -av --delete _book/src/pages/ fullstack-book/src/pages/ || true
rsync -av --delete _book/static/ fullstack-book/static/ || true

# detect build system (backend path adjust here if you rename)
- name: Detect backend build system
id: detect
run: |
echo "backend_dir=$BACKEND_DIR" >> $GITHUB_OUTPUT
if [ -f "$BACKEND_DIR/pom.xml" ]; then
echo "build=maven" >> $GITHUB_OUTPUT
elif [ -f "$BACKEND_DIR/gradlew" ]; then
echo "build=gradle" >> $GITHUB_OUTPUT
elif [ -f "$BACKEND_DIR/build.gradle.kts" ] || [ -f "$BACKEND_DIR/build.gradle" ]; then
echo "build=gradle" >> $GITHUB_OUTPUT
else
echo "build=none" >> $GITHUB_OUTPUT
fi

# -------------- MAVEN -------------------------
# Cache Maven deps to speed up builds
- name: Cache Maven packages
if: steps.detect.outputs.build == 'maven'
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-

# build Javadoc
# Maven:
- name: Set up JDK (for Javadoc)
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- name: Build Javadoc (Maven)
if: steps.detect.outputs.build == 'maven'
working-directory: ${{ env.BACKEND_DIR }}
run: mvn -q -DskipTests javadoc:javadoc
# For later(Part 3) when we migrate to gradle
# - name: Build Javadoc (Gradle)
# working-directory: ${{ env.BACKEND_DIR }}
# run: |
# ./gradlew -q clean javadoc

# Copy Javadoc into Docusaurus static path
- name: Copy Javadoc into site

# -------------- GRADLE -------------------------
# Cache Gradle deps to speed up builds
- name: Cache Gradle
if: steps.detect.outputs.build == 'gradle'
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Make gradlew executable
if: steps.detect.outputs.build == 'gradle'
working-directory: ${{ steps.detect.outputs.backend_dir }}
run: chmod +x gradlew

- name: Build Javadoc (Gradle)
if: steps.detect.outputs.build == 'gradle'
working-directory: ${{ steps.detect.outputs.backend_dir }}
run: ./gradlew -q clean javadoc

# ---------- Copy Javadoc into site ----------
- name: Copy Javadoc into site (Maven)
if: steps.detect.outputs.build == 'maven'
run: |
mkdir -p fullstack-book/static/javadoc
rsync -av --delete ${{ env.BACKEND_DIR }}/target/site/apidocs/ fullstack-book/static/javadoc/ || true
# For later(Part 3) when we migrate to gradle
# rsync -av --delete ${{ env.BACKEND_DIR }}/build/docs/javadoc/ fullstack-book/static/javadoc/ || true
rsync -av --delete "${{ steps.detect.outputs.backend_dir }}/target/site/apidocs/" fullstack-book/static/javadoc/ || true

- name: Copy Javadoc into site (Gradle)
if: steps.detect.outputs.build == 'gradle'
run: |
mkdir -p fullstack-book/static/javadoc
rsync -av --delete "${{ steps.detect.outputs.backend_dir }}/build/docs/javadoc/" fullstack-book/static/javadoc/ || true

- name: Fail if no backend build system found
if: steps.detect.outputs.build == 'none'
run: |
echo "No Maven/Gradle build found in ${{ steps.detect.outputs.backend_dir }}"; exit 1

# ---------- Docusaurus ----------
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
Binary file added backend/.gradle/8.14.2/checksums/checksums.lock
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added backend/.gradle/8.14.2/expanded/expanded.lock
Binary file not shown.
Binary file not shown.
Binary file added backend/.gradle/8.14.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added backend/.gradle/8.14.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
2 changes: 2 additions & 0 deletions backend/.gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Tue Oct 07 10:58:40 CEST 2025
gradle.version=8.14.2
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3e471eb0-255f-45cb-b1d7-d44392ba4fb�
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
��4ﮂ>;$k����
>��
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/����u�4��;>ށz�I�l֎����?D�3[��Fl&�N2�����~+JM:��$��1�`�
�=�{lm-�z�7Y�bj��c�s��H��A���f��Y��hW"��}@1��bē���ϬV�?�
���:��qnjrn��H�pࡘ���'I��s��?M�L�l��Ub/�U"w�,��e�S��������kZ� `��t��6�E�F�����t����?=����I^\�^|����Z�Ђ�!��*d�e� D�qJ-��Z�y�WD*t�%�� C��Z\{f�Y%�…�^��$?��wi.���2�9ͨF��Kr�3�&#��ȸ>3�+bw�\fx5�eU�ox�����H��d��[ x/��^s�������$�o��ھZƸ�;�X�W�c��'���<�It�n� �{�WNܡ VY�`s&^�f�W5�:%�ۖ ���<A��a���"��O4��'YYh?2��+��*4�ZwH�-��3ݽ��j�TnE·e��Nv��&z�N���n��YKZ��r�P�%H�Q�4F&��`��--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9d4fde0e-8ec1-4a74-b114-6d5c09ec44d�
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
db5eb24a-d5f4-4440-b6b7-f1c9656bd94�
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p�{�D?� b<�Q������E
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��XFE�l��3I�U24�zB!v`
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
w)���C��� ��w V�
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added backend/.gradle/file-system.probe
Binary file not shown.
Empty file.
19 changes: 0 additions & 19 deletions backend/.mvn/wrapper/maven-wrapper.properties

This file was deleted.

68 changes: 68 additions & 0 deletions backend/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
plugins {
id("org.springframework.boot") version "3.2.5"
id("io.spring.dependency-management") version "1.1.4"
id("java")
id("jacoco")
}

group = "com.example"
version = "0.0.1-SNAPSHOT"

java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } }

repositories { mavenCentral() }

dependencies {
// --- Chapter 1 parity ---
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0")

implementation("org.mapstruct:mapstruct:1.5.5.Final")
annotationProcessor("org.mapstruct:mapstruct-processor:1.5.5.Final")

compileOnly("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.30")

annotationProcessor("org.projectlombok:lombok-mapstruct-binding:0.2.0")

runtimeOnly("com.mysql:mysql-connector-j")
runtimeOnly("org.springframework.boot:spring-boot-devtools")
implementation("org.springframework.boot:spring-boot-starter-actuator")
runtimeOnly("com.h2database:h2")

testImplementation("org.springframework.boot:spring-boot-starter-test")

// --- Chapter 3 additions ---
//implementation("org.springframework.boot:spring-boot-starter-security")
//implementation("io.jsonwebtoken:jjwt-api:0.11.5")
//runtimeOnly("io.jsonwebtoken:jjwt-impl:0.11.5")
//runtimeOnly("io.jsonwebtoken:jjwt-jackson:0.11.5")

//implementation("org.springframework.boot:spring-boot-starter-cache")
//implementation("org.springframework.boot:spring-boot-starter-data-redis")
//implementation("io.micrometer:micrometer-registry-prometheus")
//implementation("com.github.vladimir-bukhtoyarov:bucket4j-core:8.10.1")
//implementation("com.bucket4j:bucket4j_jdk17-core:8.15.0")
//implementation("org.flywaydb:flyway-core")

//testImplementation(platform("org.testcontainers:testcontainers-bom:1.20.1"))
//testImplementation("org.testcontainers:junit-jupiter")
//testImplementation("org.testcontainers:postgresql")
}

tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
dependsOn(tasks.test)
reports { xml.required.set(true); html.required.set(true); csv.required.set(false) }
}

tasks.withType<JavaCompile> {
options.compilerArgs.add("-Amapstruct.defaultComponentModel=spring")
}
7 changes: 7 additions & 0 deletions backend/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

org.gradle.configuration-cache=true
org.gradle.parallel=true
org.gradle.caching=true

26 changes: 26 additions & 0 deletions backend/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
com-h2database-h2 = "2.3.232"
org-apache-commons-commons-lang3 = "3.18.0"
org-mapstruct-mapstruct = "1.5.5.Final"
org-projectlombok-lombok = "1.18.38"
org-springdoc-springdoc-openapi-starter-webmvc-ui = "2.8.9"
org-springframework-boot-spring-boot-starter = "3.5.4"
org-springframework-boot-spring-boot-starter-data-jpa = "3.5.4"
org-springframework-boot-spring-boot-starter-test = "3.5.4"
org-springframework-boot-spring-boot-starter-validation = "3.5.4"
org-springframework-boot-spring-boot-starter-web = "3.5.4"

[libraries]
com-h2database-h2 = { module = "com.h2database:h2", version.ref = "com-h2database-h2" }
org-apache-commons-commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "org-apache-commons-commons-lang3" }
org-mapstruct-mapstruct = { module = "org.mapstruct:mapstruct", version.ref = "org-mapstruct-mapstruct" }
org-projectlombok-lombok = { module = "org.projectlombok:lombok", version.ref = "org-projectlombok-lombok" }
org-springdoc-springdoc-openapi-starter-webmvc-ui = { module = "org.springdoc:springdoc-openapi-starter-webmvc-ui", version.ref = "org-springdoc-springdoc-openapi-starter-webmvc-ui" }
org-springframework-boot-spring-boot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "org-springframework-boot-spring-boot-starter" }
org-springframework-boot-spring-boot-starter-data-jpa = { module = "org.springframework.boot:spring-boot-starter-data-jpa", version.ref = "org-springframework-boot-spring-boot-starter-data-jpa" }
org-springframework-boot-spring-boot-starter-test = { module = "org.springframework.boot:spring-boot-starter-test", version.ref = "org-springframework-boot-spring-boot-starter-test" }
org-springframework-boot-spring-boot-starter-validation = { module = "org.springframework.boot:spring-boot-starter-validation", version.ref = "org-springframework-boot-spring-boot-starter-validation" }
org-springframework-boot-spring-boot-starter-web = { module = "org.springframework.boot:spring-boot-starter-web", version.ref = "org-springframework-boot-spring-boot-starter-web" }
Binary file added backend/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions backend/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.14.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading