CampusCoffee (WS 25/26)

Prerequisites

Build application

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 install

Note: 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 -q

Start application (dev)

First, 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 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres:17-alpine

Then, you can start the application:

cd application
mvn spring-boot:run -Dspring-boot.run.profiles=dev

Note: The data source is configured via the application.yaml file.

REST API

You can use curl in the command line to send HTTP requests to the REST API.

POS endpoint

Get POS

All POS:

curl http://localhost:8080/api/pos

POS by ID:

curl http://localhost:8080/api/pos/1 # add valid POS id here

Create POS

curl --header "Content-Type: application/json" --request POST --data '{"name":"New Café","description":"Description","type":"CAFE","campus":"ALTSTADT","street":"Hauptstraße","houseNumber":"100","postalCode":69117,"city":"Heidelberg"}' http://localhost:8080/api/pos

Update POS

Update 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 body