<?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 Roland Treiber on Medium]]></title>
        <description><![CDATA[Stories by Roland Treiber on Medium]]></description>
        <link>https://medium.com/@hello-85764?source=rss-bbfa5fecc5f5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nOIt6JdmQTN7Dtyn9VfByA.png</url>
            <title>Stories by Roland Treiber on Medium</title>
            <link>https://medium.com/@hello-85764?source=rss-bbfa5fecc5f5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 04:53:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hello-85764/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[My predictions on vibe coding]]></title>
            <link>https://hello-85764.medium.com/my-predictions-on-vibe-coding-ff63f03e745c?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff63f03e745c</guid>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 08:43:45 GMT</pubDate>
            <atom:updated>2025-04-21T08:55:08.127Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*CTwR7ZrnUOwm-56ft3SF4A.jpeg" /></figure><p>In this article I attempt to make a solid argument of why vibe coding is transforming everything already, where it leads us and what it will do to the tech industry in general in upcoming years.</p><h4>Introduction</h4><p>Vibe coding is a trend for a reason. If there was no reason, it wouldn’t exist. Like with many other trends, the strongest argument is simplification and time saving. We humans are very good at automating things, batching tasks, optimization and working hard to make our lives easier.</p><p>Until we find ourselves bored for a brief second and start thinking about what more we can do to fill our brief time on this planet. Given that most tasks now take fraction of the time they used to, we feel the urge to fill the time with something new. This is why, despite having substantially more processing power in our pockets than what was used at the Moon landing, we have more to do than ever. If you think about it, our life should be filled with joy and freedom while machines would do absolutely everything we do not want to.</p><p>It is fair to say that outsourcing things to machinery is not new and AI simply falls in line with this tendency, but there is a significant twist!</p><h4>Humans, horses and automobiles</h4><p>The trend is old, yet it is significantly different in one major respect! It is our smarts that is outsourced this time and this is scary.</p><p>Let’s make the comparison with the simple concept of transportation. The first chariots appeared around 3000BC, which were arguably huge improvement in transportation at the time. Using horses and machinery to outsource manual labour was a huge leap forward. The convenience and speed increase was stunning and transformed economies. The first motor car was invented in 1885 and humanity didn’t look back since. We strive for innovation and enjoy its benefits a lot!</p><p>So why are cars still not fully autonomous? They can now run on clean electricity, are connected to satellites, faster, more convenient and safer than ever, yet still we are still holding on to the steering wheel like our life depended on it (pun intended). We somehow aren’t comfortable with the idea of letting go of control completely. In his book <a href="https://www.amazon.co.uk/Four-Thousand-Weeks-Embrace-Limits/dp/B09233TW54/ref=sr_1_1?adgrpid=124010454846&amp;dib=eyJ2IjoiMSJ9.kQeekXDOMx7ZxuzKQlr6Xn7qWu3FA8fuWASIkwPsUQ0bhPTaHp4yhUzATdFBlXcVjObtGVULmQb-K2FGokhhDGRuyW3AXGkGyZeJGjxzzBy36eYPIqcuGCHvFr0nf7FhCUbakp20jQzW0wM18pnWEgsa4jmzOc35CAszs3O7rYCBcW_-Df7Yy0y-0ECYsUYzYq9ixVvneWTIQMvu46zZfRL8iBPPrF9tsF_XknD7OF0.h0dr4I5xWDEREOI3b1LfxIe-bwYrtdiYKg8T-9tfRb4&amp;dib_tag=se&amp;hvadid=535609874834&amp;hvdev=c&amp;hvlocphy=1007420&amp;hvnetw=g&amp;hvqmt=e&amp;hvrand=2907650966026797695&amp;hvtargid=kwd-1405244515165&amp;hydadcr=24401_1816044&amp;keywords=4000+weeks+book&amp;mcid=45d7c5643969352fad6edcaa47b2339b&amp;qid=1745219835&amp;sr=8-1">Four Thousand Weeks</a>, Oliver Burkeman explains so eloquently why some inconveniences are seen not only a positive but a major deciding factor for us humans. Ordering food online and never leaving the house is sure more convenient than strolling down to the Italian restaurant packed with people, yet the inconvenience of time spent and effort made are far outweigh by the benefits of human interaction and experience. So not all inconveniences are created equal and some are what we want in our lives no matter what.</p><p>Back to cars, it is easy to see that the inconvenience of driving is a good inconvenience — for now.</p><blockquote>I’d argue that driving will be replaced and fully automated as soon as humans find the activity to replace it with permanently, that is reliably and consistently more fun that driving a car.</blockquote><p>At this point it will become a bad inconvenience and so be eliminated.</p><h4>Evolution vs Innovation</h4><p>Innovation is hard work and is driven mostly by human intelligence and curiosity. This is what makes us the species capable and willing to destroy the very planet that sustains our living — for innovation.</p><p>Innovation is also the most aggressive form of evolution. It is like stepping out of line and jumping the queue. When life forms evolve, they do so in relation to changing environment, new threats, new opportunities and most importantly by adapting to the complex rules set by all others. Innovation on the other hand, has to do with a tiny subset of the problems and not considering the whole system. A new iPhone release is arguably good for those wasting all those precious milliseconds on load times and loathing the image quality produced by last year’s 5 lens setup vs the new 7 lens one. Not so sure about the benefits of the system as a whole.</p><blockquote>By innovation we are solving a problem and creating a few more to solve. That is by design.</blockquote><p>So the point to make here is that AI is good for many things, yet it falls under the category of innovation and so it does not only solves but creates problems too. This is broadly expected, yet we now have an educated insight of predicting what comes next if left unchecked.</p><h4>Livelock</h4><p>Software developers are mostly familiar with the term “Livelock”. For those who aren’t, here is the definition:</p><blockquote>Livelock occurs when two or more processes continually repeat the same interaction in response to changes in the other processes without doing any useful work.</blockquote><p>Is it just me, or solving a problem, creating another, solving it and creating another sounds a lot like a livelock situation?</p><p>When two threads end up in a livelock, they both do tremendous amount of work, yet will never achieve anything meaningful in the grand scheme of things. Surely completing the task at hand is an accomplishment, but if we zoom out and observe the code running for days without meaningful result, it is hardly an achievement.</p><blockquote>I believe that we might be living in a livelock already to an extent.</blockquote><p>I am not saying innovation is a livelock, but AI certainly can cause millions of micro livelocks and one great one for sure. As opposed to innovation, AI has the capacity to self-reinforce and induce the repetition of practices at increasing speed without sufficient outside input.</p><p>In his book <a href="https://www.amazon.co.uk/Anatomy-Breakthrough-unstuck-unlock-potential/dp/178870620X/ref=asc_df_178870620X?mcid=11eb19769c3438b5969a256b0f801dbc&amp;tag=googshopuk-21&amp;linkCode=df0&amp;hvadid=696883244320&amp;hvpos=&amp;hvnetw=g&amp;hvrand=18073116305056992707&amp;hvpone=&amp;hvptwo=&amp;hvqmt=&amp;hvdev=c&amp;hvdvcmdl=&amp;hvlocint=&amp;hvlocphy=1007420&amp;hvtargid=pla-1968203091798&amp;psc=1&amp;gad_source=1">The Anatomy of a Breakthrough</a>, Adam Alter explains that external influence inevitably leads to positive changes in a team even if it does not contain domain level expertise. In fact expertise has the tendency to narrow our thinking and therefore leave blind spots.</p><blockquote>This is important because a fresh perspective is often what leads to a breakthrough!</blockquote><p>What we also know, is that external “fresh” influence may be the seed, yet expertise is the soil.</p><h4>The long term effects of vibe coding</h4><p>So we talked about innovation, automobiles, livelock and good inconveniences so far but not a single word about vibe coding in general.</p><p>The reason for it is that these are all pieces of the same puzzle to give us the picture on the box.</p><p>We know that the internet is amazing, yet too much of it and not much else is definitely not what we want in our lives. The same is true for AI. Why? Because control is a good inconvenience. It takes time and effort to practice, but feels good - just like driving a car.</p><p>Building software is no different in this respect. The bad inconveniences are numerous:</p><ul><li>learning how to do it</li><li>gaining a decade of experience to reach senior level</li><li>continuously learning</li><li>having a more intimate relationship with your IDE than with your kids</li></ul><p>I certainly could enjoy a career path with less bad inconveniences and only the good ones. Coincidentally there are also quite a few of those such as:</p><ul><li>the satisfaction of getting the hang of it after a few years of practice</li><li>the regular sense of accomplishment taking the next level by learning</li><li>teaching your kids to code and bond with them over some TypeScript (based on true events)</li></ul><p>It is easy to see how one type of inconveniences can hardly exist without the other. Using AI to write code is great as long as it does not take the fun out of the process. Overdoing it is detrimental and leads to a reinforced livelock where we are losing control. Being free of the bad inconveniences feels great and is encouraged. Losing the good ones in the process is an unwanted potential side effect and is not fun at all!</p><p>In conclusion as a long time software engineer, I embrace good inconveniences and for a good reason. They are major part of the fun in this profession! I am also all for eliminating all bad ones. The key is to know the difference. We can evolve by doing it right, yet can end up in a frustrating livelock if we are not careful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff63f03e745c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I have spent 3 years developing an open source alternative to Shopify and you can use it now…]]></title>
            <link>https://hello-85764.medium.com/i-have-spent-3-years-developing-an-open-source-alternative-to-shopify-and-you-can-use-it-now-64c436711f97?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/64c436711f97</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[ecommerce-web-development]]></category>
            <category><![CDATA[etsy-seller]]></category>
            <category><![CDATA[shopify]]></category>
            <category><![CDATA[ecommerce-solution]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 08:34:40 GMT</pubDate>
            <atom:updated>2025-03-30T08:35:55.496Z</atom:updated>
            <content:encoded><![CDATA[<h3>I have spent 3 years developing an open source alternative to Shopify and you can use it now for your business</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-zXKAmX3daqmu3ocwQ5hww.png" /><figcaption>Shoptopus</figcaption></figure><p>Hello. Are you an e-commerce guru, developer, store owner or all of them in one person? Is this the most boring catch phrase you’ve read today so far?</p><p>Yes, I am aware of how cringy or buzzwordy an article like this can become, so I have other intentions. I want you to feel what I feel when I think about the project. Let’s dive in.</p><h3>The origins</h3><p>Imagine yourself sitting in your comfiest home office chair in front of a few screens sipping your coffee on a fine pandemic ridden morning in mid 2021. The World realized that certain things that can be done online, really should be done online.</p><p>Imagine that as an eager software engineer, you want your clients to have the full picture before committing to building a website, so you explain the benefits and downsides of various platforms over and over.</p><p>I found myself exactly in this situation back then and a pattern started to emerge. This gave me an idea, which led to start the Shoptopus project.</p><p>The e-commerce queries fell into one of the following categories.</p><ul><li>I want to test out my product idea…</li><li>I want to move away from a platform that locked me in…</li><li>I want to move away from the one click install thingy I have now because it takes an hour to load…</li><li>I just want my own store…</li><li>I want an advanced app but don’t want to start from scratch…</li></ul><blockquote>We problem solvers like pain points.</blockquote><p>Let’s evaluate what a business owner can do to get their products in front of eyeballs.</p><h3>Shopify, Etsy, Amazon, Ebay</h3><p>So we have the large platforms. They are first in Google search, they are everywhere and seem like an obvious choice.</p><blockquote>They are dead simple to set up</blockquote><p>There is no need for talking to a developer, coming up with a design and all that jazz, yet the store looks good, loads fast, can be integrated with a range of third parties and work well in general.</p><h4>So they are perfect right?</h4><p>Let’s not go there yet without evaluating the most common objections against these platforms.</p><h4>Hidden costs</h4><p>This is the largest hypothetical elephant in the room. So large in fact, that other smaller elephants can hardly fit into the room. Set up your Etsy store and before you even make your first sale, you’ll pay a setup fee and listing fee after each of your listings. Want to stand out? There’s some more to pay. Thinking about selling on Amazon? Better have a healthy profit margin because the fees will eat into them bad. Outgrown the next package on Shopify? Need a few essential plugins to integrate with other tools? Well, buckle up as your monthly costs are about to skyrocket.</p><h4>The visibility trap</h4><p>Marketplaces such as Etsy claim to drive sales by providing the much needed exposure. There is some truth to it, but at what cost? Your store on these platforms will indeed get the exposure but then you are also invited to join the race to the bottom. Prices are dictated by how low others can go while you have very limited options communicating why you stand out.</p><blockquote>Your products get lost among the thousands</blockquote><p>To differentiate, you may decide to also set up your own website and drive sales there. Which means you now have 2 stores to manage and both costs time and money.</p><h4>Closed source</h4><p>You can’t have your own Shopify. The closest you can do is to have a custom storefront. If you decide to go down this route however, you are also committing to stay with the platform, which in turn means that you’ll pay the subscription fees of all your plugins and services with no option to reduce your monthly cost (yet there is also a strong possibility of them to increase significantly later).</p><blockquote>You are essentially locked in.</blockquote><h3>WooCommerce, Magento, PrestaShop and others</h3><p>The other option is to go with an off-the-shelf product. It is not unheard of a business owner teaching themselves on how to setup a WooCommerce store and even learn some coding. While this is plausible, isn’t that time better spent on building the business?</p><p>For others wanting to own their store but having zero interest in website hosting and coding, the only option is to get somebody to do it for them.</p><blockquote>Hire a developer and all your problems will be gone — said no one ever</blockquote><p>It is a smart idea to go with a free platform, self-hosting it and get either your nephew or someone from PeoplePerHour work out the details. Unfortunately it also has its fair share of not-so-obvious risks and often lead to frustration.</p><p>How do you pick the right person? How long will it take? How much is it to build, run and maintain?</p><p>Unclear or non-existing answers to any these questions can make or break your business.</p><h3>Ok, I get it. Do you have a solution?</h3><p>To get the above question answered is likely the reason you are still reading am I right?</p><blockquote>So we wanted to democratize E-commerce by offering the much needed flexibility while retaining the good and eliminating the bad.</blockquote><p>The platform I would like to introduce is called Shoptopus. It can work as a large platform and as a self-hosted web app. It can be very cheap or even free, yet it can be scalable cloud-hosted, monitored and managed by us. You can go with an out-of-the-box template, build your own storefront, also ask your nephew Jimmy or us to build one for you. It is up to you.</p><p>We can host it for £16.99 a month and happy to build custom extensions and integrations for a one-off fee like your developer would. We know the platform inside out, so it is quick, effective and reasonably priced. If you would like to host your store on a Raspberry PI and write extensions, you can do it too. The backend is Laravel, the admin area is React and the storefront is NextJs.</p><p>It has plenty of advanced features and unlike monolithic platforms, it is headless. If you are a developer, you can provide a fully featured backend api, admin area and custom storefront for your clients. Something many would use Shopify for today. We are also happy to provide the api for you and you can customize the storefront as you see fit. The main difference is that it is cheaper.</p><p>Last but not least, the platform has a robust import and export engine, which makes it possible to import data from any other platform albeit it may take a little effort to get the data parser right for a specific platform.</p><h3>Resources</h3><h4>Github</h4><ul><li><a href="https://github.com/rolandtreiber/shoptopus">GitHub - rolandtreiber/shoptopus: The core of the Shoptopus application</a></li><li><a href="https://github.com/rolandtreiber/shoptopus-admin-react">GitHub - rolandtreiber/shoptopus-admin-react</a></li></ul><h4>Project website</h4><p><a href="https://shoptopus.co.uk/">https://shoptopus.co.uk</a></p><h4>A store build with Shoptopus</h4><p><a href="https://mazeshop.co.uk/">Maze Shop</a></p><h4>A demo admin area you can log into</h4><p><a href="https://demo.shoptopus.co.uk/admin/">Carpatin Dashboard</a></p><p><strong>User:</strong> superadmin@m.com<br><strong>Password:</strong> shop</p><h3>Next steps</h3><p>Thank you for making this far. I am hoping you found what you were looking for.</p><p>If you like the initiative, please star the repos on Github. It helps a lot with gaining traction and sparking interest. You are more than welcome to contribute to the project by making a pull request. We’ll be out of this World if and when contributors start to appear.</p><p>Please feel free to send us an enquiry, so we can arrange a free demo and set up a test environment. If you are a developer, please feel free to check out and run the project on your machine, ask questions, raise feature requests or contribute.</p><p>To get a copy of the default storefront, please get in touch. Have a nice day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64c436711f97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run full linux desktop docker container in browser using Guacamole and Spring Boot]]></title>
            <link>https://hello-85764.medium.com/run-full-linux-desktop-docker-container-in-browser-using-guacamole-and-spring-boot-f89368c3156a?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f89368c3156a</guid>
            <category><![CDATA[remote-desktop]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[interesting-solutions]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 13:25:10 GMT</pubDate>
            <atom:updated>2025-03-10T14:46:47.960Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi there. I hope this title got you all hyped up! This is a cool little project I enjoyed working on so much, that I can’t wait to share with you. So you might ask yourself what to do with it. Well, that’s up to you. The possibilities are endless and since this is a starting point/boilerplate project, you can make it to anything you want.</p><p><a href="https://github.com/rolandtreiber/guacamole-spring-desktop-in-browser">https://github.com/rolandtreiber/guacamole-spring-desktop-in-browser</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FqSWl91Iry3w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DqSWl91Iry3w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FqSWl91Iry3w%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8db86a4c84e1cf73dbac230b776064ca/href">https://medium.com/media/8db86a4c84e1cf73dbac230b776064ca/href</a></iframe><h3>How does it work</h3><p>We have a few components working together to make it all happen.</p><h4>Let’s list them first and then I’ll explain all in detail</h4><ul><li>Alpine Linux with all necessary packages installed</li><li>Running Apache Guacamole Server</li><li>Spring Boot application</li><li>Apache Guacamole client jar files (powering the tunnel servlet)</li><li>Apache Guacamole Javascript library managing the display</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*1g7abXmOl4FPqHialhFfAQ.gif" /><figcaption>Alpine Linux runs in browser</figcaption></figure><h3>Apache Guacamole</h3><p>There’s a good reason to discuss Guacamole first. It is, that by far this is the most complicated part.</p><p><a href="https://guacamole.apache.org/">Apache Guacamole®</a></p><p>The project does not seem to be maintained anymore, which is a massive shame. Not all hope is lost though!</p><p>The project is designed to handle various types of remote desktop protocols through programmatic means. Making it even more appealing, it has a Java client library, which can handle connections to the server.</p><p>I am hoping that you start to see the possibility of rendering a desktop environment through a Spring Boot application. If you do, we’re on the same page!</p><h4>The first issue</h4><p>Ok, so in theory it should be possible to use the Guacamole client with Spring Boot… if the client library’s dependencies were compatible with a modern version of Spring Boot.</p><p>Oh my, what do we do now?</p><p>If only we could update the dependencies and recompile the Guacamole Client. In theory it would solve our issue I guess.</p><p>So that’s exactly what I did first to validate my assumptions. It was a good couple of hours daunting cherry picking old namespaces, versions, and functions and finding replacements with either matching or similar signatures to use instead.</p><p>This part was by far the most confusing at times, because some impostor syndrome kicked in as I was amending some function calls I had only a vague idea of what they’re doing. I also had to deactivate some of the built in test steps that were in place to safeguard anything funny going in from wannabe contributors. Unfortunately build failures started to pop as a result of failing some of these checks.</p><p>At some point though in a few hours in, it built yay!</p><p>So now we have a set of jar files supposedly working with Spring Boot!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*W67VgrScKO8Q-va0_Iwh5g.png" /><figcaption>Guacamole Client libraries built using modern dependencies to enable the project to be used in Spring Boot 3</figcaption></figure><h4>Let’s do a little test shall we?</h4><p>We are not expecting to see a fancy desktop at this point. All we need to know is that our Spring boilerplate app won’t complain about dependencies or missing libraries once we add our precious tunnel servlet that will be responsible to establish the connection with our — yet to be created — Guacamole Server.</p><p>I’ll skip the step of creating a new Spring Boot app as I’m sure you are either already familiar with it or trusting you to be a smart cookie and find it easily!</p><p><a href="https://start.spring.io/">Spring Initializr</a></p><p>Once you have your app all set, it’s time to add the client libraries as global libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkZbscJdT1bTYuFPSrkmQQ.png" /><figcaption>Add the Guacamole Client libraries to the project</figcaption></figure><h4>The Tunnel Servlet</h4><p>The following class is pretty much exactly how it is described in the documentation: <a href="https://guacamole.apache.org/doc/gug/writing-you-own-guacamole-app.html">https://guacamole.apache.org/doc/gug/writing-you-own-guacamole-app.html</a></p><pre>package com.guacamole.guacamole.Servlet;<br><br>import jakarta.servlet.ServletException;<br>import jakarta.servlet.http.HttpServletRequest;<br>import jakarta.servlet.http.HttpServletResponse;<br><br>import org.apache.guacamole.GuacamoleException;<br>import org.apache.guacamole.net.GuacamoleSocket;<br>import org.apache.guacamole.net.GuacamoleTunnel;<br>import org.apache.guacamole.net.InetGuacamoleSocket;<br>import org.apache.guacamole.net.SimpleGuacamoleTunnel;<br>import org.apache.guacamole.protocol.ConfiguredGuacamoleSocket;<br>import org.apache.guacamole.protocol.GuacamoleConfiguration;<br>import org.apache.guacamole.servlet.GuacamoleHTTPTunnelServlet;<br>import org.springframework.beans.factory.annotation.Value;<br>import org.springframework.web.bind.annotation.RequestMapping;<br>import org.springframework.web.bind.annotation.RequestMethod;<br>import org.springframework.web.bind.annotation.RestController;<br><br>@RestController<br>public class GuacamoleTunnelServlet extends GuacamoleHTTPTunnelServlet {<br><br>    @Value(&quot;${guacamole.protocol}&quot;)<br>    String guacamoleProtocol;<br><br>    @Value(&quot;${guacamole.security}&quot;)<br>    String guacamoleSecurity;<br><br>    @Value(&quot;${guacamole.hostname}&quot;)<br>    String guacamoleHostname;<br><br>    @Value(&quot;${guacamole.username}&quot;)<br>    String guacamoleUsername;<br><br>    @Value(&quot;${guacamole.password}&quot;)<br>    String guacamolePassword;<br><br><br>    @Override<br>    protected GuacamoleTunnel doConnect(HttpServletRequest request)<br>            throws GuacamoleException {<br><br>        // Create our configuration<br>        GuacamoleConfiguration config = new GuacamoleConfiguration();<br>        config.setProtocol(guacamoleProtocol);<br>        config.setParameter(&quot;security&quot;, guacamoleSecurity);<br>        config.setParameter(&quot;hostname&quot;, guacamoleHostname);<br>        config.setParameter(&quot;ignore-cert&quot;, &quot;true&quot;);<br>        config.setParameter(&quot;username&quot;, guacamoleUsername);<br>        config.setParameter(&quot;password&quot;, guacamolePassword);<br>        config.setParameter(&quot;console&quot;, &quot;true&quot;);<br>        config.setParameter(&quot;width&quot;, &quot;1364&quot;);<br>        config.setParameter(&quot;height&quot;, &quot;800&quot;);<br><br>        GuacamoleSocket socket = new ConfiguredGuacamoleSocket(<br>                new InetGuacamoleSocket(&quot;&quot;, 4822),<br>                config<br>        );<br><br>        // Return a new tunnel which uses the connected socket<br>        return new SimpleGuacamoleTunnel(socket);<br><br>    }<br><br>    @RequestMapping(path = &quot;tunnel&quot;, method = {RequestMethod.POST, RequestMethod.GET})<br>    protected void handleTunnelRequest(HttpServletRequest request,<br>                                       HttpServletResponse response) throws ServletException {<br>        super.handleTunnelRequest(request, response);<br>    }<br>}</pre><p>What I’d like to point out is, that the `GuacamoleHTTPTunnelServlet` class can be imported and no errors appear by doing so.</p><h4>Configuration (won’t work just yet)</h4><p>Add the following to your application.properties file and your application should start!</p><pre>spring.jackson.serialization.FAIL_ON_EMPTY_BEANS=false<br>server.tomcat.relaxed-query-chars={,},[,]<br>guacamole.protocol=rdp<br>guacamole.security=any<br>guacamole.hostname=gs-alpine-xrdp-box<br>guacamole.username=abc<br>guacamole.password=abc</pre><p>All we have achieved so far is that the application is happily running oblivious to the fact that as soon as it would try to connect to our Guacamole server, it would fail miserably. Making things worst, we don’t yet have means to attempt to initiate such connection, so let’s add some good on’ Javascript next.</p><h4>Client JS</h4><p>Let’s download the latest Guacamole project, which is currently v1.5.5.</p><p><a href="https://guacamole.apache.org/releases/1.5.5/">Apache Guacamole®</a></p><p>Within the .tar.gz file, you’ll find the common-common-js folder</p><p><a href="https://guacamole.apache.org/doc/gug/guacamole-common-js.html">guacamole-common-js - Apache Guacamole Manual v1.5.5</a></p><p>Install and package the project using maven</p><pre>$ mvn install<br>$ mvn package</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DjIdQpO_tkcxlmiKBZdXCQ.png" /><figcaption>Upon build success, you should have your minified javascript files available to use</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C8bZljIQlCYdeUVVSYyOYw.png" /><figcaption>Copy these files into the resources folder of your Spring Guacamole project</figcaption></figure><p>Upon successful build, you should see the files appear in your target folder as per the screenshots above.</p><p>The JavaScript client library will be responsible to handle the connection between your tunnel servlet/Spring application and the Guacamole Server, we’ll be building shortly.</p><p>First let’s copy the build files into the resources folder of your Spring App as well as create a static html file to load them.</p><h4>Use the JavaScript files in Spring</h4><p>Spring Boot serves static files placed in the appropriate location without any further configuration.</p><p>The location in our case should be the following:</p><pre>[PROJECT ROOT]/resources/static/</pre><p>As a choice of preference, I placed the js files in the resources/js folder, which you’ll see referenced in the html file in the next point.</p><h4>Add the index.html file</h4><p>Now as we have our javascript files ready to use, we’ll need the simplest ever html file to load them.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br><br>&lt;head&gt;<br>   &lt;title&gt;Guacamole&lt;/title&gt;<br>&lt;/head&gt;<br><br>&lt;body&gt;<br><br>&lt;!-- Display --&gt;<br>&lt;div id=&quot;display&quot;&gt;&lt;/div&gt;<br><br>&lt;!-- Guacamole JavaScript API --&gt;<br>&lt;script type=&quot;text/javascript&quot;<br>        src=&quot;./resources/js/all.js&quot;<br>&gt;<br>&lt;/script&gt;<br><br>&lt;!-- Init --&gt;<br>&lt;script type=&quot;text/javascript&quot;&gt; /* &lt;![CDATA[ */<br><br>            // Get display div from document<br>            var display = document.getElementById(&quot;display&quot;);<br><br>            // Instantiate client, using an HTTP tunnel for communications.<br>            var guac = new Guacamole.Client(<br>                new Guacamole.HTTPTunnel(&quot;tunnel&quot;)<br>            );<br><br>            // Add client to display div<br>            display.appendChild(guac.getDisplay().getElement());<br><br>            // Error handler<br>            guac.onerror = function(error) {<br>                alert(error);<br>            };<br><br>            // Connect<br>            guac.connect();<br><br>            // Disconnect on close<br>            window.onunload = function() {<br>                guac.disconnect();<br>            }<br><br>            // Mouse<br>            var mouse = new Guacamole.Mouse(guac.getDisplay().getElement());<br><br>            mouse.onEach([&#39;mousedown&#39;, &#39;mouseup&#39;, &#39;mousemove&#39;], function sendMouseEvent(e) {<br>                guac.sendMouseState(e.state);<br>            });<br><br>            // Keyboard<br>            var keyboard = new Guacamole.Keyboard(document);<br><br>            keyboard.onkeydown = function (keysym) {<br>                guac.sendKeyEvent(1, keysym);<br>            };<br><br>            keyboard.onkeyup = function (keysym) {<br>                guac.sendKeyEvent(0, keysym);<br>            };<br><br>        /* ]]&gt; */ &lt;/script&gt;<br><br>&lt;/body&gt;<br><br>&lt;/html&gt;</pre><h4>Let’s do another test!</h4><p>If you restart the application now and navigate to the root route, you’ll see the error message in the logs telling you that the application did indeed try to connect to a guacamole server, but the connection was refused. That’s actually a good sign!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGSokZRehN8Ul8ojIIy4-g.png" /><figcaption>Connection refused, which means our application has attempted to connect to a Guacamole Server using RDP protocol!</figcaption></figure><h3>Time to build some docker containers!</h3><p>At this step I’ve identified the following requirements I wanted to achieve</p><ul><li>Alpine Linux (as it is very small and fast)</li><li>Minimal boilerplate</li><li>Full desktop environment</li></ul><p>To achieve what I needed, I used the LinuxServer Rdesktop project as a basis. Massive kudos to those people and appreciation on the hard work they’ve put into creating those images.</p><p><a href="https://docs.linuxserver.io/images/docker-rdesktop/">https://docs.linuxserver.io/images/docker-rdesktop/</a></p><p>I’ve reverse engineered the images to a point where I gained enough understanding to tweak them and build a multi-layer image based on Alpine, having an xfce desktop environment, running RDP server.</p><p>The second container provides the Guacamole server built from source as well as configuring the user, so we can authenticate.</p><p>The containers are on the same network, defined by the docker-compose.yaml file.</p><p>The container definitions are also available in the corresponding github repository in the server-docker-config folder.</p><h4>Running the containers</h4><p>Assuming you have cloned the corresponding repository, you should be able to start the containers without any further tweaking.</p><p>Please note, that the user credentials are baked into the dockerfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9FPQ2CVHwbGaX74mOmCwSA.png" /><figcaption>Containers running, guacamole daemon is listening. Beautiful!</figcaption></figure><p>This tells us, that the Guacamole Server is running, listening and as it is on the same network as our Alpine Linux container, they should see and be able to talk to each other.</p><p>At this point is makes sense to review once more what our flow is supposed to look like once it is all working.</p><ul><li>The Spring app has a Guacamole Client tunnel servlet, which is able to handle the connection to a Guacamole Server running on a separate machine.</li><li>The Spring app is serving the Guacamole Common Javascript library, which can talk to the tunnel servlet and turn the data packages into the display to render.</li><li>An instance of the Guacamole Server is running happily in its very own Docker container.</li><li>A lightweight Alpine Linux Docker container is also running in another container with an RDP server running and its RDP server port exposed.</li><li>The Spring app loads the Guacamole Common JS to the browser, which initiates the connection with the tunnel servlet.</li><li>The tunnel servlet initiates the connection with the Guacamole Server</li><li>The Guacamole Server initiates the RDP connection to the Alpine+XFCE container</li><li>The RDP connection is authenticated, so the desktop environment starts streaming through the RDP connection</li><li>The Guacamole Server forwards the data to the Tunnel servlet</li><li>The Tunnel servlet fowards the data to the Guacamole Common client js library</li><li>The JavaScript library handles user interaction and renders the desktop environment in the browser</li></ul><p>If the above sounds complicated, you’re right, it is. What is absolutely lovely about this is, that it does not look complicated at all once it is working.</p><h4>Let’s see if it works now</h4><p>Given that our Docker containers are up and our Spring Boot application is ready to go, nothing should be in our way to test the solution out.</p><p>First let’s start our application and navigate to the root route.</p><p>In my case it is: http://localhost:8080</p><p>The first thing you’ll notice is that the connection refused error is now gone in the logs and a few lines of much more friendly logs appear about initializing the ‘dispatcherServlet’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YpPB9O8WncDECN6gCwfnEg.png" /><figcaption>Connection established. Beam me up Scotty</figcaption></figure><p>and finally…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFx3AsDAy5TNEK19ygPSIg.png" /><figcaption>Desktop in the browser</figcaption></figure><p>our Linux desktop environment is up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*w8PUSMpzsKyhoYfcrq0ASg.gif" /><figcaption>Inkscape is running too!</figcaption></figure><h3>Conclusion</h3><p>Thanks for reading this article. Check out the corresponding github repository and feel free to fork it or play around with it. Please note, that this project is a starting point. I myself have quite a few ideas of what to use this for, however at this stage it is as good as you make it to be for your purposes.</p><p>Please feel free to reach out to me on hello@thecaringdeveloper.com</p><p>Check out my website on: <a href="https://thecaringdeveloper.com/">https://thecaringdeveloper.com</a><br>The project’s github repo: <a href="https://github.com/rolandtreiber/guacamole-spring-desktop-in-browser">https://github.com/rolandtreiber/guacamole-spring-desktop-in-browser</a></p><p>Have a nice day and happy hacking!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f89368c3156a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to avoid complacency as a developer]]></title>
            <link>https://hello-85764.medium.com/how-to-avoid-complacency-as-a-developer-8593a565a552?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/8593a565a552</guid>
            <category><![CDATA[challenges-and-growth]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Fri, 08 Apr 2022 07:21:03 GMT</pubDate>
            <atom:updated>2022-04-08T07:47:03.030Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iqz_PJ1AT0fwAy8GOrl0Gw.jpeg" /><figcaption>How to avoid complacency as a developer</figcaption></figure><p>Hi there! Thanks for stopping by.</p><p>Do you remember the first days of your journey as a coding professional? Regardless your field, I bet you were fascinated by the endless possibilities of what you can build. It was most likely followed by years of hard work to master your weaponry. By this, comes however the threat of using more and more of what you already know and learn new techniques less frequently as in the early days. Here comes my advice of how to stay on top of your game for years if not decades.</p><h4>My story in a nutshell (skip if you like)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*nMCvQjFpxEynWmdKW29UUw.jpeg" /><figcaption>London Underground — AKA classroom</figcaption></figure><p>I started off as a digital designer studying for 2 years on the London Underground. It took me over 2 hours to get to work each day, so it gave me 20+ hours/week dedicated study time each week. Early on, I studied various elements of Adobe CC in depth (which surprisingly pays dividends almost every day since as a full stack developer). It was a natural thing to continue on with this habit after I felt I gained enough knowledge in Photoshop and its friends, so moved onto the basics of web development. (I mean really the basics like core concepts, html, css and basic vanilla JavaScript)<br>The very concept of learning something at my own pace and self-managing it had a huge impact on my life.</p><p>Fast forward a few years later I was first hired by a warehouse to maintain the company website and build a few internal services as a sole in-house designer and developer. At this time I confronted with the concept of becoming complacent the very first time.<br>This job was only challenging for a little at the beginning and then quickly turned into a repetitive boredom with a little extra time at hand. Make no mistake, my job was executed and done well, but I could also spend some time experimenting with new techniques and built tools for the company proactively using my newfound knowledge solving problems outside of my job description. This led me to eventually leaving the company and working on much more complex web applications for a fintech startup. This was many years ago and the story goes on, but it would not be relevant, so let’s leave it here.</p><h4>The main takeaway (do not skip)</h4><p>To learn something as powerful and ultimately quite complex as a sophisticated MVC framework felt difficult and confusing at that time. Looking back it is hard to believe that once I thought it was difficult…until something else comes along. :)</p><p>The experience however boosted my confidence to get into and master virtually anything I consider beneficial and doing it over and over again. (AWS, Microservices, Mobile App development, React, Spring Boot and Android in Java etc.)</p><blockquote>It is always the exact same sequence</blockquote><ul><li>Studying and secretly panicking of not being able to remember and use anything in the courses</li><li><strong>Finishing all courses</strong> I thought I need (barely able to say 2 coherent sentences about the topic)</li><li><strong>Taking 3 days holiday</strong> from work dedicating them to experiment with the new technique/programming language/tool/framework etc.</li><li>Day 1 is utter mess, nothing seems to work</li><li>Day 2 is much better, things start to make sense. (After a night full of dreams of code and problems I faced the day prior. :) )</li><li>Day 3 the skies are clear. Things fall into place and everything - rather miraculously -, start working as they should.</li><li>From this day onwards the new thing becomes part of my daily routine for a while and each day I take it one step further. It takes discipline<strong> and more importantly a cool exciting project</strong> that is <strong>just complex enough to be challenging but not overwhelming for a single person to complete</strong>.</li></ul><blockquote>The above is hard to the point that it takes more and more determination to get started on the sequence again, until it is clearly understood that it is a key element of long term success in one’s field.</blockquote><p>I can assure you that if you do it over and over, you’ll experience speed of professional development that you never thought possible. It is exhilarating but also means that nothing stays the same in your work life.</p><p><em>The other side of the same coin is quite dark, but is essential to be considered.</em></p><blockquote>I firmly believe that there is no such thing as job security in the coding industry. Things change so rapidly that is unheard of in other fields. In other words it doesn’t matter how much you know now, your knowledge becomes irrelevant and obsolete in the following 1–2 year(s) from the point when you cease learning new things.</blockquote><p>This is hard to swallow and by no means I meant to scare you. The intention is the exact opposite. I’d like to take the opportunity to encourage people to stay relevant and never stop learning. It is increasingly more appealing to stay where we are, but learning entirely new things from scratch comes with a benefits package.</p><h4>Conclusion</h4><p>I am on my Day 3 with Spring Microservices and so today is a happy day for me. 2 days ago I felt I won’t ever be able to wrap my head around it even after religiously following through 4 courses (70+ hours total) and here I am today preaching about how cool the whole experience is. :) I absolutely mean every word. Take it and use it for your own benefit!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8593a565a552" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Animating the bottom tab navigator in React Native]]></title>
            <link>https://hello-85764.medium.com/animating-the-bottom-tab-navigator-in-react-native-in-2021-cb3d5dbd39ce?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb3d5dbd39ce</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react-animation]]></category>
            <category><![CDATA[navigation-bar]]></category>
            <category><![CDATA[navigation-component]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Sun, 05 Sep 2021 08:07:21 GMT</pubDate>
            <atom:updated>2025-04-28T07:38:01.869Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZKFmXLBVr2C9NQqXbYkSQ.jpeg" /><figcaption>Animating the bottom tab navigator in React Native in 2021</figcaption></figure><p>In this tutorial you will learn how flexible the bottom tab navigation can be in React Native. You can customise more than it seems at first. We will focus on the custom animations to interpolate colour, change size and position of the selected tab.</p><p>This demonstration uses a custom icon font. I have explained the way you can create and load your own in this <a href="https://hello-85764.medium.com/how-to-create-and-use-custom-icon-font-in-react-native-24ef3b1c8f65">article</a>.</p><p>For the code, clone the repo: <a href="https://github.com/rolandtreiber/rn-bottom-tabs-tutorial">https://github.com/rolandtreiber/rn-bottom-tabs-tutorial</a></p><h3>What we are building</h3><p>We will be using the built in animation library as well as the bottom tab navigation to build this custom beautiful smooth animated navigation.</p><p>Note that when you select an item, it changes <strong>colour</strong>, <strong>size</strong> and <strong>position</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHab1mGXDa9mva7c-Vd6Qw.gif" /><figcaption>Animated bottom tab navigation</figcaption></figure><h3>Prerequisites</h3><p>To achieve the same result, you should have <a href="https://www.npmjs.com/">NPM</a> and the <a href="https://docs.expo.dev/workflow/expo-cli/">expo-cli</a> installed. In order to run your app on iOS device or simulator and compile your code for Apple devices requires either Mac with Xcode or <a href="https://expo.dev/">expo</a> cloud. For Android, you’ll need Android Studio. Find more information on this in the <a href="https://reactnative.dev/docs/getting-started">docs</a>.</p><p>Once you have all this, you are all set to install and work on your project.</p><h4>Github</h4><p>As a starting point, you may use the repo from my custom icon font tutorial <a href="https://github.com/rolandtreiber/rn-custom-icon-font-tutorial">here</a> or you can download the final project <a href="https://github.com/rolandtreiber/rn-bottom-tabs-tutorial">here</a>.</p><h3>Packages</h3><p>To make the bottom tab navigation work, you want to run the following commands to install the packages:</p><pre>npm i @react-navigation/native<br>npm i @react-navigation/stack<br>npm i @react-navigation/bottom-tabs</pre><p>For this demonstration, I will also use a custom font that I have created earlier. To load this font, let’s install expo-font and expo-app-loading</p><pre>npm i expo-font<br>npm i expo-app-loading</pre><p>I also like styled components quite a bit, so let’s install it as well. If you are not aware of the styled components library and how awesome it is, then it is time to <a href="https://styled-components.com/">check it out</a>!</p><pre>npm i styled-components</pre><h3>The screens</h3><p>To navigate between screens, we’ll need to have a few. For this exercise, we’ll go with a generic screen component that simply displays a title and a content supplied to it as props.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*KEX-trqL183gpX9a4_SjUg.png" /><figcaption>/src/screens/GenericScreen.js</figcaption></figure><h3>The navigation</h3><p>The app navigation in our case has two parts: a stack navigation where the bottom tab navigator is one of the screens. It is not strictly necessary to do it this way, however it comes with the benefit of being able to add pages that are not included in the bottom tab navigation. This is usually the case with larger scale applications, so to help you grasp the concept, it is laid out this way.</p><h4>The Stack Navigator</h4><p>This is a simplest form of a <a href="https://reactnavigation.org/docs/stack-navigator/">Stack Navigator</a> in React Native. Nothing fancy, however if you copy the code and try to run the the app, it will fail missing the BottomTabNavigator component. So let’s create it as the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*vRPM5_er_F-yu8wOkj8qCA.png" /><figcaption>/App.js</figcaption></figure><h4>The Bottom Tab Navigator</h4><p>So far what we have been working on was the preparation part simply setting the scene for implementing our own customised bottom tab navigator.</p><blockquote>This is where the actual magic happens, so first I’ll copy the finished file here and then explain how it works in detail.</blockquote><p>If you scroll down, you’ll find the detailed explanation of the following sections:</p><ol><li><strong>Loading your icons</strong></li><li><strong>Creating the navigator and loading the pages</strong></li><li><strong>Creating the animations<br>- Mass creation<br>- Size and Position<br>- Color interpolation</strong></li><li><strong>Animated styles</strong></li></ol><pre>import React, {useEffect, useState} from &quot;react&quot;;<br>import {<strong><em>createBottomTabNavigator</em></strong>} from &quot;@react-navigation/bottom-tabs&quot;;<br>import {<strong><em>Animated</em></strong>, <strong><em>TouchableHighlight</em></strong>} from &quot;react-native&quot;;<br>import Screen from &quot;../screens/GenericScreen&quot;;<br>import styled from &quot;styled-components/native&quot;;<br>import AppLoading from &#39;expo-app-loading&#39;;<br>import {useFonts} from &#39;expo-font&#39;;<br>import MyCustomIconSet from &#39;../assets/fonts/MyIconSet.ttf&#39;<br><br>const Tab = <strong><em>createBottomTabNavigator</em></strong>()<br><br>const BottomTabNavigatorArticle = () =&gt; {<br>  const [focusedTab, setFocusedTab] = useState(1)<br>  const mappable = [0, 1, 2, 3, 4]<br><br>  const colors = mappable.map((item, index) =&gt; {<br>    return useState(index === focusedTab ? new <strong><em>Animated</em></strong>.Value(1) : new <strong><em>Animated</em></strong>.Value(0))[0]<br>  })<br><br>  const iconSizes = mappable.map((item, index) =&gt; {<br>    return useState(index === focusedTab ? new <strong><em>Animated</em></strong>.Value(40) : new <strong><em>Animated</em></strong>.Value(28))[0]<br>  })<br><br>  const boxSizes = mappable.map((item, index) =&gt; {<br>    return useState(index === focusedTab ? new <strong><em>Animated</em></strong>.Value(70) : new <strong><em>Animated</em></strong>.Value(50))[0]<br>  })<br><br>  const topMargins = mappable.map((item, index) =&gt; {<br>    return useState(index === focusedTab ? new <strong><em>Animated</em></strong>.Value(-45) : new <strong><em>Animated</em></strong>.Value(-10))[0]<br>  })<br><br>  useEffect(() =&gt; {<br>    colors.forEach((c, index) =&gt; {<br>      let value = focusedTab === index ? 1 : 0<br>      <strong><em>Animated</em></strong>.timing(c, {<br>        toValue: value,<br>        duration: 200,<br>        useNativeDriver: false<br>      }).start()<br>    })<br>    iconSizes.forEach((s, index) =&gt; {<br>      let value = focusedTab === index ? 40 : 28<br>      <strong><em>Animated</em></strong>.timing(s, {<br>        toValue: value,<br>        duration: 200,<br>        useNativeDriver: false<br>      }).start()<br>    })<br>    boxSizes.forEach((s, index) =&gt; {<br>      let value = focusedTab === index ? 70 : 50<br>      <strong><em>Animated</em></strong>.timing(s, {<br>        toValue: value,<br>        duration: 200,<br>        useNativeDriver: false<br>      }).start()<br>    })<br>    topMargins.forEach((s, index) =&gt; {<br>      let value = focusedTab === index ? -45 : -10<br>      <strong><em>Animated</em></strong>.timing(s, {<br>        toValue: value,<br>        duration: 200,<br>        useNativeDriver: false<br>      }).start()<br>    })<br>  }, [focusedTab])<br><br>  const bgColorAnimation = (c) =&gt; c.interpolate({<br>    inputRange: [0, 1],<br>    outputRange: [&quot;rgb(74,74,74)&quot;, &quot;rgb(82,224,84)&quot;]<br>  })<br><br>  let [fontsLoaded] = useFonts({<br>    &#39;MyCustomIconSet&#39;: MyCustomIconSet,<br>  });<br><br>  const icons = {<br>    carrot: &quot;&quot;,    // &amp;#xe900;<br>    tea: &quot;&quot;,       // &amp;#xe901;<br>    coffee: &quot;&quot;,    // &amp;#xe902;<br>    pineapple: &quot;&quot;, // &amp;#xe903;<br>    cherries: &quot;&quot;,  // &amp;#xe904;<br>  }<br><br>  if (!fontsLoaded) {<br>    return &lt;AppLoading/&gt;;<br>  } else {<br><br>    const TabWrapper = styled.View`<br>      display: flex;<br>      flex: 1;<br>      flex-direction: row;<br>      align-self: stretch;<br>      justify-content: center;<br>      align-content: center;<br>    `<br><br>    const IconWrapper = styled(<strong><em>Animated</em></strong>.View)`<br>      position: relative;<br>      width: 70px;<br>      height: 70px;<br>      justify-content: center;<br>      margin-top: -10px;<br>      border-radius: 35px;<br>    `<br><br>    const Icon = styled(<strong><em>Animated</em></strong>.Text)`<br>      font-family: &quot;MyCustomIconSet&quot;;<br>      color: white;<br>      padding: 10px;<br>      text-align: center;<br>      color: ${props =&gt; props.color};<br>    `<br><br>    const TabBarBg = styled.View`<br>      background-color: #eaeaea;<br>      display: flex;<br>      flex: 1;<br>    `<br><br>    const pages = [<br>      {<br>        title: &quot;Carrot Screen&quot;,<br>        content: &quot;Carrots are good for you!&quot;,<br>        icon: icons.carrot<br>      },<br>      {<br>        title: &quot;Cherry Screen&quot;,<br>        content: &quot;Who doesn&#39;t love cherries?&quot;,<br>        icon: icons.cherries<br>      },<br>      {<br>        title: &quot;Coffee Screen&quot;,<br>        content: &quot;Coffee jumpstarts your coding!&quot;,<br>        icon: icons.coffee<br>      },<br>      {<br>        title: &quot;Pineapple Screen&quot;,<br>        content: &quot;Pine and apple? No thanks...&quot;,<br>        icon: icons.pineapple<br>      },<br>      {<br>        title: &quot;Tea Screen&quot;,<br>        content: &quot;Milk or lemon?&quot;,<br>        icon: icons.tea<br>      }<br>    ]<br><br>    return &lt;Tab.Navigator screenOptions={{<br>      headerShown: false,<br>      tabBarShowLabel: false,<br>      tabBarStyle: {position: &#39;absolute&#39;},<br>      tabBarBackground: () =&gt; (<br>        &lt;TabBarBg/&gt;<br>      ),<br>    }}&gt;<br>      {pages.map((page, index) =&gt; (<br>        &lt;Tab.Screen key={&quot;tab-&quot;+index} name={page.title}<br>                    options={{<br>                      tabBarIcon: ({focused}) =&gt; &lt;TabWrapper&gt;<br>                        &lt;IconWrapper style={{<br>                          backgroundColor: bgColorAnimation(colors[index]),<br>                          marginTop: topMargins[index],<br>                          width: boxSizes[index],<br>                          height: boxSizes[index]<br>                        }}&gt;<br>                          &lt;Icon style={{fontSize: iconSizes[index]}}<br>                                color={focused ? &quot;black&quot; : &quot;white&quot;}&gt;{page.icon}&lt;/Icon&gt;<br>                        &lt;/IconWrapper&gt;<br>                      &lt;/TabWrapper&gt;<br>                    }}<br>                    listeners={{<br>                      tabPress: e =&gt; {<br>                        setFocusedTab(index)<br>                      },<br>                    }}&gt;<br>          {props =&gt; &lt;Screen {...props} title={page.title} content={page.content}/&gt;}<br>        &lt;/Tab.Screen&gt;)<br>      )}<br>    &lt;/Tab.Navigator&gt;<br>  }<br>}<br><br>export default BottomTabNavigatorArticle</pre><h4>1. Loading your custom icon font</h4><p>To make the tabs look pretty, let’s load the icon font that will be used to display the tab icons. If you are interested in how to create one, look <a href="https://hello-85764.medium.com/how-to-create-and-use-custom-icon-font-in-react-native-24ef3b1c8f65">here</a>. <br>To follow along, grab the <a href="https://github.com/rolandtreiber/rn-bottom-tabs-tutorial/tree/master/src/assets/fonts">file</a> ot the <a href="https://github.com/rolandtreiber/rn-bottom-tabs-tutorial">entire repo</a>.</p><p>Once the icon font is loaded, let’s map the icons to an object, so they can be referred by name rather than html entity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*IAXYxNXZZpinR08tG6vPoA.png" /></figure><h4>2. <strong>Creating the navigator and loading the pages</strong></h4><p>Constructing the tab navigation takes a couple of elements. There is needed some page data, the element itself and some styling that includes icon mapping and a set of styled components in our case. Once it is all in place, we can start animating the elements!</p><p><strong>The Static page data<br></strong>We are going to need some sort of a static page data that we can loop through and pass down to the generic page screen component we have created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*kHlpXOY72U82-Llv3uUnNg.png" /><figcaption>Static Page Data</figcaption></figure><p><strong>Static Styles<br></strong>We are using styled components those we are looking to animate in the next step. At first, let’s use static components, so at least we have something to look at.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*EyVKCk6t1BrJ8iWmV6cPCg.png" /></figure><p><strong>The Navigation Element</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*dOt48Rry6zSwL_vOnxnL0A.png" /><figcaption>The Tab Navigation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5fdKgLeTd7aKRo6z90GnQ.gif" /></figure><p>Once the is page data, navigator and icons are in place, we are finally ready to create a static bottom tab navigation as per the documentation.</p><h4>3. Creating the <strong>animations</strong></h4><p><strong>We know the following:</strong></p><ul><li>It is possible to use a custom element as the tab component as well as it is entirely possible to style it the way we want.</li><li>It is possible to listen for a focused event and apply styles conditionally based on their focused state.</li></ul><p>So let’s turn our focus on creating the animations themselves without worrying too much about how they will be applied to the appropriate elements.</p><p>If you are not familiar with the <a href="https://reactnative.dev/docs/animated">React Native Animation Library</a>, then let me recommend you reading through the docs first.</p><p>Basically the way it works is that you can specify the end values and the transition will be calculated for you without interfering with the main thread. This way the animation is smooth and not blocking other parts of the ui.</p><p><strong>Mass creation</strong></p><blockquote>The little issue is that one of these animation methods need to be applied to all tab elements individually per type of animation.</blockquote><p>So if you are looking to animate the size and position of all five elements, you need to create five size and another five position animations. To create them manually would lead to lots of typing, lots of repetition and lots of possibility of errors not to mention maintainability.</p><p>Si what I have decided to do was to use loops to mass produce the animation objects.</p><figure><img alt="Mass creating animations" src="https://cdn-images-1.medium.com/max/943/1*XJ2z9gmUmHYQVTbfCJeyhQ.png" /><figcaption>Mass creating animations</figcaption></figure><p>Once app loads, we can start listening for the focused state value that gets updated at selecting an item. When it changes, the animations need to be set accordingly. (send inactive elements to the start(not focused) position and the selected one to the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*csJme7rDzhh50aJVHTMpQw.png" /></figure><p><strong>Color Interpolation</strong></p><p>The above approach is enough to animate the size and position, but what about colour?</p><p>Well yes, that is a bit trickier but the Animated library does have support for it too. Check out the interpolate method docs <a href="https://reactnative.dev/docs/animated#interpolation">here</a>.</p><p>Our function to calculate the interim colours looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*QGD8_7pkADckOKfVpeHB5g.png" /><figcaption>Colour Interpolation</figcaption></figure><p>So now, similarly to the others, we can mass create the animations and run them as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*Fa_oZjMSIovu1uCsSY5O-g.png" /><figcaption>Mass create colour animations</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*wUbnTR7mM1hfbwAUtWMLWw.png" /><figcaption>Run colour animations on focused event</figcaption></figure><p><strong>Animated Styles</strong></p><p>At last let’s apply the animations to the elements.</p><p>In order to do this, first you need to change the element itself to its animated equivalent. So View becomes Animated.View, Text becomes Animated.Text.<br>Since we are using styled components, the change affects them only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*m_jMIfvPHWKEd8MjH3cvcw.png" /><figcaption>Animated elements</figcaption></figure><p>If you are familiar with styled components, you might be tempted to apply the animated styles through props, however let me save you a few minutes here. It will not work. At the time of writing, there is no support for animated props in styled components. <a href="https://github.com/styled-components/styled-components/issues/892">This thread</a> was closed years ago without a resolution, so it is probably safe to assume that this feature is not in the pipeline.</p><p>Still there is a solution and it doesn’t look too bad. You can apply the animated styled directly to the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*F2K_-5PidltdxlQU2jhSOA.png" /><figcaption>Animations applied to the elements</figcaption></figure><p>I would definitely argue that styled props would look better, but this is what we have.</p><h3>Conclusion</h3><p>There you have it! This is how you animate the bottom tabs in React Native. I hope you have enjoyed this tutorial. I certainly did enjoy writing it!</p><p>Stay tuned as I have plenty similar neat little tricks in the works! Have a lovely day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb3d5dbd39ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create and use custom icon font in React Native]]></title>
            <link>https://hello-85764.medium.com/how-to-create-and-use-custom-icon-font-in-react-native-24ef3b1c8f65?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/24ef3b1c8f65</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[icons]]></category>
            <category><![CDATA[icon-font]]></category>
            <category><![CDATA[custom-icon]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Sat, 21 Aug 2021 07:50:35 GMT</pubDate>
            <atom:updated>2021-08-21T08:12:24.432Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pfrwE4GjKo9YJABrEDVZdw.jpeg" /><figcaption>How to create and use custom icon font in React Native</figcaption></figure><p>Recently I have had to implement a very unique icon set in a React Native app and wired it up with dark mode and colour themes. It got me thinking if fellow developers would be interested in my way of getting around this.</p><p>Using a custom icon font is the way to go in my opinion for many reasons.</p><h3>Why a font?</h3><p>It is equally possible to use pngs or svgs as icons in a mobile app. Why would we want to go down the hassle of creating an all new font just to hold our icons? Both png and svg formats have their limitations.</p><ul><li><strong>PNG</strong>: even though it supports alpha channel (transparency), it also comes with its own colours. Png icons also need to be stored at a rather large resolution to be crisp on larger pixel densities. Plus your icons need to be stored as individual files and imported individually.</li><li><strong>SVG</strong>: at least svg-s are vector based, so no probs with resolution, however the other 2 points on png-s also apply to the svg format as well.</li></ul><blockquote>When using a custom font, it is no different than using regular text.</blockquote><blockquote>You can apply size and colour attributes while your icon characters remain crisp no matter the size.</blockquote><h4>What we’ll be doing</h4><ol><li>Creating the font using individual svg icons</li><li>Creating a blank React Native project</li><li>Exporting the font and copying it in our project</li><li>Installing a few packages</li><li>Implementing the font and using the icons</li></ol><h3>Let’s dive in</h3><h4>Get your icons ready</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fIPwye0QA2b-iYvoZMOAw.png" /><figcaption>I have used flaticon to get some awesome free icons</figcaption></figure><p>You may create your own icon set or get someone to do it for you. For simplicity, I have picked an icon set on Flaticon and saved 5 icons at random. <em>Make sure that you save them as SVG.</em></p><h4>Import the icons and create the font</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*4GCffpGIUG4ZfWEKB-vBpA.png" /><figcaption>I have used Icomoon as I believe it to be the very best free online tool available</figcaption></figure><p>If you haven’t used <a href="https://icomoon.io/">icomoon.io</a> before, then no worry. It is incredibly simple! You simply create a project, name it and start dragging icons into it. It takes care of the mapping and all. Once you are done, simply export it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*G5yPUtpmEgXjkIOJONWCVQ.png" /><figcaption>Once you are done, simply export your font.</figcaption></figure><p>It downloads a zip file. We are only interested in the .ttf file as it is supported by all platforms. This is not true to all other formats, so be careful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4hkwpHIlvASveBADk47ghQ.png" /><figcaption>We’ll use the .ttf file as it is supported by all platforms.</figcaption></figure><h3>Let’s create the project</h3><p>For simplicity, we’ll be using expo for this example. If you have either ejected your project or not using expo at all, most of the content in this article still applies to you, however you need to take a few extra steps to link your fonts up to your application.</p><p>These extra steps are nicely summarised in this <a href="https://mehrankhandev.medium.com/ultimate-guide-to-use-custom-fonts-in-react-native-77fcdf859cf4">article</a>, so I see no reason of duplicating its content.</p><p>It is also assumed that you have your react native dev environment setup including the expo cli.</p><p>so let’s create the project using the following command:</p><pre>expo init [YourProjectName]</pre><p>Once you run the command, you should see something similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MPfXl1JpxoB68UjI_6Y8A.png" /><figcaption>Let’s create a project using expo</figcaption></figure><h4>Run your blank project to make sure it works</h4><p>To verify that the project was successfully created, run the npm start command and run the project in simulators and/or real devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*3UD5OoUu90pP9AWAk0gOzA.png" /><figcaption>Nothin fancy, just a clean slate at this point.</figcaption></figure><h4>Version control</h4><p>This step is not essential, but for the sake of completeness, this is the best time to set up your github repository to version control your project.</p><ul><li>Create a .gitignore file and add /node_modules in it.</li><li>Commit and push</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*gbrImsYySD3F1kMAzgvZyA.png" /></figure><h3>Install some packages</h3><p>To make it work that way I did, you’ll need a few packages.</p><p>You may notice that I have used styled components for this demonstration. I am a big fan of <a href="https://styled-components.com/">styled components</a> and I’d highly recommend you using it as well.</p><pre>npm i styled-components<br>npm i expo-app-loading<br>npm i expo-font</pre><h3>Copy the icon font into you project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*BGeLhYNjO4IIvB3GITobww.png" /><figcaption>You decide on your folder structure. Here is my recommended structure.</figcaption></figure><p>React Native does not have a proprietary folder structure, so you can build it the way you like. There are standards however. The application code as well as config and assets usually reside under the src directory.</p><h3>Use the font</h3><p>I’ll include the full code to use the font first and then explain it in parts:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ARTv4fz3W-FleGuz2dbwg.png" /></figure><p>The top section is probably obvious where we import the required packages.</p><h4><strong>Let’s focus on the icons object</strong></h4><p>On the ‘generate font’ tab in icomoon.io, you’ll see your icons listed. When you hover over each of them, you’ll see the “Get Code” link appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*C9bYuwCCO7qVZLK9ALfKlg.png" /><figcaption>Get the character and the html entity from your icomoon.io project</figcaption></figure><p>Click on each of them and copy the <strong>character</strong> into your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOEVrzE1UlLWBIUGQBsKVQ.png" /><figcaption>Copy over the character from your icomoon.io project</figcaption></figure><p>The best place for them is an object that holds your icons. It may be placed in a separate file once the project grows, but for our purposes it is perfectly fine in App.js like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*yK1C4WNvBcu3Qb3C72re-w.png" /><figcaption>Construct the icons object</figcaption></figure><p>The next thing to do is, to load the font file. Expo has its way of doing it, so please refer to the <a href="https://docs.expo.dev/guides/using-custom-fonts/">official documentation</a> on using custom fonts in expo.</p><p>In short, the font file is loaded asynchronously, so you can only show the actual content once it is loaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*C4gT0QK77oy89rdtiXMOIg.png" /></figure><h4>Add some styled component magic</h4><p>As I have mentioned earlier, I like styled components very much. Just look at how easy on the eye the below code is. Isn’t it beautiful?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*Hrth1A9JensC9b8fgkwPBQ.png" /><figcaption>Styled components</figcaption></figure><h4>Display the content</h4><p>Once the font is loaded, the packages are included and the styled components are in place, the only thing left to do is to display the content by simply returning it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NYIyfaVzJCsq_MU-W347tw.png" /><figcaption>Display the content by returning it</figcaption></figure><h3>Et voilà</h3><p>The end result should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*IgI_lWwqvEMVX37mHYWVhw.png" /></figure><h3>Conclusion</h3><p>I hope you have enjoyed this tutorial on how to create and use your very own custom icon font in your React Native application. It was certainly lots of fun creating it :)</p><p>Find the github repository of the project at <a href="https://github.com/rolandtreiber/rn-custom-icon-font-tutorial">https://github.com/rolandtreiber/rn-custom-icon-font-tutorial</a></p><p>If you have any questions, please feel free to comment or reach out. You are more than welcome to check my website on <a href="http://thecaringdeveloper.com/">http://thecaringdeveloper.com</a> or drop me an email.</p><p>Have a nice day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24ef3b1c8f65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The myth of CMS systems and when should you avoid them]]></title>
            <link>https://hello-85764.medium.com/the-myth-of-cms-systems-and-when-should-you-avoid-them-2ee8ef5c934e?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ee8ef5c934e</guid>
            <category><![CDATA[website]]></category>
            <category><![CDATA[online-marketing]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[website-development]]></category>
            <category><![CDATA[small-business-marketing]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Fri, 11 Jun 2021 11:51:21 GMT</pubDate>
            <atom:updated>2021-06-11T12:06:59.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nW-mGN9V85HEVq7K3UuFDg.jpeg" /><figcaption>The myth of CMS systems and when should you avoid them</figcaption></figure><p>Valuable insights learned through over 6 years of software development and working with clients of all sizes will follow to help you in finding the best approach to get your website up and running.</p><p>I intend to save you lots of headache and money by clearing up a harmful misconception of when you really need (and when do not need) a site using a CMS — and what to do instead.</p><p>In the following, I’ll use WordPress as an example to demonstrate my point hence being the most popular by a mile.</p><h3>When WordPress is the worst idea</h3><p>The name WordPress became the synonym of small business websites. People still think it is the best and quickest way to get the word out about their ventures. In 2021, nothing can be further from the truth. For brochure websites, it is one of the worst things you can do while doing it yourself does not save nor time or money.</p><p><strong>If one or more applies to your situation, you will be better off with another approach:</strong></p><ul><li>Need it be done quickly</li><li>Will not have a dedicated person to update the content frequently</li><li>The content will largely remain the same over time or be updated infrequently</li><li>Looking to implement custom design</li><li>It should be fast</li><li>Have a limited budget on building and maintenance</li><li>You have very limited technical background</li></ul><h4>Ok but why?</h4><p>The platform is primarily intended for blogging where the content changes on the daily basis.</p><p>The editable page content is stored in the database that allows for dynamically assembling page data based on a set of criteria. It works brilliantly when you need the latest posts filtered by a keyword - for example. Not so much when 12 query needs executed just to load the front page with some text, a gallery and a phone number. Speed issues are also difficult to optimise as queries are often executed by plugins and themes.</p><p>Without further expressing much of my hate towards the platform, let me list my primary concerns objectively.</p><h4>1. It doesn’t like version control</h4><p>Actually if you try to add a git repository to the project’s root folder, it’ll be flagged as an issue and displayed to the user like it was some sort of vulnerability or error.</p><h4>2. No package manager</h4><p>Wordpress nudges the user to install the latest update without the option of controlling and rolling back to a specific version. This makes no sense! An older version should be still usable as time passes - just like you can make a call from your 3 years old phone and it won’t blow up if you don’t update. Respecting the user’s decision of using specific versions of plugins and the core itself should not be ignored.</p><h4>3. Plugin write access and hacking</h4><p>Virtually any plugin or theme you install is provided with write and read access to the project directory to a certain degree and also the database. Considering the sheer number of plugins and themes and also their varying quality, it is simply an inconceivable security threat that plays significant role of embedded malware and hacked servers spreading like wildfire.</p><h3>Abandoned sites are the hacker’s playground</h3><p>Most of the time when a WordPress website is launched without a viable long term plan for maintenance, it is in the risk of being abandoned.</p><p>It looks pretty, it is available, job done, so let’s move on to actually running the business. …until one day a customer says: “Btw, I checked your website and it redirects to hotrussianbabesinyourarea.xyz” Checkmate!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FNipj1sHXdJmmGBkGjPMDg.jpeg" /><figcaption>Abandoned sites are the hacker’s playground</figcaption></figure><p>Now hypothetical you tries to log in and surely it won’t work. There is no github repo as you have asked the guy who built it to remove because WordPress recommends against version control (or it simply never occurred that it should be there on the first place).</p><p>Either way your site is hacked now and you have absolutely no plan of action on how to fix it. You delete it and focus on Facebook and Instagram going forward instead of running your own website. That is surely not something that serves the business needs, but it is still better than malware.</p><p>Not a bright prospect yet it happens to so many people that it needs more attention.</p><h3>Is there a better way?</h3><p>In short: there is. As a developer, I am advocating for beautiful custom websites that have personality (looking at you wix.com). I still see the internet as an exciting place where colourful ideas meet and can be expressed. It is a bit of shame in my opinion, that most people use the same platforms for hours each day. Social is the new internet, but still it is a subset of what is available. I would personally like to see more uniquely designed beautiful websites that really support businesses.</p><h4>Static needs (almost) no maintenance</h4><p>First off why would anyone want to store things like page titles, header image urls or primary company email in the database? How often do they change?</p><p>The second tier down the same tree is product and service pages. If you do not sell directly on your website - but are simply letting your visitors know what you offer, it is unlikely to be updated very often. Certainly isn’t worth to keep someone on a payroll to update them if need be.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F7v6Zt2dRx0AyKVE2Recog.png" /><figcaption>Static sites are very easy to maintain</figcaption></figure><p>Static websites are called “static” because they do not fetch content from the database. They can interact with other services, but navigation or static content is not controlled by the database. The most advanced tools take the approach of providing easy and speedy development experience and also the finished product can be minified and optimised for it to take almost no time to load for the user.</p><blockquote>In fact they can be so lightweight that you can host them yourself on an old Mac mini or even a raspberry pi! Read my article on this <a href="https://medium.com/geekculture/how-to-host-your-website-on-an-old-mac-mini-with-ssl-4f7c8125cc8c">here</a>.</blockquote><p>Excellent tools are React and VueJs to name a few. If you venture out to find the right person to complete the job, remember those, so if you see them along with completed projects and X number of years of experience, you can feel reassured.</p><h4>New functionality done right</h4><p>Moving on, sometimes you may want to try out something completely new on your site. Are you sure you want to do it yourself? Finding the right plugin is not an easy task. Customising it only learning that it does not have a key feature is a real waste of time. A professional can do it for you in no time exactly the way you need it and want it.</p><h4>A good web-designer is your friend</h4><p>The static website usually takes more effort and skill in the designing phase. Fortunately web-design is booming as more and more people are getting into, and becoming very good at it!</p><h4>Long term relationship with a developer</h4><p>The key point is: if you like the idea of hiring someone to build your static website for its benefits, it comes naturally to form a long-term business relationship. Updating the content, recompiling and deploying the site takes very little time for the right individual in most cases. We’re talking about minutes here. They will charge you their rate and you can be sure that you are in safe hands.</p><blockquote>This is the approach I recommend for its many benefits.</blockquote><p>It is very different to have a site that looks and works very good and surely will not get hacked one day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*B6s1f1UlRwQ6t1lLJA0THQ.jpeg" /><figcaption>Developers almost always offer long term support on what they once built</figcaption></figure><h4>Conclusion</h4><p>I see the sad story of trying to keep old unmaintained CMS sites afloat against attacks and malware. In the other hand, I enjoy the freedom of building absolutely anything I want as a developer. Running a website can and should be fun and definitely not source of any anxiety over being hacked or underperformance.</p><p>I think there is a communication gap between people who want and need websites and developers who prefer to speak nerd. The latter understand the benefits of new better tools but often fail to communicate effectively where the benefits lie for the customer and the end user.</p><p>Hopefully you have a better understanding of this now, so you can use it for your own benefit!</p><p>Thank you for reading! Have a beautiful day!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ee8ef5c934e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to host your website on an old Mac mini with SSL]]></title>
            <link>https://medium.com/geekculture/how-to-host-your-website-on-an-old-mac-mini-with-ssl-4f7c8125cc8c?source=rss-bbfa5fecc5f5------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f7c8125cc8c</guid>
            <category><![CDATA[apache-server]]></category>
            <category><![CDATA[web-server]]></category>
            <category><![CDATA[web-hosting]]></category>
            <category><![CDATA[home-server]]></category>
            <category><![CDATA[website-development]]></category>
            <dc:creator><![CDATA[Roland Treiber]]></dc:creator>
            <pubDate>Wed, 09 Jun 2021 08:32:18 GMT</pubDate>
            <atom:updated>2021-06-09T12:26:46.373Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZD1MOq7NZLNNZjNb-L3qXw.jpeg" /><figcaption>Set up your own web server and host your sites virtually for free</figcaption></figure><p>Hello there. For a while I contemplated the idea of hosting my website on my home server. Among the reasons were curiosity, ease of making changes in the environment setup, full access and the learning experience.</p><h3><strong>The hardware</strong></h3><p>For this experiment, I have used an old Mac mini specifically to show you that it does not require cutting edge tech. I have bought this machine on Facebook Marketplace for a whopping £30(!) that was probably my luckiest purchase so far considering the specs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bLgFhexvQu1XlVxwI8-TqQ.jpeg" /><figcaption>2009 Mac Mini with SSD, 2.66Ghz Core 2 Duo cpu and 16Gb of ram for £30</figcaption></figure><p>It is a 2009 machine that has a 256Gb SSD and 16gb of ram and a 2.66Ghz Core 2 Duo processor. More than enough to run Apache and serve a simple React single page application!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cSjWpytZzKoepgkKaRxHA.png" /><figcaption>2009 mac mini from Facebook Marketplace… Perfect!</figcaption></figure><h3><strong>Things to consider about the website</strong></h3><p>So at this point I was ready to create the website. Not every websites are created equal though. It is important to mention that high traffic and resource intensive sites are probably not the best candidate for this type of hosting solution.</p><h4>In the other hand, it works out perfectly for any of the following:</h4><ul><li>personal website or portfolio</li><li>promotional site</li><li>survey</li><li>closed access web application</li></ul><p><em>That said, I have decided to host my own personal website this way.</em></p><h3>The reasons:</h3><ul><li>I am expecting moderate amount of traffic</li><li>It is a static React application</li></ul><p>To access my site directly on my old Mac Mini in my living room, browse: <a href="https://thecaringdeveloper.com/">https://thecaringdeveloper.com</a></p><h3>Preparations</h3><h4>Creating the website</h4><p>First off, I would advise against hosting a WordPress website at home, however it is entirely possible. Wordpress has a hybrid way of storing the page data. Even though you may create static template parts with hard-coded parts of things almost never change, there are still plenty of data that is loaded from the database. So every browser request would trigger a bunch of expensive php logic and database query before page loads. This type of a web application needs some juice to work fast. It will not be terrible, but you can achieve better results going for a cheap shared hosting.</p><p>So my website is static. It means that the pages are self-contained, and so do not load data from the database. It does not actually have any database connection. If you are not familiar with React: the way it works is that you create your site on your machine, then build it. At the build phase the code will be minified and optimised heavily, so your code is ready to be put to work.</p><h4>The design</h4><p>The work started with actually planning and designing the content of the site. I used Adobe XD for this. For someone having a design background, it is a relatively easy task. It only took me one morning. To get your website design ready, I would recommend starting with the content. Take a blank sheet of (Google docs) paper and pour onto it what you have to say to people visiting your website. It is easier said than done of course, however the ease you can do it is a strong indicator of how clear your message is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7At2K1cFO_Ez26chjqFBzQ.png" /><figcaption>I used Adobe XD to create the website design</figcaption></figure><h4>The coding</h4><p>As I mentioned, I have used React for the coding. It would go way out of scope to talk much about how to do it, so I keep it very short:</p><p><strong>Code it up and compile it :)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*G-Et9tzfv6t9Uf9xqyvqTw.png" /></figure><p>At this point you have the application ready. I would highly recommend to store the codebase in Github, however it is not absolutely essential. You may simple copy it over to your server.</p><p>In my case, I have set up a repo to make it easier keeping track of changes.</p><h4>Head back to your server</h4><p>At this point I have had my site code ready waiting to be deployed. Let’s see what steps are required for the site to be served in your browser.</p><p>In the following sections, I’ll go into detail of the following steps:</p><ul><li>Opening up port 80 and 443 in the router settings</li><li>Installing brew</li><li>Installing Apache</li><li>Configuring the domain DNS</li><li>Setting up the site to be served by Apache</li><li>Getting an SSL certificate</li><li>Installing the SSL certificate for the site</li><li>Optimisations</li></ul><h4>Opening up port 80 and 443 in the router settings</h4><p>I am a Virgin Media customer, so my router can be accessed on 192.168.0.1 on the local network. Check what ip your router uses. If it is provided by your ISP, this information can be found on their website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vqs9LZhasNqcRpErDRvyGQ.png" /><figcaption>Access your router settings (most common ip-s are 192.168.0.1 or 192.168.1.1)</figcaption></figure><blockquote>What we are interested in, is the <strong>port forwarding</strong>.</blockquote><p>When you type a url into the address bar in your browser, you access the server behind the domain on port 80 or 443 without specifying the port. (80 for http and 443 for https)</p><p>If you try any other port, the server will most likely not respond at all.<br>This will hang and eventually timeout: <a href="http://thecaringdeveloper.com:412/">http://thecaringdeveloper.com:412</a></p><p>Typing your own public ip address into your browser will try to access your router or modem on port 80. It depends on the settings what happens. By default, not much.</p><p>The magic starts when your router is configured to forward a port to whatever is listening to on your machine.</p><p>Let’s elaborate on what is exactly happening here at this stage:</p><ul><li>A request comes in on port 80</li><li>Your router says: Ok, so anything coming in on port 80 should be forwarded to port 80 on the local network.</li><li>Is there anyone listening there? Apache? Nginx? Are you guys there to pick up the phone and respond? Alright then fine. — &gt; error</li></ul><h4>Let’s install Apache (but before we do it, let’s install homebrew)</h4><p>As my machine is wiped and not used for anything else (apart from being attached to a projector and netflix-ing occasionally), it does not yet have had the necessary packages to to the job.</p><p>If you’re on the Mac, your go-to tool for package management is <a href="https://brew.sh/">Homebrew</a>.</p><p>It takes a while and when done, I was ready to install Apache.</p><p>Use this command:</p><pre>brew install httpd</pre><p>You may read <a href="https://tecadmin.net/install-apache-macos-homebrew/">this article</a> to troubleshoot if something goes wrong and deactivating the default apache installation if your system has one.</p><p>Once it finished and you can confirm that it is working, you can test it out by typing your public ip address in your address bar. You should see “It works!” (or something similar other than a 500 error)</p><p>It is not time to celebrate yet, but indeed port 80 is being forwarded and Apache is responding ok on the other end. Halfway there :)</p><h4>Configuring the domain DNS</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6k0SIwVBvPk1AL2qgvPkRg.png" /><figcaption>Point your domain to your public ip</figcaption></figure><p>Your public ip is where your machine can be contacted on the internet. It is much like a phone number. To make it easier for the users, it can be replaced by a human readable address such as google.com. What it’ll do, is to route your call to the appropriate ip.</p><p>So in this case, my next logical step was to buy a domain. You can buy a domain on many websites. I chose <a href="https://godaddy.com/">Godaddy</a> for simplicity.</p><p>Once my domain purchase was complete, I changed the ip it points to, to my public ip, so when someone types this url, it will end up on port 80 at my router and be forwarded to Apache to respond.</p><p>It takes some time for the DNS settings to update, so it was my perect opportunity to have a coffee and breakfast with my family. By the time I finished my toast and eggs, I could see “It works!” when typing <a href="https://thecaringdeveloper.com/">http://thecaringdeveloper.com</a> in my browser on any network or device.</p><h4>Setting up the site to be served by Apache</h4><p>Ok, so far it was easy wasn’t it? Actually finding the right machine online took me the most effort. Design and coding was fun and all else was installing software and fiddling with settings. :)</p><p>The way Apache works is that you need to specify everything through config files.</p><p>What we are interested in right now is to make it listen to port 80 (insecure connection) and serve the website it is told to.</p><p>The first file I have had to look at is :<br>/private/etc/apache2/https-vhosts.conf. The location of these files may differ due to your system and version.</p><p>As the name suggests, this file is the home of vhosts (Virtual Hosts), so it is time to add one.</p><pre>&lt;VirtualHost *:80&gt;<br>    ServerName thecaringdeveloper.com<br>    ProxyPreserveHost On<br>    ProxyRequests Off<br>    ProxyPass / <a href="http://localhost:8082/">http://localhost:8082/</a><br>    ProxyPassReverse / <a href="http://localhost:8082/">http://localhost:8082/</a><br>    ErrorLog &quot;/private/var/log/apache2/[YOUR SITE]-error_log&quot;<br>    CustomLog &quot;/private/var/log/apache2/[YOUR SITE]-access_log&quot; <br>&lt;/VirtualHost&gt;</pre><p><strong>A note about reverse proxy</strong></p><p>As I am looking to host other websites on the same machine (or at least keep the possibility open), so I need a way to let Apache know that different files should be served based on the domain.</p><p>To solve this, we have reverse proxy. Simply put, it preserves the request host and forwards the call to localhost on any port you specify.</p><p>As this happens internally, this port does not need to be open to the world.</p><p>So some additional configuration is required so my site is served on port 8082 on localhost.</p><p>To achieve this, I created the following configuration file:</p><pre>$ /private/etc/apache2/extra/thecaringdeveloper.conf</pre><p>To use this file, I had to include it in the https.conf file by adding the following line:</p><pre>Include /private/etc/apache2/extra/thecaringdeveloper.conf</pre><p>The actual config holds the details of what to serve in the browser. In my case it looks like this:</p><pre>Listen 8082<br>&lt;VirtualHost *:8082&gt;<br>    DocumentRoot &quot;[YOUR SITE DIRECTORY]&quot;</pre><pre>    &lt;Directory [YOUR SITE DIRECTORY]&gt;<br>      Options Indexes FollowSymLinks MultiViews<br>      AllowOverride All<br>      Require all granted<br>    &lt;/Directory&gt;<br>&lt;/VirtualHost&gt;</pre><p>To observe changes, Apache needs to be restarted.</p><p>To confirm that my config works as expected, I tried to access the site on port 8082 on the machine locally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gSByHQIhMLFgW4cKoNVb7Q.png" /><figcaption>Once the files are on the server, having the virtual host in place, I could access the site locally on port 8082</figcaption></figure><p>Better yet, having the domain pointed to my ip, I was also able to access the site on the domain!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*SAYkeOpUfgtk9VWyVZLcvw.png" /><figcaption>It is available but not secure :(</figcaption></figure><h3>Getting an SSL certificate</h3><p>As you can see, there is an issue with the site: The lack of the padlock or lack of the lock or locklack… All right all right it is a slippery slope on jokes, so let’s stop it right here. :)</p><h4>Generate a CSR</h4><pre>openssl req -newkey rsa:2048 -keyout thecaringdeveloper.key -out thecaringdeveloper.csr</pre><p>I have used the command above to generate a Certificate Signing Request (CSR) and a key file for it. It will ask a few questions. You should answer accurately.</p><p>If everything goes well, it will save a new file in your system with the specified name.</p><h4>Purchase an SSL certificate</h4><p>In my case, I will never process payments through my brochure website, so all I am interested in is the padlock. Therefore I went with the cheapest and simplest option, that in my opinion is <a href="https://www.gogetssl.com/">GoGetSSL</a>.</p><p>Once you are done with the steps of buying a certificate, you will be asked to complete your certificate by entering a CSR.</p><p>Take the content of the .csr file you have created in the previous step and copy it in the appropriate box.</p><p>The certificate needs then be validated. There are a few options to do this. I chose http as I knew that the site works through http and I can easily copy a file in its folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J98mv9VHXDGq8sGT5jOzbg.png" /><figcaption>The http validation is simply checking that a file they give you can be accessed on the server.</figcaption></figure><p>In my case, this is what the validation looked like. It may be different for you.</p><p>Once the validation was successful, I have received an email, so I was ready to install the certificate.</p><p>There are 3 files that are needed to achieve the task:</p><ul><li>The key file</li><li>The certificate</li><li>The CA Bundle file</li></ul><p>The key file was generated at the same time when the CSR, so you can find it next to it. It has the .key extension. The other two are in the email.</p><h3>Installing the SSL certificate for the site</h3><p>I have created 3 empty files to get started. The location is entirely up to you. I like to keep them in my Project folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*KpTHvlhS_r54QY0-5CDSVQ.png" /><figcaption>The files I needed to install the certificate.</figcaption></figure><p>In the next step I copied the content over from the appropriate files.</p><h4>The SSL Apache config</h4><p>So far my website is served just fine over http, so the config I have in place for port 80 is valid for sure.</p><p>What is needed now is another config that would do essentially the same but also uses Apache’s SSL engine and uses my certificate files.</p><p>So I have added a new virtual host into the appropriately named httpd-ssl.conf in the /etc/apache2/extra folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*U870qSx5Y2wQQw48UwVb_A.jpeg" /><figcaption>There are predefined config files for a range of use cases. You can also create your own ones.</figcaption></figure><p>My config file looks like this:</p><pre>&lt;VirtualHost *:443&gt;<br>ServerName <a href="https://portal.thecaringdeveloper.com/">https://thecaringdeveloper.com</a><br>DocumentRoot &quot;[LOCATION OF THE WEBSITE]&quot;</pre><pre>&lt;Proxy *&gt;<br>  Order deny,allow<br>  Allow from all<br>&lt;/Proxy&gt;</pre><pre>SSLEngine on<br>SSLProxyEngine On<br>ProxyPreserveHost On<br>SSLProxyVerify none<br>ProxyRequests Off</pre><pre>SSLCertificateFile [PATH TO THE CERTIFICATE FILE]<br>SSLCertificateKeyFile  [PATH TO THE CERTIFICATE KEY FILE]<br>SSLCertificateChainFile [PATH TO THE CA BUNDLE FILE]</pre><pre>ProxyPass / <a href="http://localhost:8083/">http://localhost:8082/</a><br>ProxyPassReverse / <a href="http://localhost:8083/">http://localhost:8082/</a><br>RequestHeader set X-Forwarded-Proto &quot;https&quot;<br>RequestHeader set X-Forwarded-Port &quot;443&quot;</pre><pre>ErrorLog &quot;/private/var/log/apache2/thecaringdeveloper-ssl-error_log&quot;<br>CustomLog &quot;/private/var/log/apache2/thecaringdeveloper-ssl-access_log&quot; common</pre><pre>&lt;Directory [LOCATION OF THE WEBSITE]&gt;<br>  Options Indexes FollowSymLinks MultiViews<br>  AllowOverride All<br>  Require all granted<br>&lt;/Directory&gt;</pre><p>After restarting Apache, I could observe the site loading through https! Yay, is it time to celebrate yet? Well almost, but no :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*CBbKCj_0ldZxXvQ1r56NZg.png" /></figure><h3>Optimisations</h3><p>The site actually loads over http and https as well. That is not very professional I would say, so let’s make sure it always loads over https and so “Not secure” is never displayed to the user.</p><p><strong>Do not edit .htaccess!</strong></p><p>I have made the mistake of going into this bit before doing proper research, so here is where I may save you some time hopefully.</p><p>If you try to force https in your .htaccess file, it will result in a redirect loop. Why? Because the site request is internally redirected to <a href="http://localhost:8082/">http://localhost:8082</a> in my case. Notice the <strong>http</strong> there. The ssl certificate works for specific domains and cannot be installed therefore to localhost. The .htaccess is triggered when hitting the actual files in the directory, so it will try to redirect to <a href="https://localhost:8082/">https://localhost:8082</a> and will fail. (I am not 100% sure that this is exactly what happens, please correct me if I am wrong. This is how I understood by the symptoms and logs. It makes not much difference if it fails somewhat differently as failure is failure.)</p><p>So the solution is to add the redirection to the virtual host in the httpd.conf file as it is the first point of contact. As soon as Apache is presented with the request, it should know that it needs to be redirected to https.</p><p>The extra lines to add after the DocumentRoot:</p><pre>RewriteEngine On<br>RewriteCond %{SERVER_PORT} !443<br>RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [R=301,L]</pre><p>You may also remove what is after it, but I would advise against it. If you ever need to serve the site over http again temporarily for whatever reason (most common is a new cert due to be validated over http), you simply comment those 3 lines out and you’re good to go.</p><h3>Conclusion</h3><p>There you go! You have it! This is how you can set up your simple brochure website with SSL certificate on an old Mac Mini.</p><p>To do the same on a linux machine or a raspberry pi (!) is not too different. Give it a try! I am really pleased with this setup because I can add more sites should I want to as well as the machine itself is quiet and blends in with the rest of the interior.</p><p>If you have questions, please feel free to reach out on hello@thecaringdeveloper.com</p><p>Have a nice day and have fun with your own home web server!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f7c8125cc8c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-to-host-your-website-on-an-old-mac-mini-with-ssl-4f7c8125cc8c">How to host your website on an old Mac mini with SSL</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>