{"id":20154684,"url":"https://github.com/sebastianbrzustowicz/robot-tasker-api","last_synced_at":"2026-04-12T00:02:03.349Z","repository":{"id":213777962,"uuid":"730393439","full_name":"sebastianbrzustowicz/Robot-tasker-API","owner":"sebastianbrzustowicz","description":"Java + Spring Boot + MySQL + Rest API + WebSocket + Docker + JUnit. API for communication between client and vehicle.","archived":false,"fork":false,"pushed_at":"2024-02-04T12:20:13.000Z","size":147,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-30T23:36:10.344Z","etag":null,"topics":["api","bash","docker","java","jdbc","mysql","powershell","quadcopter","remote-control","rest-api","robot","robotics","shell","spring-boot","websocket","websocket-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastianbrzustowicz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-12-11T20:37:27.000Z","updated_at":"2024-01-08T00:27:24.000Z","dependencies_parsed_at":"2024-02-04T13:31:12.585Z","dependency_job_id":"8ed80996-3c9e-4173-b09d-cb638784b4de","html_url":"https://github.com/sebastianbrzustowicz/Robot-tasker-API","commit_stats":null,"previous_names":["sebastianbrzustowicz/robot-tasker-api"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sebastianbrzustowicz/Robot-tasker-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbrzustowicz%2FRobot-tasker-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbrzustowicz%2FRobot-tasker-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbrzustowicz%2FRobot-tasker-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbrzustowicz%2FRobot-tasker-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastianbrzustowicz","download_url":"https://codeload.github.com/sebastianbrzustowicz/Robot-tasker-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastianbrzustowicz%2FRobot-tasker-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31699438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T21:17:31.016Z","status":"ssl_error","status_checked_at":"2026-04-11T21:17:24.556Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","bash","docker","java","jdbc","mysql","powershell","quadcopter","remote-control","rest-api","robot","robotics","shell","spring-boot","websocket","websocket-api"],"created_at":"2024-11-13T23:28:05.095Z","updated_at":"2026-04-12T00:02:03.328Z","avatar_url":"https://github.com/sebastianbrzustowicz.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Robot Tasker API\n\nRobot Tasker API is a Java-based, server-side application created to establish fast and real-time communication with robots 'over the internet'.   \nIt is simple connector between the client and the vehicle with no redundant restrictions on the data transmitted.    \nSending desired control values or (less likely) tasks to robot is crucial in terms of connection speed.   \nTherefore 'over the internet' solutions are not so popular, as opposed to short-range methods.       \nIn this case, the WebSocket method was used, which provides high-speed data transfer. \nMoreover, this solution adds a teleoperational aspect to the robot control.  \nA multi-channel approach was used to implement the WebSocket, allowing server to handle multiple connections.  \nThe application uses a MySQL database to store user and vehicle information.  \n### Disclaimer\nComplete version which guarantee best performance is not available publicly.   \nOnly alpha version of API with license restrictions is available.   \nPlease contact me if you are interested in cooperation.   \nI am willing to help.  \n\n## Deploy\n\nAll in one deploy copy-paste commands for windows and linux systems.\n\nWindows:\n```powershell\nSet-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass\n.\\run_docker_commands.ps1\n```\nLinux:\n```console\nchmod +x run_docker_commands.sh\n./run_docker_commands.sh\n```\n\n## Docker\n\nFollow these commands if u want to make containers manually and adjust them to your prorities.\n\n### Database\n\nThe Dockerfile will provide containerisation and initialisation of the MySQL database.  \nThere is a set of commands to get to the same point when starting the application.  \nFirstly make sure you are in main project directory.   \nNow u can execute building process:   \n```console\ndocker build -t mysqlrobottaskerapi:latest -f Docker_Database/Dockerfile .\n```\nYou can then run the container with the default password or you can change it (don't forget to change it in the project properties too):\n```console\ndocker run --name robotTaskerApiDatabaseContainer -e MYSQL_ROOT_PASSWORD=sebastian -d -p 3306:3306 mysqlrobottaskerapi:latest\n```\nNow the MySQL container should run properly.\n\n### Server\n\nMain Dockerfile will provide containerisation and initialisation of the Java application database.  \nThere is a set of commands to get to the same point when starting the application.  \nMake sure you are in main project directory.   \nNow u can execute building process:   \n```console\ndocker build -t javarobottaskerapi:latest -f Docker_Server/Dockerfile .\n```\nI chose port 8081 for Java container, it is up to you.    \nYou can then run the container:\n```console\ndocker run --name robotTaskerAPIServerContainer -d -p 8080:8080 javarobottaskerapi:latest\n```\nNow the Java container should run properly.\n\n## Initialize development stage\n\nIf u want to make a changes to API u need to compile and run API created in Java.\nMake sure you are in main project directory.   \nFirstly install all dependencies:\n```console\nmvn clean install\n```\nThen run application:\n```console\nmvn spring-boot:run\n```\nNow everything should be set up.\n\n## Endpoints\n\nTwo architectures were used to create the API: Rest API and WebSocket.\n\n### Rest API\n\nRest API part embraces user and vehicle management issues.    \nSome of the options implemented are creating account, changing user's data, vehicle registration.\nRest endpoints for client only:    \n\n| HTTP method | endpoint | description | request type | response type |\n| -------------- | -------------- | -------------- | -------------- | -------------- |\n| :yellow_circle: POST | /rest/user/register | register new user | User | int |\n| :red_circle: DELETE | /rest/user/delete/{userId} | delete user | String | int |\n| :yellow_circle: POST | /rest/user/login | login user | \u0026lt;String, String\u0026gt; | String |\n| :purple_circle: PATCH | /rest/user/changedata | change user's data | User | String |\n| :large_blue_circle: PUT | /rest/admin/changedata | user data management | User | String |\n| :yellow_circle: POST | /rest/vehicle/register | register user's vehicle | \u0026lt;String, String\u0026gt; | String |\n| :yellow_circle: POST | /rest/vehicle/custom/register | register custom vehicle | Vehicle | String |\n| :green_circle: GET | /rest/vehicle/information | information about user's vehicles | String | List\u0026lt;Vehicle\u0026gt; |\n| :yellow_circle: POST | /rest/vehicle/delete | deregistration user's vehicle | String | String |\n\n### WebSocket\n\nA websocket approach was implemented for fast, real-time data transmission between the client and the vehicle.   \nWebsocket is implemented as multi-channel server-side application with STOMP approach.    \nAn example implementation of the publisher and subscriber can be found in the `WebSocket_manual_test` folder.    \nOne assumption made is that the vehicle should have its permanent vehicleId, which is similar to the MAC.    \nThe vehicleId should be registered for recognition and that is all.\nWebSocket endpoints for client (publisher) and vehicle (subscriber):      \n\n| STOMP method | endpoint | description | request type | response type |\n| -------------- | -------------- | -------------- | -------------- | -------------- |\n| :yellow_circle: CONNECT | /app/vehicle/connect | create new channel | String | null |\n| :red_circle: DISCONNECT  | /app/vehicle/disconnect | delete channel | String | null |\n| :yellow_circle: CONNECT | /websocket-endpoint | connect vehicle to ws | null | null |\n| :red_circle: DISCONNECT  | not implemented | disconnect vehicle from ws | null | null |\n| :green_circle: SUBSCRIBE  | /topic/vehicle-status/{vehicleId} | connection status | null | String |\n| :green_circle: SUBSCRIBE  | /topic/vehicle-data/{vehicleId} | get actual data | null | String |\n| :large_blue_circle: SEND  | /app/vehicle/connect | connect to specific vehicle | String | null |\n| :large_blue_circle: SEND  | /app/vehicle/disconnect | disconnect from specific vehicle | String | null |\n| :large_blue_circle: SEND  | /app/vehicle/data | send actual data to vehicle | String | null |\n\nImplemented WebSocket for specific frame formats outlined in the 'Data transmitted to vehicle' section.      \nThis WebSocket is single channel version for local use.       \nIt is helpful for development, debugging and testing new features.      \n\n| STOMP method | endpoint | description | request type | response type |\n| -------------- | -------------- | -------------- | -------------- | -------------- |\n| :large_blue_circle: SEND | /websocket-single-room | local WebSocket channel | String | String |\n\n## MySQL database\n\nA MySQL database was used to store user and vehicle information.    \nThe entire database is containerised using Docker.    \nThe JDBC interface has been used to create a connection to the database.    \n\n### Table: robotTaskerApi.users\n\n| Column Name   | Data Type             | Constraints     |\n|---------------|-----------------------|-----------------|\n| userId        | VARCHAR(36)           | PRIMARY KEY     |\n| login         | VARCHAR(255) NOT NULL |                 |\n| password      | VARCHAR(255) NOT NULL |                 |\n| email         | VARCHAR(255) NOT NULL |                 |\n| phoneNum      | INT NOT NULL          |                 |\n| role          | VARCHAR(50) NOT NULL  |                 |\n| accCreated    | DATETIME NOT NULL     |                 |\n\n### Table: robotTaskerApi.vehicles\n\n| Column Name   | Data Type             | Constraints     |\n|---------------|-----------------------|-----------------|\n| vehicleId     | VARCHAR(255) NOT NULL | PRIMARY KEY     |\n| userID        | VARCHAR(36) NULL      | FOREIGN KEY (userId) REFERENCES robotTaskerApi.users(userId) |\n| vehicleName   | VARCHAR(255) NOT NULL |                 |\n| vehicleType   | VARCHAR(50) NOT NULL  |                 |\n| registrationTime | DATETIME NULL      |                 |\n\n## Data transmitted to vehicle\n\nThe data transferred have to be the same type in client and vehicle.    \nHandshake should be established between server and client according to data order.    \nThe software provides auto-response after receiving message.      \nKeywords and types may vary depending on vehicle type used.     \nCurrent state of object is fitting quadcopter data.     \nThe data is sent and received in raw string format and its values stands for variables below.      \n\nFrom client:\n\n```\nVEHICLE                                 // \u003c- fixed prefix for vehicle message\n0                                       // \u003c- actual roll from sensor\n0                                       // \u003c- actual pitch from sensor\n0                                       // \u003c- actual yaw from sensor\n0                                       // \u003c- actual altitude from sensor\n0                                       // \u003c- actual isClamp\nEND                                     // \u003c- fixed ending statement of message\n```\n\nFrom vehicle:\n\n```\nCLIENT                                  // \u003c- fixed prefix for client message\n4436ed9a-5228-46c0-b825-6d0a3cd90437    // \u003c- vehicleId\n1                                       // \u003c- mode\n0                                       // \u003c- vtol\n0                                       // \u003c- x\n0                                       // \u003c- y\n0                                       // \u003c- alt\n0                                       // \u003c- yaw\nfalse                                   // \u003c- camTrig\nfalse                                   // \u003c- camTog\n0                                       // \u003c- camPitch\nfalse                                   // \u003c- clamp\nEND                                     // \u003c- fixed ending statement of message\n```\n\n## Tests\n\nSome simple JUnit tests have been implemented:\n```java\ntestRegisterUser_SuccessfulRegistration()\ntestRegisterUser_FailedRegistration()\ntestLoginUser_SuccessfulLogin()\ntestLoginUser_FailedLogin()\ntestRegisterVehicle_SuccessfulRegistration()\ntestRegisterVehicle_FailedRegistration()\ntestDeleteVehicle_SuccessfulDeletion()\ntestDeleteVehicle_FailedDeletion()\ntestChangeUserData_SuccessfulChange()\ntestChangeUserData_FailedChange()\ntestChangeUserDataByAdmin_SuccessfulChange()\ntestChangeUserDataByAdmin_FailedChange()\ntestRegisterCustomVehicle_SuccessfulRegister()\ntestRegisterCustomVehicle_FailedRegister()\n```\n\n## License\n\nRobot Tasker API is released under the CC BY-NC-ND 4.0 license.\n\n## Author\n\nSebastian Brzustowicz \u0026lt;Se.Brzustowicz@gmail.com\u0026gt;\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbrzustowicz%2Frobot-tasker-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastianbrzustowicz%2Frobot-tasker-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastianbrzustowicz%2Frobot-tasker-api/lists"}