Skip to content

Development Setup

Prerequisites

  • Java 21 (all modules compile and run with Java 21)
  • Maven 3.8+ (Maven wrapper mvnw is included in the repo)
  • Docker and Docker Compose

Quick Start (Full Stack)

Starting the complete stack requires three repositories and multiple terminal sessions.

Backend (schemastack-be)

bash
# Terminal 1 — Quarkus REST + infrastructure (Docker, RabbitMQ, PostgreSQL)
./scripts/dev-start.sh

# Terminal 2 — Spring Boot Processor (DDL/migrations)
./scripts/processor-start.sh

# Terminal 3 — Spring Boot Workspace API (dynamic CRUD)
./scripts/workspace-api-start.sh

Frontend (schemastack-fe)

bash
# Terminal 4 — Spread (Data Platform)
ng serve --port=4200 spread

# Terminal 5 — Admin Console
ng serve --port=4201 admin

Docs (schemastack-docs)

bash
npm run dev        # Public docs
npm run dev:dev    # Dev docs

Backend Tests

bash
# Run full test suite in an isolated copy (non-blocking)
./scripts/run-tests-background.sh

# Auto-run tests on file changes
./scripts/run-tests-watch.sh

Infrastructure Services

Docker Compose starts two services:

ServicePortCredentials
PostgreSQL 18localhost:5432postgres / your-password, database dynamicdb
RabbitMQ AMQPlocalhost:5673guest / guest
RabbitMQ Managementlocalhost:15673guest / guest

Non-standard RabbitMQ port

RabbitMQ runs on 5673 (not the default 5672) to avoid conflicts with other local services. The management UI is on 15673.

Environment Files

FilePurpose
.envBase configuration (database, JWT, mailer, RabbitMQ)
.env.localLocal development overrides
.env.testTest configuration with TestContainers and in-memory messaging

Building

bash
# Full recompile without tests (fast)
./mvnw clean install -DskipTests=true

# Full recompile with tests (slow)
./mvnw clean install -DskipTests=false

# Build a specific module
./mvnw clean install -pl quarkus/metadata/metadata-rest -am

Service URLs

ServiceURL
Quarkus REST APIhttp://localhost:8080
Spring Boot Processorhttp://localhost:8082
Spring Boot Workspace APIhttp://localhost:8083
RabbitMQ Managementhttp://localhost:15673

Data Persistence

Docker volumes persist data between restarts:

  • postgres_data — PostgreSQL data
  • rabbitmq_data — RabbitMQ state
  • rabbitmq_logs — RabbitMQ logs

To reset all data: docker compose down -v

RabbitMQ Consumer Timeout

The Docker Compose config sets a 30-second consumer timeout (consumer_timeout 30000). This prevents zombie consumers from accumulating during Quarkus dev mode hot-reloads.

Scripts Reference

All scripts live in the scripts/ directory.

Startup & Shutdown

ScriptDescription
dev-start.shStart Docker services + Quarkus dev mode. Pass --reset to drop and recreate dynamicdb. Also purges dev RabbitMQ queues and cleans up failed migrations.
dev-stop.shKill Maven processes (graceful, then force) and docker compose down.
processor-start.shStart the Spring Boot Processor on port 8082. Checks that Quarkus is running on 8080 first.
workspace-api-start.shStart the Spring Boot Workspace API on port 8083. Checks that Quarkus is running on 8080 first.

Build Helpers

ScriptDescription
install-contracts.shBuild and install messaging-contracts to local Maven (~/.m2). Run this after changing shared message DTOs so both Quarkus and Spring Boot pick them up.

Testing

ScriptDescription
run-tests-background.shRsync the source to an isolated directory and run the full build+test suite in the background. Sends macOS notifications on success/failure. Use --watch to follow output, --status to check progress.
run-tests-watch.shWatch for file changes using fswatch and auto-run tests after an idle period (default 10s, configure with --idle <seconds>). Use --stop to stop the watcher. Requires brew install fswatch.

Diagnostics

ScriptDescription
rabbitmq-status.shQuery RabbitMQ Management API. Subcommands: status (queue overview), messages [queue] (peek at messages), dlq (dead letter queue), purge <queue> (empty a queue).

Database Diagnostics (scripts/diagnostics/)

Run via diagnostics/run-all-diagnostics.sh (interactive — prompts for credentials and runs all checks), or individually:

ScriptRun againstDescription
check-duplicate-columns.sqlMetadata DB (dynamicdb)Find duplicate columns in the metadata tables. Drift detection crashes with "Duplicate key" errors when these exist.
cleanup-duplicate-columns.sqlMetadata DB (dynamicdb)Delete duplicate columns, keeping the first occurrence (lowest ID). Runs in a transaction — any error rolls back.
check-workspace-catalog.sqlWorkspace DB (customer)Check PostgreSQL pg_attribute system catalog for duplicate columns. Rows found = real database corruption (not just a code bug).

Liquibase Migrations

Three independent Liquibase changelogs (the metadata master includes the other two):

ModuleMaster FileChangesets
Metadatametadata-persistence/.../changelog-metadata.xml46 (1.0 — 1.47)
Organisationorganisation-persistence/.../changelog-organisation.xml11 (1.0 — 6.0)
Messagingmessaging-infrastructure/.../changelog-messaging.xml1 (1.0)
Total3 masters58 production changesets

Key migration landmarks:

VersionWhat
1.0Initial schema (entities, views, columns)
1.3RBAC permissions
1.20Relationship column support
1.21-1.22Bulk action jobs
1.23-1.25Filter presets + sorts
1.26Sync operation tracking
1.27Outbox messages
1.32View guest access
1.40Workspace API keys
1.47Usage tracking
org-4.4Two-factor authentication
org-6.0Subscription tiers

Dev seed data files (context="dev") provide local development fixtures: test users, organisations, workspace memberships.

Deployment

Two deployment patterns:

Lambda (REST API)

dockerfile
FROM public.ecr.aws/lambda/provided:al2
COPY target/function/bootstrap /var/task/bootstrap
CMD ["bootstrap"]

Quarkus native binary built for Lambda. Stateless, cold start optimized.

Fargate (Consumer Worker)

Multi-stage Maven build → JVM-based Quarkus fast-jar:

  • Build: maven:3.9.9-eclipse-temurin-21 with Maven cache mount
  • Runtime: eclipse-temurin:21-jre-alpine
  • Build arg: QUARKUS_PROFILE=worker
  • Copies cert.pem for TLS
  • Port 8080

SchemaStack Internal Developer Documentation