git clone https://github.com/akquinet/lunch-roulette.git
mvn clean install
Afterwards the command "docker images" should show an image named "ats/lunchroulette", which you can run like this:
docker run --name lunchroulette --rm -p 8888:8080 ats/lunchroulette
If you wish to backup the data between container runs you may add a volume mount flag
docker run -p 8888:8080 ats/lunchroulette -v <somepath>/data:/var/lib/postgresql/data
http://localhost:8888/
Documentation of the available interfaces, tested via curl
Locations are places where to go to for lunch...
curl -i -v -X POST -H "Content-Type: application/json" -d \
'{"name":"McDonalds","style":"Unbekannt","aliases":["Burger King"],
"address":{"streetName":"Bülowstr.","streetNumber":"66","plz":"10783","city":"Berlin","telephoneNumber":""},
"averageDuration":"PT30M","rating":2}]' \
'http://localhost:8888/rest/locations/store'
curl http://localhost:8888/rest/locations/
curl http://localhost:8888/rest/locations/McDonalds
Users register and join communities
curl -i -v -X POST -H "Content-Type: application/json" -d \
'{ "name" : "Markus", "email" : "[email protected]"}' \
'http://localhost:8888/rest/users/store'
curl http://localhost:8888/rest/users/
curl http://localhost:8888/rest/users/Markus
Communities group users together
curl -i -v -X POST -H "Content-Type: application/json" -d \
'{ \
"name": "akquinet tech@spree", \
"founder": { \
"name": "Sarah", \
"email": "[email protected]" \
} \
}' \
'http://localhost:8888/rest/communities/store'
curl -i -v -X PUT -H "Content-Type: application/json" -d \
'{ \
"name": "Markus", \
"email": "[email protected]" \
}' \
'http://localhost:8888/rest/communities/akquinet%20tech@spree/add-user'
curl http://localhost:8888/rest/communities/
curl http://localhost:8888/rest/communities/"akquinet%20tech@spree"