This document describes how setup a local development environment and how to start developing features. If you just want to use the software refer to manual for more information.
Prerequisites
- Java JDK 25 or later
- Maven 3
- PostgreSQL (available for development via docker-compose scripts)
- Keycloak for authentication (optional)
vision-apimaven repository setup (see https://github.com/starwit/vision-api?tab=readme-ov-file#java--maven for guidance)
See section neccessary infra for how to run necessary components with Docker Compose.
In order to run a local development environment execute the following steps. Please note: all steps need to be executed from base folder of repositories.
-
go to the deployment folder and start the environment (database and keycloak) via docker-compose:
cd deployment docker compose up -
go to
webclient/appand install the frontend applications dependenciescd webclient/app npm install -
build the project
mvn clean install -P frontend
-
start project
java -jar application/target/application-0.0.1-SNAPSHOT.jar
Once all steps ran successfully application will be reachable with the following coordinates:
- application can be reached under http://localhost:8081/urbalytix/
- swagger under http://localhost:8081/urbalytix/swagger-ui/
- If you are using keycloak:
- default user/password is admin/admin
- keycloak can be reached under http://localost:8081/auth
When developing the frontend with the Vite dev server you usually don't want to run a full Keycloak instance. The dev server can mock the authentication endpoint instead, so the application treats you as a logged-in user.
This is controlled via environment variables in webclient/app/.env:
MOCK_AUTH=trueenables the mock. The Vite dev server interceptsGET /urbalytix/api/user/currentand returns an authenticated user. Set it to anything else (or remove it) to disable the mock and use the real backend/Keycloak.MOCK_AUTH_ROLESis a comma-separated list of roles assigned to the mocked user (e.g.MOCK_AUTH_ROLES=admin,user). If omitted, the user defaults toadmin.
The mock only applies to the Vite dev server (npm run dev); it has no effect on the packaged application.
Application needs various infrastructure to run e.g. PostgreSQL database. Folder deployment contains a number of Docker Compose scripts to run these.
If you need data for testing, you can create a dump and copy it to your machine:
- Access kubernetes cluster and establish a port forward for timescaledb with address 0.0.0.0 and port 5433
- Run docker compose with
deployment/noauth-docker-compose.yml - Access database container:
docker exec -it urbalytix-db-urbalytix-1 bash - Dump database:
pg_dump -h local-ip-address -p 5433 -U urbalytix -Fc urbalytix > urbalytix.dump - Copy to local database:
pg_restore -h localhost -p 5432 -U urbalytix -d urbalytix urbalytix.dump - Check result with pgAdmin
Default password for dev databases is urbalytix. Docker compose script run a pre-configured PGAdmin instance here: http://localhost:5050/
The Helm Chart is templated as part of the Maven build process to make version setting easier. Therefore, the files in deployment/helm do not form a valid Helm Chart.
To generate the Helm Chart only you can run: mvn validate -pl application
The generated chart can then be found in application/target/helm