{"id":18588964,"url":"https://github.com/salaboy/fmtok8s-game-controller","last_synced_at":"2025-08-31T14:42:37.220Z","repository":{"id":111457829,"uuid":"458756909","full_name":"salaboy/fmtok8s-game-controller","owner":"salaboy","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-10T07:59:44.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-17T19:14:25.039Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/salaboy.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":"2022-02-13T08:54:31.000Z","updated_at":"2022-03-20T19:02:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"0ce5b9a8-9712-4575-b81f-a59f32af8c95","html_url":"https://github.com/salaboy/fmtok8s-game-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaboy%2Ffmtok8s-game-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaboy%2Ffmtok8s-game-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaboy%2Ffmtok8s-game-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salaboy%2Ffmtok8s-game-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salaboy","download_url":"https://codeload.github.com/salaboy/fmtok8s-game-controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254488354,"owners_count":22079415,"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":[],"created_at":"2024-11-07T00:49:48.549Z","updated_at":"2025-05-16T07:34:10.992Z","avatar_url":"https://github.com/salaboy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FMTOK8s :: Game Controller\n\nThis project is a simple game controller that is in charge of creating new Game Sessions, checking available levels and keep track of in which level each player is. \n\n## Build \u0026 Run\n\nTo build this project you can run: \n```\nmvn package\n```\n\nTo run this project you can run: \n```\nmvn spring-boot:run\n```\n\nTo deploy this project you can use the `mvn spring-boot:build-image` goal to create a container that you can tag and push to a docker registry:\n\n```\nmvn spring-boot:build-image\n\n```\n\nThen tag and push: \n```\ndocker tag fmtok8s-game-controller:0.0.1-SNAPSHOT salaboy/fmtok8s-game-controller:0.1.0\ndocker push salaboy/fmtok8s-game-controller:0.1.0\n\n```\n\nFinally, you can deploy this project to a Kubernetes Cluster (with Knative Serving and Eventing installed) by running: \n\n```\nkubectl apply -f config/\n```\n\nNotice that this also install a Knative Eventing Trigger that will be listening for `LevelCompletedEvent` Cloud Events. \n\n\n## Example Requests\n\nTo create a new Session: \n```\ncurl -X POST http://localhost:8082/  \n```\n\nUse the `sessionId` for the CloudEvents payload: \n\n```\ncurl -v \"http://localhost:8082/events\" \\                                     \n-H \"Content-Type:application/json; charset=UTF-8\" \\\n-H \"Ce-Id:1\" \\\n-H \"Ce-Subject:test\" \\\n-H \"Ce-Time:2022-02-10T09:32:27.875Z\" \\\n-H \"Ce-Source:cloud-event-example\" \\\n-H \"Ce-Type:LevelCompletedEvent\" \\\n-H \"Ce-Specversion:1.0\" \\\n-d \"{\\\"sessionId\\\": \\\"game-e71ac906-c4d3-4188-9c54-abc247ccbaa0\\\", \\\"levelId\\\": \\\"1\\\"}\\\"\"\n\n```\n\nGet Single session: \n```\ncurl http://localhost:8082/sessions/game-e71ac906-c4d3-4188-9c54-abc247ccbaa0\n```\n\nGet all sessions: \n\n```\ncurl http://localhost:8082/sessions/\n```\n\nTo check available levels: \n\n```\ncurl http://localhost:8082/levels\n```\n\nTo check specific level by name:\n\n```\ncurl http://localhost:8082/levels/level-1\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaboy%2Ffmtok8s-game-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalaboy%2Ffmtok8s-game-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalaboy%2Ffmtok8s-game-controller/lists"}