Responsible for storing account information and binding it to a session identified by session_id
stored in the
cookies.
Account information is saved in PostgresSQL database.
Passwords are saved as a hashed value after adding the salt to an original password.
Sessions are stored in a distributed map of Hazelcast cluster.
GET /session_id
- Description: Setups a session if it was not set up before, otherwise renews it. Sets a cookie
session_id
. - Parameters:
session_id
(cookie): session id to renew (optional)
- Description: Setups a session if it was not set up before, otherwise renews it. Sets a cookie
POST /log_in
- Description: Binds an account to a session_id. Session is automatically set up and renewed if necessary.
- Parameters:
session_id
(cookie): session id to bind with (optional)login
(query): login of the accountpassword
(query): password of the account
POST /sign_up
- Description: Creates a new account and binds it to a session_id. Session is automatically set up and renewed if necessary.
- Parameters:
session_id
(cookie): session id to bind with (optional)login
(query): login of the accountpassword
(query): password of the accountuser_type
(query): type of the account (user
orshop
)
GET /id
- Description: Retrieve the id from the account bound to the session id. Session is automatically set up and renewed if necessary.
- Parameters:
session_id
(cookie): session id (optional)
Responsible for storing and returning the data about coffee packs. Data is stored in a PostgresSQL database.
name
: stringroastery
: stringdescription
: string (optional)image_path
: stringcountry
: stringweight
: array of integersflavour
: array of strings
GET /packs
- Description: Returns the list of the coffee packs.
- Parameters:
ids
(query): ids of the packs to return (optional)
GET /packs/{id}
- Description: Returns the pack for specified
id
- Parameters:
id
(path): id of the coffee pack
- Description: Returns the pack for specified
POST /packs
- Description: Adds to the "packs" table in PostgreSQL.
- Parameters:
coffee_pack
(body/json): coffee pack objectsession_id
(cookie): session id (optional)
Responsible for storing and returning the data about coffee shops alongside their menus. Data is stored in a PostgresSQL database.
id
- integername
- stringdescription
- stringimage_path
stringaddress_text
stringaddress_latitude
numberaddress_longitude
number
coffee_pack_id
- integerprice
- numberquantity
- integer
GET /coffee-shops
- Description: Returns the list of all coffee-shops.
GET /coffee-shops/{id}
- Description: Returns the coffee-shops for specified
id
- Parameters:
id
(path): id of the shop
- Description: Returns the coffee-shops for specified
PUT /coffee-shops/{id}
- Description: Updates the coffee-shops for specified
id
- Parameters:
id
(path): id of the shopcoffee_shop
(body/json): coffee shop objectsession_id
(cookie): session id (optional)
- Description: Updates the coffee-shops for specified
GET /coffee-shops/{id}/menu
- Description: Returns the list of menu items for specified coffee shop
id
- Parameters:
id
(path): id of the shop
- Description: Returns the list of menu items for specified coffee shop
POST /coffee-shops/{id}/menu
- Description: Adds the menu item for specified coffee shop
id
- Parameters:
id
(path): id of the shopitem
(body/json): menu item objectsession_id
(cookie): session id (optional)
- Description: Adds the menu item for specified coffee shop
DELETE /coffee-shops/{id}/menu
- Description: Deletes the menu item for specified coffee shop
id
- Parameters:
id
(path): id of the shopitem_id
(query): menu item id to deletesession_id
(cookie): session id (optional)
- Description: Deletes the menu item for specified coffee shop
Responsible for storing and returning the data about check-ins. Data is stored in a Cassandra keyspace.
coffee_shop_id
: integer (optional)coffee_pack_id
: integer (optional)check_in_time
: datetimerating
: integercheck_in_text
: string (optional)
At least one of the coffee_shop_id
and coffee_pack_id
have to be specified.
GET /check-ins
- Description: Returns the list of all check-ins for specified parameters.
- Parameters:
coffee_shop_id
(query): id of the shop to get check_ins for (optional)coffee_pack_id
(query): id of the pack to get check_ins for (optional)user_id
(query): id of the user to get check_ins for (optional)
POST /check-ins
- Description: Creates a check-in for logged-in user.
- Parameters:
check_in
(body/json): check-in to createsession_id
(cookie): session id (optional)