From 0ffde21b0337c606e2d0ece5bd5434a930a87dcd Mon Sep 17 00:00:00 2001
From: vincent van beek <vincent@vlogic.nl>
Date: Thu, 26 Mar 2026 14:02:54 +0100
Subject: Use Quarkus Quinoa for serving web UI (#391)

* refactor(web): Migrate to Quarkus 3

This commit updates the OpenDC web server to use Quarkus 3, which
changes annotations to use the Jakarta namespace for annotations.

* refactor(web): Configure runtime variables for web UI

This commit updates the web UI to propagate runtime variables via the
next-runtime-env package. Before, we would need to replace the variables
in the generated sources by Next.js, next-runtime-env works by loading a
JavaScript file when opening the OpenDC web UI which contains the
configuration of the web app.

* refactor(web): Migrate to Quarkus Quinoa

This commit updates the OpenDC web server to make use of Quarkus Quinoa
for serving the web UI. This allows us to deprecate the complex Quarkus
extension for serving the web UI.

* refactor(web): Move web UI into Quarkus web app

This commit moves the web UI into the Quarkus web server module to
ensure we follow Quarkus Quinoa's conventions.

* refactor(web): Merge Quarkus extension into single module

This commit merges the existing Quarkus extensions into a single module
to prevent build complexity.

* refactor(web): Migrate web proto to Java

This commit migrates the web protocol to Java and removes the dependency
on Jandex Gradle.

* refactor(web): Migrate to Quarkus 3

This commit updates the OpenDC web server to use Quarkus 3, which
changes annotations to use the Jakarta namespace for annotations.

* enable DB schema migration on DEV server

* webui is not needed anymore

* remove MAINTAINERS is depricated

* fix quarkus.quinoa properties

* revert properties change, install npm in docker image to allow building the frontend

* pin postgres version, this is a best practice. Fix some properties the old ones are depricated. Added properties for local testing

* fix build error

* :opendc-web:opendc-web-proto:spotlessApply

* fix database schema

---------

Co-authored-by: Fabian Mastenbroek <mail.fabianm@gmail.com>
---
 .../src/main/resources/load_data.sql               | 58 +++++++++++-----------
 1 file changed, 29 insertions(+), 29 deletions(-)

(limited to 'opendc-web/opendc-web-server/src/main/resources/load_data.sql')

diff --git a/opendc-web/opendc-web-server/src/main/resources/load_data.sql b/opendc-web/opendc-web-server/src/main/resources/load_data.sql
index 72396cef..39cb3a02 100644
--- a/opendc-web/opendc-web-server/src/main/resources/load_data.sql
+++ b/opendc-web/opendc-web-server/src/main/resources/load_data.sql
@@ -1,56 +1,56 @@
 
 -- Insert data
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
        VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project 1', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 1);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 1, 'test_user_1');
 
 -- Add test user 2 as a viewer for project 1
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('VIEWER', 1, 'test_user_2');
 
 -- Add test user 3 as an editor for project 1
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('EDITOR', 1, 'test_user_3');
 
 -- Create a project for test user 2
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project 2', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 2);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 2, 'test_user_2');
 
 -- Create three projects for test user 3. User 3 has multiple projects to test getAll
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project 3', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 3);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 3, 'test_user_3');
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project 4', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 4);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 4, 'test_user_3');
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project 5', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 5);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 5, 'test_user_3');
 
 -- Project to delete
 
-INSERT INTO PROJECT (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
+INSERT INTO projects (created_at, name, portfolios_created, scenarios_created, topologies_created, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Project Delete', 0, 0, 0, '2024-03-01T15:31:41.579969Z', 6);
 
-INSERT INTO PROJECTAUTHORIZATION (role, project_id, user_name)
+INSERT INTO project_authorizations (role, project_id, user_id)
 VALUES ('OWNER', 6, 'test_user_1');
 
 -- --------------------------------------------------------------------------------
@@ -58,16 +58,16 @@ VALUES ('OWNER', 6, 'test_user_1');
 -- --------------------------------------------------------------------------------
 
 -- Add Portfolio to project 1
-INSERT INTO PORTFOLIO (name, number, project_id, targets, id)
+INSERT INTO portfolios (name, number, project_id, targets, id)
 VALUES ('Test PortFolio Base', 1, 1, '{"metrics": [], "repeats":1}' FORMAT JSON, 1);
 
-INSERT INTO PORTFOLIO (name, number, project_id, targets, id)
+INSERT INTO portfolios (name, number, project_id, targets, id)
 VALUES ('Test PortFolio Delete', 2, 1, '{"metrics": [], "repeats":1}' FORMAT JSON, 2);
 
-INSERT INTO PORTFOLIO (name, number, project_id, targets, id)
+INSERT INTO portfolios (name, number, project_id, targets, id)
 VALUES ('Test PortFolio DeleteEditor', 3, 1, '{"metrics": [], "repeats":1}' FORMAT JSON, 3);
 
-UPDATE Project p
+UPDATE projects p
 SET p.portfolios_created = 3, p.updated_at = '2024-03-01T15:31:41.579969Z'
 WHERE p.id = 1;
 
@@ -75,19 +75,19 @@ WHERE p.id = 1;
 --  Topologies
 -- --------------------------------------------------------------------------------
 
-INSERT INTO TOPOLOGY (created_at, name, number, project_id, rooms, updated_at, id)
+INSERT INTO topologies (created_at, name, number, project_id, rooms, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Topology testUpdate', 1, 1, '[]' FORMAT JSON, '2024-03-01T15:31:41.579969Z', 1);
 
-INSERT INTO TOPOLOGY (created_at, name, number, project_id, rooms, updated_at, id)
+INSERT INTO topologies (created_at, name, number, project_id, rooms, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Topology testDeleteAsEditor', 2, 1, '[]' FORMAT JSON, '2024-03-01T15:31:41.579969Z', 2);
 
-INSERT INTO TOPOLOGY (created_at, name, number, project_id, rooms, updated_at, id)
+INSERT INTO topologies (created_at, name, number, project_id, rooms, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Topology testDelete', 3, 1, '[]' FORMAT JSON, '2024-03-01T15:31:41.579969Z', 3);
 
-INSERT INTO TOPOLOGY (created_at, name, number, project_id, rooms, updated_at, id)
+INSERT INTO topologies (created_at, name, number, project_id, rooms, updated_at, id)
 VALUES ('2024-03-01T15:31:41.579969Z', 'Test Topology testDeleteUsed', 4, 1, '[]' FORMAT JSON, '2024-03-01T15:31:41.579969Z', 4);
 
-UPDATE Project p
+UPDATE projects p
 SET p.topologies_created = 4, p.updated_at = '2024-03-01T15:31:41.579969Z'
 WHERE p.id = 1;
 
@@ -95,21 +95,21 @@ WHERE p.id = 1;
 --  Traces
 -- --------------------------------------------------------------------------------
 
-INSERT INTO TRACE (id, name, type)
+INSERT INTO trace (id, name, type)
 VALUES ('bitbrains-small', 'Bitbrains Small', 'small');
 
 -- --------------------------------------------------------------------------------
 --  Scenario
 -- --------------------------------------------------------------------------------
 
-INSERT INTO SCENARIO (name, number, phenomena, portfolio_id, project_id, scheduler_name, topology_id, sampling_fraction, trace_id, id)
+INSERT INTO scenarios (name, number, phenomena, portfolio_id, project_id, scheduler_name, topology_id, sampling_fraction, trace_id, id)
 VALUES ('Test Scenario testDelete', 1, '{"failures": false, "interference": false}' FORMAT JSON, 1, 1, 'test', 1, 1.0, 'bitbrains-small', 1);
 
-INSERT INTO SCENARIO (name, number, phenomena, portfolio_id, project_id, scheduler_name, topology_id, sampling_fraction, trace_id, id)
+INSERT INTO scenarios (name, number, phenomena, portfolio_id, project_id, scheduler_name, topology_id, sampling_fraction, trace_id, id)
 VALUES ('Test Scenario testDeleteUsed', 2, '{"failures": false, "interference": false}' FORMAT JSON, 1, 1, 'test', 4, 1.0, 'bitbrains-small', 2);
 
 
-UPDATE Project p
+UPDATE projects p
 SET p.scenarios_created = 2, p.updated_at = '2024-03-01T15:31:41.579969Z'
 WHERE p.id = 1;
 
@@ -117,8 +117,8 @@ WHERE p.id = 1;
 --  Job
 -- --------------------------------------------------------------------------------
 
-INSERT INTO JOB (scenario_id, created_by, created_at, repeats, updated_at, state, runtime, results, id)
+INSERT INTO job (scenario_id, created_by, created_at, repeats, updated_at, state, runtime, results, id)
 VALUES (1, 'test_user_1', '2024-03-01T15:31:41.579969Z', 1, '2024-03-01T15:31:41.579969Z', 'PENDING', 1, '{}' FORMAT JSON, 1);
 
-INSERT INTO JOB (scenario_id, created_by, created_at, repeats, updated_at, state, runtime, results, id)
+INSERT INTO job (scenario_id, created_by, created_at, repeats, updated_at, state, runtime, results, id)
 VALUES (1, 'test_user_1', '2024-03-01T15:31:41.579969Z', 1, '2024-03-01T15:31:41.579969Z', 'PENDING', 1, '{}' FORMAT JSON, 2);
-- 
cgit v1.2.3

