<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Arto Liukkonen on Medium]]></title>
        <description><![CDATA[Stories by Arto Liukkonen on Medium]]></description>
        <link>https://medium.com/@artoliukkonen?source=rss-61a5fe15dcb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1fXadV2u5Bmo9aj7</url>
            <title>Stories by Arto Liukkonen on Medium</title>
            <link>https://medium.com/@artoliukkonen?source=rss-61a5fe15dcb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:04:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@artoliukkonen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Real-world serverless — Building my holy grail (part 1)]]></title>
            <link>https://medium.com/nordcloud-engineering/real-world-serverless-building-my-holy-grail-part-1-424db6118bdb?source=rss-61a5fe15dcb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/424db6118bdb</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[serverless]]></category>
            <dc:creator><![CDATA[Arto Liukkonen]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 10:59:44 GMT</pubDate>
            <atom:updated>2020-06-04T11:14:15.669Z</atom:updated>
            <content:encoded><![CDATA[<h3>Real-world serverless — Building my holy grail (part 1)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7aMqx31n-X29RLgqKJrzSQ.png" /><figcaption>Illustrations by <a href="https://www.instagram.com/eijahelenaphotography/">Eija Jokilahti</a></figcaption></figure><p>I started my serverless journey over four years ago, and looking at commit logs it’s almost exactly four years since the first commit in my first serverless customer project. I started with the <a href="https://serverless.com/">Serverless Framework</a> &amp; <a href="https://aws.amazon.com/serverless/">AWS</a>, and these are still my #1 tool. Serverless Framework got a major upgrade from 0.X to 1.X in late ’16 but after that, there haven’t been any major changes. Of course, both SLS and AWS have received tons of new features, but the core functionality has stayed the same.</p><p>During my serverless journey, I’ve used <a href="https://github.com/artoliukkonen/serverless-es6-boilerplate">my own</a>, <a href="https://github.com/christophgysin/serverless-boilerplate/">fellow nordcloudian’s</a>, and also some open-source boilerplates. This spring I noticed that my boilerplate had outdated, and I ended up choosing random templates whenever I started a new project. I found many new good practices &amp; tools and basically started a quest for my “serverless holy grail”.</p><h4>Why yet another boilerplate?</h4><p>I think that having a well-crafted boilerplate and knowing it’s best practices is a must-have when starting new projects basically every month. Solving problems with the development environment, setting up CI/CD, and doing other non-productive functions should be a one-time job.</p><p>Requirements of course change and new tools come up all the time. At least for me, boilerplate is also a way to focus on the most important things; it’s not always necessary to learn and start using all the latest tools. If there really is some big new thing or requirement, I can, of course, add it as a part of my solution.</p><h4>Requirements</h4><p>As <a href="https://www.typescriptlang.org/">TypeScript</a> is gaining momentum, I also chose to jump on that train. I feel much more comfortable shipping code to production, as I can be (almost) sure that the typings are correct.</p><p>The second thing was the monorepo approach. Instead of having boilerplate for a simple single serverless project, I often ended up in a situation where I needed to split my stack into multiple parts. Also when doing personal projects or projects where I’m the only developer, it’s convenient to have also the frontend codes in the same repository.</p><p>The third thing I wanted to solve is the unified approach for CI/CD pipeline. Too many times I found myself struggling to set up the pipeline with various tools.</p><h4>My Serverless tools 2020</h4><ul><li>Serverless Framework</li><li>TypeScript</li><li><a href="https://lerna.js.org/">Lerna</a></li><li>Yarn Workspaces (switch to NPM7 once it’s released)</li><li>CircleCI or Github Actions or AWS Cloud* tools</li><li>Webpack or Parcel</li><li><a href="https://github.com/Theodo-UK/sls-dev-tools">sls-dev-tools</a> (maybe, is suitable for monorepo?)</li></ul><p>As you can see there are still a few things that are left to be decided on what would be my #1 option for the boilerplate. The dream would be to be able to use this both on personal projects but also on customer projects that I do at Nordcloud.</p><p>Do <strong>you</strong> have any suggestions/experiences around these tools? Or is there some cool tool that I’m missing? As far as I’ve found, <a href="https://github.com/erezrokah/serverless-monorepo-app">this repository by erezrokah</a> is very close to what I’m trying to achieve.</p><p>The next part of this blog post is coming in June and by that date, I expect to have boilerplate published on <a href="https://github.com/artoliukkonen">my Github</a>. Thank you if you got this far reading, and welcome to my journey to build the best possible serverless boilerplate.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=424db6118bdb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/real-world-serverless-building-my-holy-grail-part-1-424db6118bdb">Real-world serverless — Building my holy grail (part 1)</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Controlling lights with Ikea Trådfri, Raspberry Pi and AWS]]></title>
            <link>https://medium.com/nordcloud-engineering/controlling-lights-with-ikea-tr%C3%A5dfri-raspberry-pi-and-aws-edb2827d8b3f?source=rss-61a5fe15dcb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/edb2827d8b3f</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[smart-lighting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[tradfri]]></category>
            <dc:creator><![CDATA[Arto Liukkonen]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 09:16:06 GMT</pubDate>
            <atom:updated>2020-04-17T07:31:08.366Z</atom:updated>
            <content:encoded><![CDATA[<p>A few months back we purchased Ikea Trådfri smart lights to our home. However, after the initial hype, those were almost forgotten as controlling was just too complicated via ready-made tools. For example, the Ikea Home app works only on mobile and it’s only possible to use it when connected to wifi. Luckily, Trådfri offers an API for controlling the lights, so it was possible to build our customized UI.</p><h3>Connecting to Trådfri</h3><p>With quick googling, I found a tutorial by <a href="https://learn.pimoroni.com/tutorial/sandyj/controlling-ikea-tradfri-lights-from-your-pi">Pimoroni</a> that helped me get started. I already had Raspberry Pi running as a home server, so all it took was to download and install the required packages provided by the tutorial. However, at the time of writing this article (and implementing my solution), the Pimoroni tutorial was a bit outdated. Because of that I just couldn’t get the communication working, but after banging my head against the wall for a while I found out that in 2017 Ikea <a href="https://github.com/ggravlingen/pytradfri/issues/90">changed</a> the authentication method. I’ve contacted Pimoroni and asked them to update the article.</p><p>After getting the communication between Raspberry Pi and Trådfri Gateway working I started writing the middleware server on Raspberry Pi. As I’m a javascript developer I chose to build this with NodeJS. Luckily, there is a <a href="https://www.npmjs.com/package/node-tradfri-client">node-tradfri-client</a> package available that made the integration simple. Here’s a code example of how I’m connecting to Trådfri and storing the devices in application memory.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/92813fa39250b4e4a56a5fdf0bdc50c4/href">https://medium.com/media/92813fa39250b4e4a56a5fdf0bdc50c4/href</a></iframe><p>I also added ExpressJS to handle requests. With just a few lines of code, I had API endpoints for</p><ul><li>Listing all devices in our house</li><li>Toggling a lightbulb or socket</li><li>Turning lightbulb or socket on</li><li>Turning lightbulb or socket off</li><li>Setting brightness of a lightbulb</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b36bc2cb4762cbd21df98bb82b7e71bb/href">https://medium.com/media/b36bc2cb4762cbd21df98bb82b7e71bb/href</a></iframe><h3>Writing the client application</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/0*sMC1IKH5DAreAOaU" /><figcaption>Custom UI for our smart lights</figcaption></figure><p>As we wanted to control the lights from anywhere with any device, we chose to build a web app that can be used on a laptop, mobile, and tablet without installing. After the first POC, we decided on the most common use cases and Eija designed the UI on <a href="https://www.sketch.com/">Sketch</a>. Actual implementation was done using <a href="https://reactjs.org/">ReactJS</a> with help of <a href="https://ant.design/docs/react/use-with-create-react-app">Ant Design</a> and <a href="https://github.com/STRML/react-draggable">react-draggable</a>.</p><p><a href="https://github.com/artoliukkonen/tradfri-client"><strong>Source codes</strong> for the client app is available in my Github</a>.</p><h3>Making the app accessible from anywhere</h3><p>In Finland, we have fast and unlimited data plans on mobile and because of that we rarely have wifi enabled on mobile (nothing is more irritating than bad wifi connection on the yard). To solve this, we chose to publish the app to the public web. As the UI is built as a single-page app, it’s basically free to host it with AWS S3 and Cloudfront. Since Cloudfront domains are random strings, we decided that this is enough security for now. This means that knowing the Cloudfront domain, anyone can control our lights. If this becomes a problem, it’s quite simple to integrate some authentication methods too.</p><p>The app is also hosted on the Raspberry Pi on our local network, so guests can control the lights if they are connected to our wifi.</p><h3>The bridge between physical &amp; digital world is not yet seamless</h3><p>Even with this accessible application we quickly figured out that we still need physical control buttons for the lights. For example, when going upstairs and not bringing the phone with you, you might end up in a dark room without the possibility to turn on the lights. Luckily Ikea provides physical switches for the Trådfri lights, so we had to make one more Ikea trip to get the extra controller upstairs.</p><p>Another way to reduce the need for physical switches would be using a smart speaker with voice recognition. Unfortunately, only Apple Home Pod is the only speaker that currently understands Finnish and it’s a tad out of our budget and probably not possible to integrate into our system either. Once Amazon adds Finnish support for Alexa we’ll definitely try that.</p><p>…and while writing the previous chapter, I figured that since Apple supports Finnish, it’s possible to create a Siri Shortcut to control our lights. With few more lines of code in the web app, it now supports anchor links from Shortcut to trigger a preset lighting mode.</p><h3>Conclusion</h3><p>It’s great that companies like Ikea provide open access to their smart lights since at least for us the ready-made tooling was not enough. Also with the help of the AWS serverless offering, we can host this solution securely in the cloud for free. If you have any questions about our solution, please leave a comment below.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FS3hNQL3WZHGLJnThkJ%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2FS3hNQL3WZHGLJnThkJ&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="688" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c02ccfdfff0156fcaace0f49b5a253d/href">https://medium.com/media/8c02ccfdfff0156fcaace0f49b5a253d/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edb2827d8b3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nordcloud-engineering/controlling-lights-with-ikea-tr%C3%A5dfri-raspberry-pi-and-aws-edb2827d8b3f">Controlling lights with Ikea Trådfri, Raspberry Pi and AWS</a> was originally published in <a href="https://medium.com/nordcloud-engineering">Nordcloud Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>