{"id":24750833,"url":"https://github.com/shmelovoleksandr/coastersense_backend","last_synced_at":"2026-04-20T09:02:08.602Z","repository":{"id":273937255,"uuid":"921254675","full_name":"ShmelovOleksandr/CoasterSense_Backend","owner":"ShmelovOleksandr","description":"My first project on SpringBoot and first time learning about RESTful API","archived":false,"fork":false,"pushed_at":"2025-01-23T17:32:46.000Z","size":334,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T21:28:36.653Z","etag":null,"topics":["java","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ShmelovOleksandr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-23T16:16:46.000Z","updated_at":"2025-01-23T19:21:48.000Z","dependencies_parsed_at":"2025-01-23T21:38:40.814Z","dependency_job_id":null,"html_url":"https://github.com/ShmelovOleksandr/CoasterSense_Backend","commit_stats":null,"previous_names":["shmelovoleksandr/coastersense_backend"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShmelovOleksandr%2FCoasterSense_Backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShmelovOleksandr%2FCoasterSense_Backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShmelovOleksandr%2FCoasterSense_Backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShmelovOleksandr%2FCoasterSense_Backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShmelovOleksandr","download_url":"https://codeload.github.com/ShmelovOleksandr/CoasterSense_Backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245049185,"owners_count":20552638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","rest-api","spring-boot"],"created_at":"2025-01-28T09:09:03.137Z","updated_at":"2026-04-20T09:02:08.558Z","avatar_url":"https://github.com/ShmelovOleksandr.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoasterSense (Back-end)\nCoasterSense is a college group project made by students of \u003cb\u003eKarel de Grote Hogeschool\u003c/b\u003e.   \n\n### Team: 19\n\u003cb\u003eTeam members:\u003c/b\u003e\n* Artem Diakunchak\n* Oleksandr Shmelov\n* Mykhailo Kruts\n* Leonid Romaniukha\n* Yevhen Zinenko\n\n## About\nBriefly describing the project, CoasterSense is a smart coaster whos role is  to elevate customers' experience in restaurants or cafes. The coaster will automatically notify waiters of customers who needs to be served by measuring the value of drink in the placed glass.\n\nComplete description of the project idea can be found \u003ca href=\"\"\u003ehere\u003c/a\u003e.\n\n\u003chr\u003e\nThis GitLab repository contains \u003cb\u003e\u003cu\u003eonly the back-end part\u003c/u\u003e\u003c/b\u003e of the final product. To access the rest of the project, you can navigate to:\n\n* \u003ca href=\"https://gitlab.com/kdg-ti/integration-2.1/23-24/group-19/coastersense_front\"\u003eFront-end repository\u003c/a\u003e\n* \u003ca href=\"https://gitlab.com/kdg-ti/integration-2.1/23-24/group-19/coastersence_arduino\"\u003eArduino repository\u003c/a\u003e\n\n## Setup\n\nApplication is \"ready to run\" immediately after copping the repository, as long as you are connected to the KdG local network. This can be done via KdG VPN. Otherwise the application won't be able to access remote database which is located on KdG's servers.\n\nOtherwise, there are a couple of pre-made configuration profiles, in case you want to make some adjustments to the setup of the application. Edit \u003cu\u003eapplication.properties\u003c/u\u003e file to enable them.\n\n* Use \"remotedb\" profile if you want to use cloud based DB. (Application won't start without KdG network)\n* Use \"localdb\" in order to switch to the locally based H2 database. (Won't have any pre-inserted data)\n* Use \"jpa_data\" for enabling all JPA repositories.\n* Use \"dummy_data\" for enabling \"dummy\" repositories. (May contain incomplete implementations)\n* Use \"remote_front\" in case you are using remotely based Front-end. (Application won't work with locally base Front-end)\n* Use \"local_front\" in case you are using locally based Front-end. (Application won't work with remotely base Front-end)\n\n\n## Structure\nApplication implements \u003cb\u003ethree-layered architecture\u003c/b\u003e. This setup helps the app run smoothly by dividing its tasks into three main parts. Each of these parts has its own job, making it easier to manage and improve the app over time.  \nUtilization of \u003cb\u003eREST API\u003c/b\u003e allows for future connection of all different types of \u003cb\u003emicroservices\u003c/b\u003e\n\n## Technologies used\n* \u003cb\u003eSpring Boot 3.1.5\u003c/b\u003e (Spring 6) was chosen for the development of the back-end.\n* \u003cb\u003eGradle\u003c/b\u003e was used as a build and deployment tool.\n* \u003cb\u003eJava 17\u003c/b\u003e was used as a language of development.\n* \u003cb\u003eKotlin\u003c/b\u003e was used as a language of Gradle configuration.\n* Communication with a cloud-based database is facilitated through the utilization of the \u003cb\u003eJava Persistence API\u003c/b\u003e (JPA).  \n* \u003cb\u003ePostgreSQL\u003c/b\u003e was used as a production SQL dialect.\n* \u003cb\u003eH2\u003c/b\u003e database as a development assistance tool.\n* Application communicates with outside world using \u003cb\u003eREST API\u003c/b\u003e.\n\n## Dictionary\n* \u003cb\u003eServingSpace\u003c/b\u003e - is a whole business entity. After making an order you will be assigned a unique ID.\n* \u003cb\u003eTableGroup\u003c/b\u003e - is a group of tables. Examples: \"Ground floor\", \"First floor\", \"Terrace\".\n* \u003cb\u003eTable\u003c/b\u003e - is an entity which can contain a group of coasters. \n* \u003cb\u003eCoaster\u003c/b\u003e - is an actual product which measures and sends data. \n* \u003cb\u003eDrink\u003c/b\u003e - is just a drink with its name, type. Each drink has to have a corresponding empty glass weight and full glass weight.\n* \u003cb\u003eColor\u003c/b\u003e - each \u003cb\u003eDrink\u003c/b\u003e might also have a corresponding Color assigned to it. This is made for drink recognition. \n* \u003cb\u003eUser\u003c/b\u003e - is simply a user of our product. They can login to the website and they can be assigned a role (Admin ot Waiter).\n* \u003cb\u003eDelivery\u003c/b\u003e - is a delivery order placed by a website visitor.\n\n## API\n\nAll data will be returned in \u003cb\u003eJSON\u003c/b\u003e format, according to REST conventions.  \n(Text in curly braces {} indicates a variable in the link)\n\n### Endpoints:\n* \\[GET\\]\n  * /servingSpaces - returns a list of all \u003ci\u003eServingSpaces\u003c/i\u003e\n  * /servingSpaces/{ServingSpace_ID} - returns a specific \u003ci\u003eServingSpace\u003c/i\u003e\n  * /{ServingSpace_ID}/tableGroups - returns a list of all \u003ci\u003eTableGroups\u003c/i\u003e for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{ServingSpace_ID}/tableGroups/{TableGroup_ID} - returns a specific \u003ci\u003eTableGroup\u003c/i\u003e with given TableGroup_ID for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{servingSpaceId}/tables - returns list of all tables for a specific \u003ci\u003eServingSpace\u003c/i\u003e\n  * /{ServingSpace_ID}/coasters - returns list of all \u003ci\u003eCoasters\u003c/i\u003e for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{ServingSpace_ID}/coasters/free - returns list of all \u003cb\u003eunassigned\u003c/b\u003e \u003ci\u003eCoasters\u003c/i\u003e for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{ServingSpace_ID}/coasters/{macAddress} - returns the \u003ci\u003eCoaster\u003c/i\u003e with given MACAddress.\n  * /{ServingSpace_ID}/drinks - returns a list of all \u003ci\u003eDrinks\u003c/i\u003e for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{ServingSpace_ID}/drinks/history - returns a history of finished \u003ci\u003eDrinks\u003c/i\u003e for a specific \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /{servingSpaceId}/drinks/{colorName} - returns a specific drink for given \u003ci\u003eColor\u003c/i\u003e and \u003ci\u003eServingSpace\u003c/i\u003e.\n  * /colors - returns list of all \u003ci\u003eColors\u003c/i\u003e.\n  * /colors/{servingSpaceId} - returns list of all \u003ci\u003eColors\u003c/i\u003e used by given \u003ci\u003eServingSpace\u003c/i\u003e. \n  * /deliveries - returns list of all \u003ci\u003eDeliveries\u003c/i\u003e\"\n  * /{servingSpaceId}/stats/days - returns statistics for all days of the week (Index 0 corresponds to Sunday). Statistics includes: average drinking time of all drinks.\n  * /{servingSpaceId}/stats/drinks - returns \"all-time\" statistics for all drinks. Statistics includes: average drinking time.\n  \n\n* \\[POST\\]\n  * /arduino - updates \u003ci\u003eCoaster's\u003c/i\u003e data. \n    * JSON format:   \n      {  \n      \"macAddress\": \"12:34:56:78:90:ab\",   \n      \"red\": 0,  \n      \"green\": 0,  \n      \"blue\": 0,  \n      \"weight1\": 0,  \n      \"weight2\": 0,  \n      \"weight3\": 0,  \n      \"weight4\": 0,  \n      \"timestamp\": \"2000-01-31T12:00:00Z\"  \n      }\n  * /arduino/configuration - handles received data from arduino configuration.\n    * JSON format:  \n    Same as in /arduino\n  * /arduino/message - receives a message and forwards it to the arduino.\n    * JSON format:  \n    {  \n    \"your message\"  \n    }\n  * /contactUs - receives and save a \"contact us\" form.\n    * JSON format:  \n      {  \n      \"name\":\"John Doe\",\n      \"email\":\"test@email.com\",\n      \"message\":\"Hello World!\"  \n      }\n  * /colors - save new color to the database.\n    * JSON format:  \n    {  \n    \"name\":\"BLACK\",  \n    \"red\":0,  \n    \"green\":0,  \n    \"blue\":0  \n    }\n  * /deliveries\n    * JSON format:  \n    {  \n    \"firstName\":\"John\",  \n    \"lastName\":\"Doe\",  \n    \"email\":\"test@mail.com\",  \n    \"city\":\"Antwerpen\",  \n    \"postCode\":2000,  \n    \"street\":\"Italielei\",  \n    \"houseNumber\":1,  \n    \"amountOfCoasters\":12  \n    }\n  * /login - used for a secure login of a user.\n    * JSON format:\n    {\n    \"name\":\"admin\",\n    \"password\":\"admin\"\n    }\n    * Returns a response with \u003ci\u003eUser\u003c/i\u003e's role and assigned \u003ci\u003eServingSpace\u003c/i\u003e id.\n      * Return JSON format:  \n        {  \n        \"status\": \"OK\",  \n        \"role\": \"ADMIN\",  \n        \"servingSpaceId\": 1  \n        }  \n\n  * /servingSpaces - save new entity of \u003ci\u003eServingSpace\u003c/i\u003e into the database.\n    * JSON format:  \n      {  \n      \"name\": \"Jony's Pizza\",  \n      \"address\": \"Street\",  \n      \"phone\": \"+32112424\",  \n      \"email\": \"pizza@mail.com\",  \n      \"users\": \\[  \n      {  \n      \"name\": \"admin\",  \n      \"password\": \"admin\",  \n      \"role\": \"ADMIN\",  \n      \"servingSpaceId\": 1  \n      }  \n      \\]  \n      }  \n  * /{servingSpaceId}/tableGroups - save new entity of \u003ci\u003eTableGroup\u003c/i\u003e with assigned \u003ci\u003eServingSpace\u003c/i\u003e into the database.\n    * JSON format:  \n      \\[  \n      {  \n      \"name\":\"table group name\",  \n      \"coasterQuantities\":\\[2, 2\\],  \n      \"tableNames\":\\[\"name1\", \"name2\"\\]  \n      }  \n      \\]  \n  * /{servingSpaceId}/tables/{tableGroupId} - save new entity of \u003ci\u003eTable\u003c/i\u003e with assigned \u003ci\u003eTableGroup\u003c/i\u003e into the database.\n    * JSON format:  \n      {  \n      \"name\": \"table name\",  \n      \"coasters\": \\[  \n      {  \n      \"macAddress\": \"6f:8d:2a:c4:9e:0b\"  \n      }  \n      ]  \n      }  \n  * /{servingSpaceId}/coasters - save new entity of \u003ci\u003eCoaster\u003c/i\u003e into the database.\n    * JSON format:  \n      {  \n      \"macAddress\":\"6f:8d:2a:c4:9e:0b\",  \n      \"drinkColor\":\"NONE\",  \n      \"isPlaced\":false  \n      }  \n  * /{servingSpaceId}/drinks/{colorName} - save new entity of \u003ci\u003eDrink\u003c/i\u003e with assigned \u003ci\u003eServingSpace\u003c/i\u003e and \u003ci\u003eColor\u003c/i\u003e into the database.\n    * JSON format:  \n      {  \n      \"name\":\"cola\",  \n      \"type\":\"COFFEE\",  \n      \"color\":{  \n      \"name\":\"RED\"  \n      },  \n      \"servingSpaceId\":1  \n      }  \n  * /{servingSpaceId}/users - save new entity of \u003ci\u003eUser\u003c/i\u003e with assigned \u003ci\u003eServingSpace\u003c/i\u003e into the database.\n    * JSON format:  \n      {  \n      \"servingSpaceId\":1,  \n      \"name\":\"John\",  \n      \"password\":\"1234\",  \n      \"role\":\"ADMIN\"  \n      }  \n  \n\n\n* \\[PATCH\\]\n  * /{servingSpaceId}/drinks/{colorName} - updates data for certain \u003ci\u003eDrink\u003c/i\u003e.\n    * JSON format:  \n      {  \n      \"name\":\"cola\",  \n      \"type\":\"COFFEE\",  \n      \"color\":{  \n      \"name\":\"RED\"  \n      },  \n      \"servingSpaceId\":1  \n      }\n\n\n* \\[DELETE\\]\n  * /{servingSpaceId}/drinks/{colorName} - deletes certain \u003ci\u003eDrink\u003c/i\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmelovoleksandr%2Fcoastersense_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshmelovoleksandr%2Fcoastersense_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmelovoleksandr%2Fcoastersense_backend/lists"}