Skip to content

feat: prepare QuaK for cloud deployment - #169

Merged
f-marschall merged 16 commits into
developmentfrom
125-cloud-prep
Aug 10, 2026
Merged

feat: prepare QuaK for cloud deployment#169
f-marschall merged 16 commits into
developmentfrom
125-cloud-prep

Conversation

@f-marschall

@f-marschall f-marschall commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR prepares QuaK for deployment while keeping infrastructure-specific configuration outside the application repository.

Changes

  • improve the production Docker Compose configuration:
    • use configurable database credentials
    • correct the MariaDB data directory
    • improve the database health check
  • correct the MariaDB volume path in the development Compose configuration
  • support forwarded headers when QuaK runs behind a reverse proxy
  • include the OpenTelemetry Java agent for optional activation by the deployment environment
  • support a configurable VITE_API_URL and same-origin API requests in production
  • split large frontend dependencies into separate build chunks
  • upgrade Recharts and adapt the affected chart typings
  • remove the legacy Dokku deployment workflow

Database migration

The development Compose volume previously mounted db at /var/lib/data, while MariaDB stores its database files in /var/lib/mysql. Existing data may therefore be stored only in the current container's writable layer.

Updating the Compose configuration can recreate the database container and start with an empty database. Back up installations containing important data before updating or recreating the container:

docker compose -f docker-compose.dev.yaml exec -T database \
  sh -c 'mariadb-dump -uroot -p"$MARIADB_ROOT_PASSWORD" --all-databases --single-transaction --routines --events' \
  > quak-database-backup.sql

After updating and starting the new database container, restore the backup:

docker compose -f docker-compose.dev.yaml exec -T database \
  sh -c 'mariadb -uroot -p"$MARIADB_ROOT_PASSWORD"' \
  < quak-database-backup.sql

Do not remove or recreate the existing database container before creating the backup.

Verification

  • frontend tests pass
  • production frontend build succeeds
  • Docker Compose configurations are valid

Related to #125

@f-marschall f-marschall changed the title feat: prepare QuaK for standalone and cloud deployment feat: prepare QuaK for cloud deployment Jul 18, 2026
@f-marschall f-marschall reopened this Jul 21, 2026
Comment thread docker-compose.prod.yaml Outdated
SPRING_DATASOURCE_PASSWORD: hello
SPRING_DATASOURCE_PASSWORD: ${MARIADB_ROOT_PASSWORD:-hello}
SPRING_JPA_HIBERNATE_DDL_AUTO: update
FRONTEND_URL: http://localhost:8080

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Das sollte noch raus oder? Bzw. dann aus den environments die korrekte URL ziehen

Comment thread docker-compose.prod.yaml Outdated
image: "mariadb:latest"
restart: always
environment:
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD:-hello}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vielleicht brauchen wir mal n ordentliches Pw xD

Comment thread backend/Dockerfile

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier gibts extrem viele SonarQube Warnings, hast du dir die mal angesehen?

Comment thread backend/Dockerfile Outdated

# Keep the OpenTelemetry Java agent available for opt-in instrumentation.
# Deployments can activate it with JAVA_TOOL_OPTIONS=-javaagent:/app/opentelemetry-javaagent.jar.
RUN wget -q https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/opentelemetry-javaagent.jar -O /app/opentelemetry-javaagent.jar

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hier sollten wir die Version von opentelemetry pinnen oder? Damit man das besser nachvollziehen und reproduzieren kann

Comment thread frontend/src/api/api.ts Outdated
*/

const API_BASE_URL = import.meta.env.VITE_API_URL || 'http://localhost:8080';
const API_BASE_URL = import.meta.env.VITE_API_URL ?? (import.meta.env.DEV ? 'http://localhost:8080' : '');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was mir hier auffällt, hast du das auch für die websocket urls umgestellt? Müsste in der UseLSP hook zu finden sein

@NicKIT01

Copy link
Copy Markdown
Collaborator

Ich hab grad nochmal nachgeschaut, der LSP Setup sollte denke auch wie die api.ts angepasst werden. Der steht aktuell noch auf const wsBase = import.meta.env.VITE_WS_URL ?? 'ws://localhost:8080';

Du findest die Stelle unter frontend/src/hooks/editor/useLSPSetup.ts

@NicKIT01 NicKIT01 closed this Jul 22, 2026
@NicKIT01
NicKIT01 deleted the 125-cloud-prep branch July 22, 2026 12:42
@f-marschall
f-marschall restored the 125-cloud-prep branch July 22, 2026 18:41
  Production deployments must fail early when security-sensitive settings are
  missing and support same-origin routing behind a reverse proxy.

  - require MARIADB_ROOT_PASSWORD and FRONTEND_URL during Compose interpolation
  - add a production environment template and exclude local secrets from Git
    and Docker build contexts
  - document production configuration, startup, and database migration steps
  - select ws or wss automatically based on the page protocol
  - replace the NodeSource pipe-to-shell installer with Gradle-managed
    Node 22.23.2
  - pin the optional OpenTelemetry Java agent to version 2.30.0
  - add tests for REST and WebSocket URL resolution

  BREAKING CHANGE: production Compose requires MARIADB_ROOT_PASSWORD and
  FRONTEND_URL. Set both in .env.prod and start Compose with
  --env-file .env.prod.
@f-marschall f-marschall reopened this Aug 10, 2026
@sonarqubecloud

Copy link
Copy Markdown

@f-marschall
f-marschall marked this pull request as ready for review August 10, 2026 18:21
@f-marschall
f-marschall merged commit 635f554 into development Aug 10, 2026
5 checks passed
@f-marschall
f-marschall deleted the 125-cloud-prep branch August 10, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants