From 7ce01dff0baf43166252bc2353179ce8da3c0c36 Mon Sep 17 00:00:00 2001 From: kasun Date: Wed, 20 May 2026 04:38:46 +0200 Subject: [PATCH 1/6] changed hibernate schema creation for test db --- backend/src/test/resources/application-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/test/resources/application-test.yaml b/backend/src/test/resources/application-test.yaml index b415c9d..553dff6 100644 --- a/backend/src/test/resources/application-test.yaml +++ b/backend/src/test/resources/application-test.yaml @@ -1,9 +1,9 @@ spring: datasource: - url : ${DB_TEST_URL} + url: ${DB_TEST_URL} username: ${DB_USERNAME} password: ${DB_PASSWORD} driver-class-name: ${PG_DRIVER_CLASS_NAME} jpa: hibernate: - ddl-auto: create-drop \ No newline at end of file + ddl-auto: update From 856fa9e166c5f5dabd7145ae04e39a81d207f6d0 Mon Sep 17 00:00:00 2001 From: kasun Date: Wed, 20 May 2026 04:39:29 +0200 Subject: [PATCH 2/6] updated local postgresql database and updated doc for pgvector db creation --- docs/02-Preparation/02-Spring-Boot-setup.md | 55 ++++++++++++++------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/docs/02-Preparation/02-Spring-Boot-setup.md b/docs/02-Preparation/02-Spring-Boot-setup.md index 90cb819..9659c0e 100644 --- a/docs/02-Preparation/02-Spring-Boot-setup.md +++ b/docs/02-Preparation/02-Spring-Boot-setup.md @@ -138,7 +138,7 @@ spring: ``` -Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. The Docker Compose file will look something like this: +The Docker Compose file for code-server will look something like this: ``` --- @@ -163,26 +163,43 @@ services: - 8124:8080 - 5173:5173 restart: unless-stopped +``` - vaessl-db: - image: pgvector/pgvector:pg18 - container_name: vaessl-db - environment: - - POSTGRES_DB=vaessl - - POSTGRES_USER=user - - POSTGRES_PASSWORD=pw - ports: - - 5433:5432 +Note that I'm using my own locally hosted PostgreSQL instances for the main and test database. Just add databases via SQL or PgAdmin and install the pgvector extension to each database manually. There is an offical ready-made pgvector docker image but if you already host a PostGreSQL database you need to add the extension yourself. - vassal-test-db: - image: pgvector/pgvector:pg18 - container_name: vassal-test-db - environment: - - POSTGRES_DB=vassal_test - - POSTGRES_USER=user - - POSTGRES_PASSWORD=pw - ports: - - 5434:5432 +Check the name of your PostGreSQL container: +``` +docker ps +``` + +Enter your container via bash: + +``` +docker exec -it 876fb382969f bash +``` +Before working on your database backup your databases: +``` +su - postgres -c "pg_dumpall > /tmp/backup200526.sql" + +#exit the container and copy the backup file to local file system +docker cp 876fb382969f:/tmp/backup200526.sql . +``` + +Install dependencies, build and install pgvector: +apt-get update +apt-get install -y build-essential git postgresql-server-dev-all +``` +git clone https://github.com/pgvector/pgvector.git +cd pgvector +make +make install +docker restart 876fb382969f +``` +Enter PostGreSQL container and create pgvector extension for each databse: +``` +docker exec -it psql -h localhost -U -d + +CREATE EXTENSION vector; ``` # Appendix: Additional config for developing in Code-Server From f3fe9901c58a0042a44f8503c1fb46c3a0be4a79 Mon Sep 17 00:00:00 2001 From: Kasun Jayatilaka <1+kasun@noreply.localhost> Date: Wed, 20 May 2026 04:43:51 +0200 Subject: [PATCH 3/6] changed doc title --- ...pring-Boot-setup.md => 02-Spring-Boot-and-database-setup.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename docs/02-Preparation/{02-Spring-Boot-setup.md => 02-Spring-Boot-and-database-setup.md} (99%) diff --git a/docs/02-Preparation/02-Spring-Boot-setup.md b/docs/02-Preparation/02-Spring-Boot-and-database-setup.md similarity index 99% rename from docs/02-Preparation/02-Spring-Boot-setup.md rename to docs/02-Preparation/02-Spring-Boot-and-database-setup.md index 9659c0e..3b00f95 100644 --- a/docs/02-Preparation/02-Spring-Boot-setup.md +++ b/docs/02-Preparation/02-Spring-Boot-and-database-setup.md @@ -1,4 +1,4 @@ -**Vaessl: Spring Boot setup** +**Vaessl: Spring Boot and database setup** This app will use the current latest version 4.0.4 of Spring Boot and the latest OpenJDK 25 LTS. From 77bc8b996ba77eda4ab75783997ec14743a46373 Mon Sep 17 00:00:00 2001 From: Kasun Jayatilaka <1+kasun@noreply.localhost> Date: Mon, 1 Jun 2026 12:59:43 +0200 Subject: [PATCH 4/6] Update docs/02-Preparation/01-code-server-adjustments.md --- docs/02-Preparation/01-code-server-adjustments.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/02-Preparation/01-code-server-adjustments.md b/docs/02-Preparation/01-code-server-adjustments.md index 30fe462..2c56120 100644 --- a/docs/02-Preparation/01-code-server-adjustments.md +++ b/docs/02-Preparation/01-code-server-adjustments.md @@ -36,8 +36,6 @@ Now deploy the docker-compose and check all the configurations: ``` java --version -mvn --version npm --version -yarn --version nodejs --version ``` \ No newline at end of file From dbf7a9c50db72221eef45401e6bef8d1ea4cb98d Mon Sep 17 00:00:00 2001 From: kasun Date: Tue, 23 Jun 2026 20:33:07 +0200 Subject: [PATCH 5/6] updated spring versions --- backend/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 9018d84..4560b98 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -1,6 +1,6 @@ plugins { java - id("org.springframework.boot") version "4.0.6" + id("org.springframework.boot") version "4.1.0" id("io.spring.dependency-management") version "1.1.7" } @@ -23,7 +23,7 @@ repositories { mavenCentral() } -extra["springAiVersion"] = "2.0.0-M3" +extra["springAiVersion"] = "2.0.0" dependencies { implementation("org.springframework.boot:spring-boot-starter-data-jpa") From fad016cdaf40fa2fc4319a3185cff051dd18e67d Mon Sep 17 00:00:00 2001 From: kasun Date: Tue, 23 Jun 2026 20:33:19 +0200 Subject: [PATCH 6/6] removed unnecessary annotation --- .../java/com/vaessl/app/connection/ConnectionRepository.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/backend/src/main/java/com/vaessl/app/connection/ConnectionRepository.java b/backend/src/main/java/com/vaessl/app/connection/ConnectionRepository.java index 880f567..f25d437 100644 --- a/backend/src/main/java/com/vaessl/app/connection/ConnectionRepository.java +++ b/backend/src/main/java/com/vaessl/app/connection/ConnectionRepository.java @@ -1,9 +1,7 @@ package com.vaessl.app.connection; import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.stereotype.Repository; -@Repository public interface ConnectionRepository extends JpaRepository { ConnectionEntity findByAppUrlAndUsername(String appUrl, String username);