- Run
docker build . -t coffeemaker
to build docker image application from root directory - Start application with
docker run -p 8080:8080 coffeemaker
Alternatively pull docker image directly by writing docker pull vehagn/coffeemaker
and running the image using docker run -p 8080:8080 vehagn/coffeemaker
To check that the application is running enter url http://localhost:8080/api
.
You should be greeted with a {"code":404,"message":"HTTP 404 Not Found"}
message.
TODO: Implement more friendly welcome message
To see your applications health enter url http://localhost:8081/healthcheck
TODO: Implement Health Check
- Each Drink consists of 7 fields of information
drinkId
-- unique identifier for drinkname
-- name of drinktemperature
-- serving temperature of drinkwater
-- units of water in drinkcoffee
-- units of coffee in drinkmilk
-- units of milk in drinksize
-- total ingredient units in drink
- Each drink consists of 3 ingredients: water, coffee, and milk.
- Each ingredient is given in unit increments between 0 and 10.
- The size of a drink is the sum off all ingredients.
- The maximum size of any drink is 10 (
MAX_DRINK_SIZE
) units. - Coffee can be added to drinks
- If adding coffee exceeds
MAX_DRINK_SIZE
size it displaces other ingredients
- If adding coffee exceeds
- If a drink exceeds
MAX_DRINK_SIZE
ingredients are removed until it no longer exceeds- Ingredients are removed one at a time, trying to balance the final drink
- The drink should be served between 1.0 (
MIN_DRINK_TEMPERATURE
) and 95.0 (MAX_DRINK_TEMPERATURE
)
A list of available drinks with their corresponding recipe can be view by entering url
http://localhost:8080/api/drink/list
.
Each individual drink can be seen at
http://localhost:8080/api/drink/get?drinkId=[id]
by replacing [id]
with the requested drink ID.
Adding coffee to a given drink can be done using
http://localhost:8080/api/drink/addCoffee?drinkId=[id]&addCoffee=[amount]
where [id]
is the selected drink and [amount]
is the requested amount of added coffee.
TODO: Functions for adding other ingredients
TODO: Better temperature management
TODO: Read drink list from database, not CSV file.
- Each Machine consists of 7 fields of information
machineId
-- unique machine identifierbrand
-- machine brandmake
-- machine makewaterReservoir
-- amount of water leftcoffeeReservoir
-- amount of coffee leftmilkReservoir
-- amount of milk leftcups
-- amount of cups left
- The machine dispenses drinks based on recipe
- It's possible to add more coffee before dispensing drink
- The machine should have enough resources present before trying to dispense
- Dispensing 1 unit of water consumes 1 unit of water
- Dispensing 1 unit of coffee consumes 1 unit of water and 1 unit of coffee
- Dispensing 1 unit of milk consumes 1 unit of milk
- Dispensing 1 drink consumes 1 cup
- Return an Exception if not enough resources are present
Too see machine info go to
http://localhost:8080/api/machine/info
In order to dispense a drink invoke
http://localhost:8080/api/machine/dispense?drinkId=[id]&addCoffee=[amount]
where [id] is the ID of the requested drink and [amount] is the requested amount of added coffee.
TODO: Add unit tests
TODO: Add refill functions
TODO: Read machine status from database