{"id":7396,"date":"2019-08-31T12:04:38","date_gmt":"2019-08-31T10:04:38","guid":{"rendered":"https:\/\/blog.mi.hdm-stuttgart.de\/?p=7396"},"modified":"2023-06-18T18:22:52","modified_gmt":"2023-06-18T16:22:52","slug":"multiplayer-typescript-application-deploy-on-aws-services","status":"publish","type":"post","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/","title":{"rendered":"Multiplayer TypeScript Application run on AWS Services"},"content":{"rendered":"\n<p class=\"has-small-font-size\"><strong>Daniel Knizia<\/strong> &#8211; <em>dk100@hdm-stuttgart.de<\/em><br><strong>Benjamin Janzen<\/strong> &#8211;<em> bj009@hdm-stuttgart.de<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>The project<\/strong><\/h4>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"7440\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/catchme_icon-2\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1.png\" data-orig-size=\"1920,1920\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"catchMe_icon\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-1024x1024.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-1024x1024.png\" alt=\"\" class=\"wp-image-7440\" width=\"104\" height=\"104\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-1024x1024.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-150x150.png 150w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-300x300.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1-768x768.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/catchMe_icon-1.png 1920w\" sizes=\"auto, (max-width: 104px) 100vw, 104px\" \/><\/figure><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><\/p><p>CatchMe is a location-based multiplayer game for mobile devices. The idea stems from the classic board game Scotland Yard, basically a modern version of hide &amp; seek. You play in a group with up to 5 players outside, where on of the players gets to be chosen the &#8220;hunted&#8221;. His goal is trying to escape the other players. Through the app he can constantly see the movement of his pursuers, while the other players can only see him in set intervals.<\/p><cite><br>The backend  of the game builds on <a href=\"https:\/\/colyseus.io\/\">Colyseus<\/a>,  a multiplayer game server for Node.js, which we have adjusted to our needs. There&#8217;s a lobby, from which the players can connect into a room with other players and start the game.<\/cite><\/blockquote>\n\n\n\n<!--more-->\n\n\n\n<h4 class=\"wp-block-heading\">Goal<\/h4>\n\n\n\n<p>One of our intentions for this project was, to learn more about cloud in general and how we can in integrate it in the development of our app. Basically a big playground to learn and test new concepts and further our software development skills. The following should give you a brief overview of our experience and problems we. <br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">The Beginning<\/h4>\n\n\n\n<p>A pictures says more than a 1000 words! Here was our first attempt to understand cloud computing in general and trying to figure out, how we can get our app there. For this we had several conversations with various specialists.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"730\" data-attachment-id=\"7402\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/versuch_02\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02.jpg\" data-orig-size=\"1920,1369\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"Versuch_02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02-1024x730.jpg\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02-1024x730.jpg\" alt=\"\" class=\"wp-image-7402\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02-1024x730.jpg 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02-300x214.jpg 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02-768x548.jpg 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Versuch_02.jpg 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>Image creation with a &#8220;technical VMware vCloud expert&#8221;<\/figcaption><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p><a href=\"https:\/\/www.golem.de\/news\/aws-azure-alibaba-ibm-cloud-wo-die-cloud-hilft-und-wo-nicht-1901-138497-4.html\">Where the cloud helps and where not &#8230;<\/a><\/p><cite>It is worth reading the article form the front and not only the part that is relevant for our current section <br><\/cite><\/blockquote>\n\n\n\n<h4 class=\"wp-block-heading\">AWS Elastic Beanstalk<\/h4>\n\n\n\n<p>We started of doing some research and comparing various cloud provider (e.g. Google, IBM, Microsoft, Amazon) to find out about their services and payment models. The free tier model and the alleged simplicity of deploying an app with Elastic Beanstalk let us to the decision to use Amazons web services (AWS). With basically the touch of a button you get a full environment with multiple server instances, load balancing, database etc. Just upload your code and you are all set, well at least in theory&#8230;<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Deploying Typescript to Elastic Beanstalk and automatin the process with Gitlab Ci\/CD Pipline<\/h4>\n\n\n\n<p>One of the bigger problems we encountered was deploying our Typscript app. Since you can&#8217;t directly run Typscript on the Elastic Beanstalk we&#8217;ve found a little workaround by compiling it first into Javascript and than using Gitlabs CI\/CD Pipeline to automate the process. In the following we just want to briefly illustrate the steps we took to get everythin running.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"385\" data-attachment-id=\"8528\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/health_degraded\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded.jpeg\" data-orig-size=\"1382,519\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Health_degraded\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded-1024x385.jpeg\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded-1024x385.jpeg\" alt=\"\" class=\"wp-image-8528\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded-1024x385.jpeg 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded-300x113.jpeg 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded-768x288.jpeg 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/Health_degraded.jpeg 1382w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>In the <code class=\"\" data-line=\"\">tsconfig.json<\/code>, which specify the compile options for Typscript, we set the output directory to <code class=\"\" data-line=\"\">dist<\/code>. We than altered the  <code class=\"\" data-line=\"\">scripts<\/code> section of our <code class=\"\" data-line=\"\">package.json<\/code> and added a build script so that we can compile the application with <code class=\"\" data-line=\"\">npm run build<\/code> and start than the compiled Javascript application directly from <code class=\"\" data-line=\"\">dist<\/code> folder with<code class=\"\" data-line=\"\">npm start<\/code>. (<a href=\"https:\/\/www.errietta.me\/blog\/typescript-circleci-aws-beanstalk\/\">Link<\/a>)<\/li><li> That&#8217;s what our <code class=\"\" data-line=\"\">tsconfig.json<\/code> looks like:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">        {\n        &quot;compilerOptions&quot;: {\n            &quot;outDir&quot;: &quot;dist&quot;,\n            &quot;target&quot;: &quot;es6&quot;,\n            &quot;module&quot;: &quot;commonjs&quot;,\n            &quot;strict&quot;: true,\n            &quot;esModuleInterop&quot;: true,\n            &quot;experimentalDecorators&quot;: true\n        }\n        }<\/code><\/pre>\n\n\n\n<p>That&#8217;s the script section of our <code class=\"\" data-line=\"\">package.json<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">  &quot;scripts&quot;: {\n    &quot;build&quot;: &quot;tsc&quot;,\n    &quot;start&quot;: &quot;node dist\/index.js&quot;\n  },<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>We than simply set up a hook for gitlab with is executed before every commit. For that we simply had to create the file .git\/hooks\/pre-commit in your repo add the following lines:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">        npm install\n        npm run build\n        git add .<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>To even see the CI\/CD option we first had to to create a <code class=\"\" data-line=\"\">.gitlab-ci.yml<\/code> file in our repository root folder.<\/li><li>For saftey reasons we created  and AWS IAM User with only the AWSElasticBeanstalkFullAccess Policy. <a href=\"https:\/\/medium.com\/dowebthings\/how-to-deploy-from-gitlab-to-elastic-beanstalk-aws-cdac7b701004\">(Link<\/a>)<\/li><li>We than saved that access Id  and KEY as Variables in the CI \/ CD settings of the Gitlab repository.<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"983\" height=\"360\" data-attachment-id=\"8497\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/variables\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables.png\" data-orig-size=\"983,360\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"variables\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables.png\" alt=\"\" class=\"wp-image-8497\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables.png 983w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables-300x110.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/variables-768x281.png 768w\" sizes=\"auto, (max-width: 983px) 100vw, 983px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>We then proceeded to install our own Gitlab Runner on a seperate AWS EC2 Instance, (though Gitlabs shared runner worked fine as well) and registered it in the settings of our Gitlab Repository (<a href=\"https:\/\/blog.powerupcloud.com\/deploy-python-application-on-aws-elasticbeanstalk-using-gitlab-runner-8982fb26e4a4\">Link<\/a>)<\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"8495\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/runner_setup\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/runner_setup.png\" data-orig-size=\"430,480\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"runner_setup\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/runner_setup.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/runner_setup.png\" alt=\"\" class=\"wp-image-8495\" width=\"341\" height=\"381\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/runner_setup.png 430w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/runner_setup-269x300.png 269w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>With the EB CLI installed we initalized the the repository with <code class=\"\" data-line=\"\">eb init<\/code> and adjusted our <code class=\"\" data-line=\"\">.gitlab-ci.yml<\/code>. We used the image coxauto\/aws-ebcli from the offical Docker Hub, which comes with the EB CLI already installed and $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY are the variables we set in our settings for the IAM users access id and key.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\" data-line=\"\">        development:\n        image: coxauto\/aws-ebcli\n        type: deploy\n        environment: production\n        script:\n        - touch ~\/.aws\/credentials\n        - printf &quot;[eb-cli]\\naws_access_key_id = %s\\naws_secret_access_key = %s\\n&quot; &quot;$AWS_ACCESS_KEY_ID&quot; &quot;$AWS_SECRET_ACCESS_KEY&quot; &gt;&gt; ~\/.aws\/credentials\n        - touch ~\/.aws\/config\n        - printf &quot;[profile eb-cli]\\nregion=eu-central-1\\noutput=json&quot; &gt;&gt; ~\/.aws\/config\n        - eb deploy Catchmeserver-env\n        only:\n        - master<\/code><\/pre>\n\n\n\n<p>Before every new commit our Application is now getting automatically compiled to Javascript. After every push to the master branch of the repository the Gitlab runner deploys with help of the EB CLI the application our Elastic Beanstalk. Of course this is still far from ideal. The proper way would be to run first lints and test before and have different stages and branches which we omitted here for brevity \ud83d\ude42<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"386\" data-attachment-id=\"8529\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/health_ok\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok.png\" data-orig-size=\"1397,527\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"health_ok\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok-1024x386.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok-1024x386.png\" alt=\"\" class=\"wp-image-8529\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok-1024x386.png 1024w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok-300x113.png 300w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok-768x290.png 768w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/health_ok.png 1397w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If everything is green and you still having issues it might be well worth your time checking out the logs for your Elastic Beanstalk ;). We didnt realize that the boilerplate code for our  app  specified, next to the standard colyseus port 2567, the systems enviroment port which got used instead.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">AWS Lambda<\/h4>\n\n\n\n<p>After we had our app successfully running, we tried to use other services of  AWS. For example, for our mathematical calculations we wanted to use the Lambda function. E.g. the calculation for the distance of two players with the Haversine formula.<\/p>\n\n\n\n<p><strong>Creating the Lambda function <\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"604\" height=\"392\" data-attachment-id=\"7429\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/image-22\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-21.png\" data-orig-size=\"604,392\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-21.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-21.png\" alt=\"\" class=\"wp-image-7429\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-21.png 604w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-21-300x195.png 300w\" sizes=\"auto, (max-width: 604px) 100vw, 604px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"7431\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/image-24\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-23.png\" data-orig-size=\"604,572\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-23.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-23.png\" alt=\"\" class=\"wp-image-7431\" width=\"320\" height=\"303\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-23.png 604w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-23-300x284.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><figcaption>Our lambda function<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li>Under AWS Services go to AWS Lambda <\/li><li>Create a new Function in your preferred language (we used python)<\/li><li>Implement your code. The body that&#8217;s beeing send to your Lambda function are getting saved into a dictionary `event`. You can access the key-value pairs by e.g. event[&#8220;key&#8221;]<\/li><li>You can write test events to feed data into your lamba function.<\/li><\/ol>\n\n\n\n<p><strong>Exposing your Lambda\nfunction<\/strong><\/p>\n\n\n\n<p>To use the lamba function in your code you need a API Gateway first.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright is-resized\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"7436\" data-permalink=\"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2019\/08\/31\/multiplayer-typescript-application-deploy-on-aws-services\/image-28\/\" data-orig-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-27.png\" data-orig-size=\"605,365\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-27.png\" src=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-27.png\" alt=\"\" class=\"wp-image-7436\" width=\"382\" height=\"229\" srcset=\"https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-27.png 605w, https:\/\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2019\/08\/image-27-300x181.png 300w\" sizes=\"auto, (max-width: 382px) 100vw, 382px\" \/><figcaption> Usingthe Lamba function  in our code<\/figcaption><\/figure><\/div>\n\n\n\n<ol class=\"wp-block-list\"><li>Under AWS Services go to API Gateway <\/li><li>Create a new REST-API<\/li><li>Create a new Resource under Action<\/li><li>Under Action use &#8220;Create Method&#8221; choose the HTTP method with which you want to &#8220;talk&#8221; to your lambda function (we used POST). <\/li><li>Choose the lambda function you access.<\/li><li>Under Action you can now Deploy the API<\/li><li>You find the URL on the left under Stages<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Daniel Knizia &#8211; dk100@hdm-stuttgart.deBenjamin Janzen &#8211; bj009@hdm-stuttgart.de The project CatchMe is a location-based multiplayer game for mobile devices. The idea stems from the classic board game Scotland Yard, basically a modern version of hide &amp; seek. You play in a group with up to 5 players outside, where on of the players gets to be [&hellip;]<\/p>\n","protected":false},"author":941,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[120,649,262],"tags":[77,73,298,83,145,25,296],"ppma_author":[797],"class_list":["post-7396","post","type-post","status-publish","format-standard","hentry","category-cloud-technologies","category-interactive-media","category-rich-media-systems","tag-amazon-web-services","tag-automation","tag-aws-elastic-beanstalk","tag-aws-lambda","tag-gitlab-ci","tag-nodejs","tag-typescript"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":11267,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2020\/09\/29\/montagsmaler-multiplayer-online-game-running-on-amazon-web-services\/","url_meta":{"origin":7396,"position":0},"title":"Montagsmaler \u2013 Multiplayer online game running on Amazon Web Services","author":"ns107","date":"29. September 2020","format":false,"excerpt":"by Jannik Smidt (js343), Niklas Schildhauer (ns107) and Lucas Cr\u00e4mer (lc028) Project idea Montagsmaler is a multiplayer online game for web browsers. The idea is derived from the classic Pictionary game, where players have to guess what one person is painting. Basically, we have built the digital version of it,\u2026","rel":"","context":"In &quot;Cloud Technologies&quot;","block_context":{"text":"Cloud Technologies","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/scalable-systems\/cloud-technologies\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/Untitled-Diagram.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/Untitled-Diagram.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/Untitled-Diagram.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/Untitled-Diagram.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":11763,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2020\/09\/30\/peer2peer-multiplayer-real-time-strategy-game-admiral-ww2\/","url_meta":{"origin":7396,"position":1},"title":"Peer2Peer Multiplayer Real-time Strategy Game \u201cAdmiral: WW2\u201d","author":"Paul Mieschke","date":"30. September 2020","format":false,"excerpt":"3D Unity Peer-to-Peer Multiplayer Game Admiral: WW2","rel":"","context":"In &quot;Cloud Technologies&quot;","block_context":{"text":"Cloud Technologies","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/scalable-systems\/cloud-technologies\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/AdmiralWW2_Architecture_Overview.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/AdmiralWW2_Architecture_Overview.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2020\/09\/AdmiralWW2_Architecture_Overview.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":26265,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2024\/08\/30\/todogrow\/","url_meta":{"origin":7396,"position":2},"title":"TODO:Grow \u2014 A Cloud Sandbox for Aspiring Coders","author":"Dominik Mezler","date":"30. August 2024","format":false,"excerpt":"Give someone a program; you frustrate them for a day; teach them how to program, and you frustrate them for a lifetime. David Leinweber The following project was created within\/for the lecture \"Software Development for Cloud Computing\" (113479A) in the summer semester of 2024. I never worked with any ...\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2024\/08\/architecture-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2024\/08\/architecture-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2024\/08\/architecture-2.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2024\/08\/architecture-2.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":25865,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2023\/09\/15\/guess-what-we-built-a-web-game-with-firebase\/","url_meta":{"origin":7396,"position":3},"title":"Guess What? We Built a Web Game with Firebase","author":"mc071","date":"15. September 2023","format":false,"excerpt":"What is more or less? \"More or Less\" is a guessing game where you guess which item has a higher value for a specific attribute. For example, in the \"Commit Clash: Which GitHub repo has more commits?\" mode, you see one GitHub repository's commit count and another repository. You have\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/1_guessing_game.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/1_guessing_game.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/1_guessing_game.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/1_guessing_game.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/1_guessing_game.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":1863,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2017\/02\/23\/building-an-hdm-alexa-skill-part-2\/","url_meta":{"origin":7396,"position":4},"title":"Building an HdM Alexa Skill &#8211; Part 2","author":"Andreas Fliehr","date":"23. February 2017","format":false,"excerpt":"We present our own HdM Alexa Skill and share the experience we gained throughout this project. This time: Decisions, Developed Modules and Implementation.","rel":"","context":"In &quot;Cloud Technologies&quot;","block_context":{"text":"Cloud Technologies","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/scalable-systems\/cloud-technologies\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/02\/data_flow.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/02\/data_flow.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/02\/data_flow.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/02\/data_flow.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2017\/02\/data_flow.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":25800,"url":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/2023\/09\/14\/splid-2-0-die-zukunft-des-gemeinsamen-ausgabenmanagements\/","url_meta":{"origin":7396,"position":5},"title":"Splid 2.0 &#8211; Die Zukunft des gemeinsamen Ausgabenmanagements","author":"David Christoph Scheifers","date":"14. September 2023","format":false,"excerpt":"Im Rahmen der Vorlesung \u201cSoftware Development for Cloud Computing\u201d haben wir uns daf\u00fcr entschieden, einen Klon der App Splid auf Basis unterschiedlicher Cloud Technologien als Web App zu entwickeln, um uns so die Grundkenntnisse des Cloud Computings anzueignen. Projektidee Bei gemeinsamen Aktivit\u00e4ten und Gruppenausgaben ist es sehr hilfreich, einfache und\u2026","rel":"","context":"In &quot;Allgemein&quot;","block_context":{"text":"Allgemein","link":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/category\/allgemein\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/blog.mi.hdm-stuttgart.de\/wp-content\/uploads\/2023\/09\/image6.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"authors":[{"term_id":797,"user_id":941,"is_guest":0,"slug":"bj009","display_name":"bj009","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/c7b560bd68b9e812426030dd53fd93f618331293d3f45505020cf668ed30ccf0?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7396","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/users\/941"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/comments?post=7396"}],"version-history":[{"count":48,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7396\/revisions"}],"predecessor-version":[{"id":8800,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/posts\/7396\/revisions\/8800"}],"wp:attachment":[{"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/media?parent=7396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/categories?post=7396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/tags?post=7396"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mi.hdm-stuttgart.de\/index.php\/wp-json\/wp\/v2\/ppma_author?post=7396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}