- Install Docker Desktop or a compatible open-source alternative such as Rancher Desktop.
- Install the Temurin JDK 21 and Maven 3.9 either via the provided
mise.tomlfile (see getting started guide for details) or directly via your favorite package manager. If you usemise, runmise trust mise.tomland thenmise installin the project root to set up the required tool versions. - Install a Java IDE. We recommend IntelliJ, but you are free to use alternatives such as VS Code with suitable extensions.
- Import the project into your IDE. In IntelliJ, you can do this via
File->New->Project from Existing Sources. Select the root-levelpom.xmland import the project. If you have themiseplugin installed, IntelliJ will ask you to select the appropriate tool versions. - Ensure that your IDE as initialized the project correctly, including all
src,test, andresourcesfolders.
First, make sure that the Docker daemon is running. Then, to build the application, run the following command in the command line (or use the Maven integration of your IDE):
mvn clean installNote: In the dev profile, all repositories are cleared before startup, the initial data is loaded (see LoadInitialData.java).
You can use the quiet mode to suppress most log messages:
mvn clean install -qFirst, make sure that the Docker daemon is running. Before you start the application, you first need to start a Postgres docker container:
docker run -d --name db -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:17-alpineThen, you can start the application:
cd application
mvn spring-boot:run -Dspring-boot.run.profiles=devNote: The data source is configured via the application.yaml file.
You can use curl in the command line to send HTTP requests to the REST API.
All POS:
curl http://localhost:8080/api/posPOS by ID:
curl http://localhost:8080/api/pos/1 # add valid POS id herePOS by name:
curl http://localhost:8080/api/pos/filter?name=Schmelzpunkt # add valid POS name hereCreate a POS based on a JSON object provided in the request body:
curl --request POST --header "Content-Type: application/json" --data '{"name":"New Café","description":"Description","type":"CAFE","campus":"ALTSTADT","street":"Hauptstraße","houseNumber":"100","postalCode":69117,"city":"Heidelberg"}' http://localhost:8080/api/posCreate a POS based on an OpenStreetMap node:
curl --request POST --header "Content-Type: application/json" --data '"ALTSTADT"' http://localhost:8080/api/pos/import/osm/5589879349 # set a valid OSM node ID hereIDs for testing:
- 5589879349 (Rada Coffee & Rösterei in ALTSTADT)
- 1864600258 (La Fée in ALTSTADT)
- 1864600236 (Café Moro in ALTSTADT) --> missing address
See bean validation in action:
curl --header "Content-Type: application/json" --request POST -i --data '{"name":"","description":"","type":"CAFE","campus":"ALTSTADT","street":"Hauptstraße","houseNumber":"100","postalCode":69117,"city":"Heidelberg"}' http://localhost:8080/api/posUpdate title and description:
curl --header "Content-Type: application/json" --request PUT --data '{"id":4,"name":"New coffee","description":"Great croissants","type":"CAFE","campus":"ALTSTADT","street":"Hauptstraße","houseNumber":"95","postalCode":69117,"city":"Heidelberg"}' http://localhost:8080/api/pos/4 # set correct POS id here and in the bodyDelete POS by ID:
curl --request DELETE -i http://localhost:8080/api/pos/1 # set existing POS ID hereAll users:
curl http://localhost:8080/api/usersUser by ID:
curl http://localhost:8080/api/users/1 # add valid user id hereUser by login name:
curl http://localhost:8080/api/users/filter?login_name=jane_doe # add valid user login name herecurl --header "Content-Type: application/json" --request POST --data '{"loginName":"other_login_name","emailAddress":"[email protected]","firstName":"New","lastName":"Person"}' http://localhost:8080/api/usersSee bean validation in action:
curl --header "Content-Type: application/json" --request POST -i --data '{"loginName":"other_login_name!","emailAddress":"other.personATuni-heidelberg.de","firstName":"","lastName":""}' http://localhost:8080/api/usersUpdate the login name and the email address:
curl --header "Content-Type: application/json" --request PUT --data '{"id":1,"createdAt":"2025-06-03T12:00:00","updatedAt":"2025-06-03T12:00:00","loginName":"jane_doe_new","emailAddress":"[email protected]","firstName":"Jane","lastName":"Doe"}' http://localhost:8080/api/users/1 # set correct user id here and in the bodyDelete user by ID:
curl --request DELETE -i http://localhost:8080/api/users/1 # set existing POS ID heredocker build -t campus-coffee:latest .First, create a new Docker network named campus-coffee-net,
then run a Postgres container and connect it to campus-coffee-net.
Finally, run the container with the application (in dev profile, do not use in production),
connect it to the network, and configure the application
to use the database provided in the started Postgres container.
docker network create campus-coffee-net 2>/dev/null || true
docker rm -f db 2>/dev/null || true
docker run -d --name db --net campus-coffee-net -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:16-alpine
docker run --net campus-coffee-net -e SPRING_PROFILES_ACTIVE=dev -e SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/postgres -p 8080:8080 -it --rm campus-coffee:latestExplanation of selected options:
docker run -p 8080:8080 runs the container with port 8080 exposed to the host machine. You can change the port mapping if needed.
docker run ... -it runs a container in interactive mode with a pseudo-TTY (terminal).
docker run ... --rm automatically removes the container (and its associated resources) if it exists already.
Build container image:
docker compose buildDelete existing DB container (if you manually created it before):
docker rm -f db 2>/dev/null || trueCreate and start containers:
docker compose down && docker compose upStop and remove containers and networks:
docker compose down