Skip to content

Commit ff169f7

Browse files
Updates Spring Boot and Angular versions and rebuilds the basic architecture of the application components.
2 parents 7ede33b + fd6798c commit ff169f7

File tree

625 files changed

+16244
-319547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

625 files changed

+16244
-319547
lines changed

.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
SERVER_PORT=8080
22

33
MYSQL_ROOT_PASSWORD=T4cwGK3q5NdR3vMz
4-
MYSQL_DATABASE=vscode4teach
4+
MYSQL_DATABASE=vscode4teaching
55

6-
SPRING_DATASOURCE_USERNAME=vscode4teach
6+
SPRING_DATASOURCE_USERNAME=vscode4teaching
77
SPRING_DATASOURCE_PASSWORD=AvScnGQp5e4GHnd
8-
SPRING_DATASOURCE_URL=jdbc:mysql://db/vscode4teach?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
8+
SPRING_DATASOURCE_URL=jdbc:mysql://db/vscode4teaching?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
99

10-
JWT_SECRET=vscode4teaching
10+
JWT_SECRET=cUYw1eSNM6eyhcY2pg6G6Hvf5gHkhdEFr76bbP89dld6qdjfAktQNGqIE4fvKH8kHvf5gHkhdEFr76bbHvf5gHkhdEFr76bb
1111

1212
V4T_FILEDIRECTORY=/app/v4t_courses
1313

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# VSCode4Teaching
22
**Developer documentation on the Continuous Integration, Delivery and Deployment (*CI/CD*) system of this project**
33

4-
This project is configured with a continuous integration, deployment and delivery system through [GitHub Actions](https://github.com/features/actions). This system includes a single workflow that comprises both server and web application ([`server.ci.yml`](server.ci.yml)).
4+
This project is configured with a continuous integration, deployment and delivery system through [GitHub Actions](https://github.com/features/actions). This system includes a single workflow that comprises both server and web application ([`ci.yml`](ci.yml)).
55

66
### Detailed description of declared jobs
77
The aforementioned files define the jobs that will be executed sequentially based on the type of changes registered in the repository. These jobs are:

.github/workflows/server.ci.yml renamed to .github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Server pipeline"
1+
name: "VSCode4Teaching pipeline"
22

33
on:
44
push:
@@ -17,14 +17,14 @@ jobs:
1717
runs-on: ubuntu-latest
1818
defaults:
1919
run:
20-
working-directory: ./vscode4teaching-server
20+
working-directory: ./backend
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/checkout@v4
2424
- name: Set up Java version
2525
uses: actions/setup-java@v4
2626
with:
27-
java-version: 11
27+
java-version: 21
2828
distribution: temurin
2929
- name: Test
3030
run: ./mvnw clean dependency:resolve test
@@ -41,7 +41,7 @@ jobs:
4141
run: |
4242
VERSION=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)
4343
echo VERSION=$VERSION >> $GITHUB_ENV
44-
working-directory: ./vscode4teaching-server
44+
working-directory: ./backend
4545
- name: Build Docker image
4646
run: |
4747
env | grep DOCKER

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Step 1: Compilation of Angular frontend
22
# It will be embedded as a static resource into Spring Boot backend
3-
FROM node:18 AS angular
4-
COPY vscode4teaching-webapp /usr/src/app
3+
FROM node:22 AS angular
4+
COPY frontend /usr/src/app
55
WORKDIR /usr/src/app
66
RUN ["npm", "install"]
77
RUN ["npm", "run", "build"]
88

99
# Step 2: Compilation of Maven project (generation of JAR)
10-
FROM maven:3.9.7-eclipse-temurin-11 AS builder
11-
COPY vscode4teaching-server /data
12-
COPY --from=angular /usr/src/app/dist/vscode4teaching /data/src/main/resources/static/
10+
FROM maven:3.9.9-eclipse-temurin-21 AS builder
11+
COPY backend /data
12+
COPY --from=angular /usr/src/app/dist/vscode4teaching/browser /data/src/main/resources/static/
1313
WORKDIR /data
1414
RUN ["mvn", "clean", "package"]
1515

1616
# Step 3: Generation of Docker image using the JAR previously built
17-
FROM eclipse-temurin:11
18-
COPY --from=builder /data/target/vscode4teaching-server-*.jar ./app/vscode4teaching-server.jar
17+
FROM eclipse-temurin:21.0.5_11-jre
18+
COPY --from=builder /data/target/vscode4teaching-*.jar ./app/vscode4teaching-server.jar
1919
EXPOSE 8080
2020
ENTRYPOINT [ "java", "-jar", "./app/vscode4teaching-server.jar" ]

backend/.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/mvnw text eol=lf
2+
*.cmd text eol=crlf

vscode4teaching-server/.gitignore renamed to backend/.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
HELP.md
22
target/
33
!.mvn/wrapper/maven-wrapper.jar
4-
!**/src/main/**
5-
!**/src/test/**
4+
!**/src/main/**/target/
5+
!**/src/test/**/target/
66
**/src/main/resources/static
77

88
### STS ###
@@ -27,6 +27,8 @@ target/
2727
/nbdist/
2828
/.nb-gradle/
2929
build/
30+
!**/src/main/**/build/
31+
!**/src/test/**/build/
3032

3133
### VS Code ###
3234
.vscode/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip

backend/mvnw

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,259 @@
1+
#!/bin/sh
2+
# ----------------------------------------------------------------------------
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
# ----------------------------------------------------------------------------
20+
21+
# ----------------------------------------------------------------------------
22+
# Apache Maven Wrapper startup batch script, version 3.3.2
23+
#
24+
# Optional ENV vars
25+
# -----------------
26+
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
27+
# MVNW_REPOURL - repo url base for downloading maven distribution
28+
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
29+
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
30+
# ----------------------------------------------------------------------------
31+
32+
set -euf
33+
[ "${MVNW_VERBOSE-}" != debug ] || set -x
34+
35+
# OS specific support.
36+
native_path() { printf %s\\n "$1"; }
37+
case "$(uname)" in
38+
CYGWIN* | MINGW*)
39+
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
40+
native_path() { cygpath --path --windows "$1"; }
41+
;;
42+
esac
43+
44+
# set JAVACMD and JAVACCMD
45+
set_java_home() {
46+
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
47+
if [ -n "${JAVA_HOME-}" ]; then
48+
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
49+
# IBM's JDK on AIX uses strange locations for the executables
50+
JAVACMD="$JAVA_HOME/jre/sh/java"
51+
JAVACCMD="$JAVA_HOME/jre/sh/javac"
52+
else
53+
JAVACMD="$JAVA_HOME/bin/java"
54+
JAVACCMD="$JAVA_HOME/bin/javac"
55+
56+
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
57+
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
58+
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
59+
return 1
60+
fi
61+
fi
62+
else
63+
JAVACMD="$(
64+
'set' +e
65+
'unset' -f command 2>/dev/null
66+
'command' -v java
67+
)" || :
68+
JAVACCMD="$(
69+
'set' +e
70+
'unset' -f command 2>/dev/null
71+
'command' -v javac
72+
)" || :
73+
74+
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
75+
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
76+
return 1
77+
fi
78+
fi
79+
}
80+
81+
# hash string like Java String::hashCode
82+
hash_string() {
83+
str="${1:-}" h=0
84+
while [ -n "$str" ]; do
85+
char="${str%"${str#?}"}"
86+
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
87+
str="${str#?}"
88+
done
89+
printf %x\\n $h
90+
}
91+
92+
verbose() { :; }
93+
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
94+
95+
die() {
96+
printf %s\\n "$1" >&2
97+
exit 1
98+
}
99+
100+
trim() {
101+
# MWRAPPER-139:
102+
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
103+
# Needed for removing poorly interpreted newline sequences when running in more
104+
# exotic environments such as mingw bash on Windows.
105+
printf "%s" "${1}" | tr -d '[:space:]'
106+
}
107+
108+
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
109+
while IFS="=" read -r key value; do
110+
case "${key-}" in
111+
distributionUrl) distributionUrl=$(trim "${value-}") ;;
112+
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
113+
esac
114+
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
115+
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
116+
117+
case "${distributionUrl##*/}" in
118+
maven-mvnd-*bin.*)
119+
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
120+
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
121+
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
122+
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
123+
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
124+
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
125+
*)
126+
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
127+
distributionPlatform=linux-amd64
128+
;;
129+
esac
130+
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
131+
;;
132+
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
133+
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
134+
esac
135+
136+
# apply MVNW_REPOURL and calculate MAVEN_HOME
137+
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
138+
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
139+
distributionUrlName="${distributionUrl##*/}"
140+
distributionUrlNameMain="${distributionUrlName%.*}"
141+
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
142+
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
143+
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
144+
145+
exec_maven() {
146+
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
147+
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
148+
}
149+
150+
if [ -d "$MAVEN_HOME" ]; then
151+
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
152+
exec_maven "$@"
153+
fi
154+
155+
case "${distributionUrl-}" in
156+
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
157+
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
158+
esac
159+
160+
# prepare tmp dir
161+
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
162+
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
163+
trap clean HUP INT TERM EXIT
164+
else
165+
die "cannot create temp dir"
166+
fi
167+
168+
mkdir -p -- "${MAVEN_HOME%/*}"
169+
170+
# Download and Install Apache Maven
171+
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
172+
verbose "Downloading from: $distributionUrl"
173+
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
174+
175+
# select .zip or .tar.gz
176+
if ! command -v unzip >/dev/null; then
177+
distributionUrl="${distributionUrl%.zip}.tar.gz"
178+
distributionUrlName="${distributionUrl##*/}"
179+
fi
180+
181+
# verbose opt
182+
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
183+
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
184+
185+
# normalize http auth
186+
case "${MVNW_PASSWORD:+has-password}" in
187+
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
188+
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
189+
esac
190+
191+
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
192+
verbose "Found wget ... using wget"
193+
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
194+
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
195+
verbose "Found curl ... using curl"
196+
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
197+
elif set_java_home; then
198+
verbose "Falling back to use Java to download"
199+
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
200+
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
201+
cat >"$javaSource" <<-END
202+
public class Downloader extends java.net.Authenticator
203+
{
204+
protected java.net.PasswordAuthentication getPasswordAuthentication()
205+
{
206+
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
207+
}
208+
public static void main( String[] args ) throws Exception
209+
{
210+
setDefault( new Downloader() );
211+
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
212+
}
213+
}
214+
END
215+
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
216+
verbose " - Compiling Downloader.java ..."
217+
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
218+
verbose " - Running Downloader.java ..."
219+
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
220+
fi
221+
222+
# If specified, validate the SHA-256 sum of the Maven distribution zip file
223+
if [ -n "${distributionSha256Sum-}" ]; then
224+
distributionSha256Result=false
225+
if [ "$MVN_CMD" = mvnd.sh ]; then
226+
echo "Checksum validation is not supported for maven-mvnd." >&2
227+
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
228+
exit 1
229+
elif command -v sha256sum >/dev/null; then
230+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
231+
distributionSha256Result=true
232+
fi
233+
elif command -v shasum >/dev/null; then
234+
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
235+
distributionSha256Result=true
236+
fi
237+
else
238+
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
239+
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
240+
exit 1
241+
fi
242+
if [ $distributionSha256Result = false ]; then
243+
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
244+
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
245+
exit 1
246+
fi
247+
fi
248+
249+
# unzip and move
250+
if command -v unzip >/dev/null; then
251+
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
252+
else
253+
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
254+
fi
255+
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
256+
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
257+
258+
clean || :
259+
exec_maven "$@"

0 commit comments

Comments
 (0)