<?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 João Nadais on Medium]]></title>
        <description><![CDATA[Stories by João Nadais on Medium]]></description>
        <link>https://medium.com/@joaonadais?source=rss-a2cd66f730c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y4Xaw_Z_6tCz-AqXQOkn5g.jpeg</url>
            <title>Stories by João Nadais on Medium</title>
            <link>https://medium.com/@joaonadais?source=rss-a2cd66f730c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 21:22:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@joaonadais/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[Simplify your code: don't use "else"!]]></title>
            <link>https://levelup.gitconnected.com/simplify-your-code-dont-use-else-7fcbe32a353e?source=rss-a2cd66f730c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fcbe32a353e</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[refactoring]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[João Nadais]]></dc:creator>
            <pubDate>Tue, 01 Nov 2022 03:01:41 GMT</pubDate>
            <atom:updated>2022-11-01T03:01:41.493Z</atom:updated>
            <content:encoded><![CDATA[<h4>Applying the &quot;don’t use else&quot; principle to a real-life example</h4><h4>A real-life example of how to avoid using the else keyword so that your code becomes easier to read and maintain</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KS6LK4j2thi4dLyZ" /><figcaption>Photo by <a href="https://unsplash.com/@ilyapavlov?utm_source=medium&amp;utm_medium=referral">Ilya Pavlov</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As developers, we spend much more time reviewing and reading through code as opposed to writing new features and new pieces. This means that optimizing our code for readability and maintainability will result in an overall increase in productivity. With this in mind, there are a couple of guidelines that can help us achieve this goal. These guidelines are called Object calisthenics and were created by Jeff Bay in the book Thoughtworks Anthology. You can find links for the book as well as an article explaining what they are and a video by Nick Chapsas on the same topic, in case you want more information on the matter. One of the principles described in there is not to use the else keyword and that&#39;s where I&#39;ll focus in this article.</p><p>Many of the examples people stumble upon are very simplistic and not really related to a real-life scenario, making it harder to understand why exactly this can be a good thing. In this article, I&#39;ll be showing a real-life example and how applying some refactoring techniques related to if statements can make your code much easier to understand</p><h3>The situation</h3><p>Every backend service that needs to be implemented requires some sort of authentication, and authentication via API key is one of the simplest ones, while also being very effective in doing it. In this case, the API key is provided via a header and the gist below describes the process of validating that the API key is accepted. Find the gist below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b035160b68ada0ec0dbe565c949fb4bc/href">https://medium.com/media/b035160b68ada0ec0dbe565c949fb4bc/href</a></iframe><p>In this piece of code, the positive scenario we do care about is when the header is present with a value and that value is one that we recognize in our settings. However, looking at the code it is not so evident that this is the scenario. Let&#39;s look into a couple of issues with this code:</p><ol><li>There are two consecutive ifs, and the first one contains almost all of the logic. This breaks another principle of object calisthenics stating that there should be only one level of indentation per method</li><li>It is hard to understand which else is related to which if, as there is a lot of logic within those ifs</li></ol><p>Let&#39;s look into the solutions for each of the problems at a time.</p><h3>Solution #1 — early exit</h3><p>We can simplify this code by applying the early exit principle. In this case, since we don&#39;t care to process anything if there is no API key provided in the headers, we could return already at that point. See the example here:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8134497464e35ec83b03d09dd348879d/href">https://medium.com/media/8134497464e35ec83b03d09dd348879d/href</a></iframe><p>By exiting first we solved already two issues:</p><ul><li>It is now clearer what we do in case no API key is provided</li><li>There is now only one level of indentation for the whole method</li></ul><p>There is still another issue with this code, which is the usage of the else keyword. Let&#39;s tackle that now</p><h3>Solution #2— remove the else keyword</h3><p>As there is no more logic that we would need to process after either it is negative or positive, we can return once the positive scenario is executed. See refactored example below:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8554abed8bdd1ec972dcdb942bd6b28d/href">https://medium.com/media/8554abed8bdd1ec972dcdb942bd6b28d/href</a></iframe><p>As you can see, the idea was as simple as adding a return statement within the if block. This ensured a more linear logic to follow as well as one level of indentation.</p><h3>Conclusion</h3><p>Guidelines like object calisthenics can be fairly simple to understand, but as you can see in this example, they can be very powerful to make your code more readable and make sure that the next time you have to read through this code, you will have an easier time understanding it.</p><p>If you want to discuss feel free to comment here or find me on any of these social networks: <a href="https://linktr.ee/joaonadais">linktr.ee/joaonadais</a>.</p><p>See you at the next one!</p><h3>Resources</h3><p>The Thoughtworks anthology: https://pragprog.com/search/?q=thoughtworks-anthology</p><p>Object calisthenics: <a href="https://blog.avenuecode.com/object-calisthenics-principles-for-better-object-oriented-code">https://blog.avenuecode.com/object-calisthenics-principles-for-better-object-oriented-code</a></p><p>Nick Chapsas video on Object calisthenics: https://www.youtube.com/watch?v=gyrSiY4SHxI</p><p>Gists:</p><ul><li><a href="https://gist.github.com/nadais/d8aa732c5fdef43448bb71a7d458dc15">https://gist.github.com/nadais/d8aa732c5fdef43448bb71a7d458dc15</a></li><li><a href="https://gist.github.com/nadais/e235cbde211add3d0d0c997fef465936">https://gist.github.com/nadais/e235cbde211add3d0d0c997fef465936</a></li><li><a href="https://gist.github.com/nadais/14c38f78d8782afc1a4ee279a34f7470">https://gist.github.com/nadais/14c38f78d8782afc1a4ee279a34f7470</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fcbe32a353e" width="1" height="1" alt=""><hr><p><a href="https://levelup.gitconnected.com/simplify-your-code-dont-use-else-7fcbe32a353e">Simplify your code: don&#39;t use &quot;else&quot;!</a> was originally published in <a href="https://levelup.gitconnected.com/">Level Up Coding</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why you should abstract your access to DateTime]]></title>
            <link>https://medium.com/geekculture/why-you-should-abstract-your-access-to-datetime-f9fd3b3e2426?source=rss-a2cd66f730c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9fd3b3e2426</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[c-sharp-programming]]></category>
            <dc:creator><![CDATA[João Nadais]]></dc:creator>
            <pubDate>Sun, 16 Oct 2022 04:31:48 GMT</pubDate>
            <atom:updated>2022-10-16T04:31:48.495Z</atom:updated>
            <content:encoded><![CDATA[<h4>Abstract DateTime access with dependency injection</h4><h4>A simple way to make tests deterministic in regard to date access</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1-sR2owRrvoVQsqb" /><figcaption>Photo by <a href="https://unsplash.com/@aronvisuals?utm_source=medium&amp;utm_medium=referral">Aron Visuals</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello everyone!</p><p>The concept of dependency inversion is a widely known one, stating that one should depend on an interface rather than on a specific implementation, as it allows our tests to be more deterministic and easier to maintain. However, in the case of dates and times, it is very easy to overlook as they are simple values with no complex logic.</p><h4>Example code</h4><p>Let&#39;s look at this function as an example</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c894cff806f5901989361a1284fcc132/href">https://medium.com/media/c894cff806f5901989361a1284fcc132/href</a></iframe><p>As you can see, the code is fairly simple. It would return the correct greeting based on the current time of the day.</p><p>Now let&#39;s try to test this code and run those tests:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7e1d62b5c3043e7eea39b9f2b67bf68a/href">https://medium.com/media/7e1d62b5c3043e7eea39b9f2b67bf68a/href</a></iframe><p>After running it, this is the result we get:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NE4ruxNneOhYZOKyEVrPlw.png" /></figure><p>Since I am running these tests in the afternoon, only the test related to good afternoon will pass. This results in our tests being dependent on whatever time they are being run, making them not deterministic</p><h4>Solution</h4><p>One solution to this is abstract the access to DateTime into an interface. Below is an example of this interface:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1128873a42d9de1d86080c6a12d33c8c/href">https://medium.com/media/1128873a42d9de1d86080c6a12d33c8c/href</a></iframe><p>You can then pass this provider through dependency injection into your class</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7fe5a13a9cd09153c0721632db5c5de/href">https://medium.com/media/b7fe5a13a9cd09153c0721632db5c5de/href</a></iframe><p>And the tests would now look like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76751eb4cc0d377b12ef6de491021ee4/href">https://medium.com/media/76751eb4cc0d377b12ef6de491021ee4/href</a></iframe><p>As you can see, now each test is able to pass a specific time of the day. Now, even if I am still running these tests in the afternoon, I get the following result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*vkJgxOmPn155Gxr5aWYLxA.png" /></figure><p>This ensures that no matter when you run the tests, the results will be always the same, and you will have no issue with different times of running results in different test execution results</p><h4>Conclusion</h4><p>In this article, I wanted to show a common pitfall that I have seen across many codebases in the past, and why a simple solution like this one can not only ensure your tests are deterministic, but also you have a point of reference across your code to where Dates and times are being used</p><p>The full repository code can be found <a href="https://github.com/nadais/Medium-abstract-datetime">here</a></p><p>Even though the snippets of code are in C#, the concepts shown here would be very much applicable in any other language. The difference would be in the libraries used and how the interface would be injected</p><p>Hope you liked it and see you at the next one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9fd3b3e2426" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/why-you-should-abstract-your-access-to-datetime-f9fd3b3e2426">Why you should abstract your access to DateTime</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>
        <item>
            <title><![CDATA[How to host your own frontend with a custom domain for free]]></title>
            <link>https://medium.com/geekculture/how-to-host-your-own-frontend-with-a-custom-domain-for-free-3e8fd0dc4ac3?source=rss-a2cd66f730c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e8fd0dc4ac3</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[cloudflare]]></category>
            <dc:creator><![CDATA[João Nadais]]></dc:creator>
            <pubDate>Wed, 12 Oct 2022 15:01:44 GMT</pubDate>
            <atom:updated>2022-10-12T15:01:44.994Z</atom:updated>
            <content:encoded><![CDATA[<h4>Free Custom domain on GitHub pages with cloudflare</h4><h4>Let&#39;s build a React app, and host it on GitHub pages with our own free custom domain</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RoZPK2Iwk1U1QiDU" /><figcaption>Photo by <a href="https://unsplash.com/@ianjbattaglia?utm_source=medium&amp;utm_medium=referral">Ian Battaglia</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Hello everyone!</p><p>While I have seen multiple separate articles about how to host your own app with GitHub pages, I have yet to see an article guiding through the whole process of creating the repository, deploying the code, getting your own domain, and then setting it on your own project. So here you go!</p><p>To follow this article you&#39;ll need:</p><ul><li>A GitHub account</li><li>Your own custom domain (I&#39;ll be using <a href="https://www.freenom.com/">Freenom</a> to get my own for free)</li><li>A <a href="https://www.cloudflare.com/en-gb/">Cloudflare</a> account in order to set up your custom domain</li></ul><p>Got it all? So let&#39;s dive in!</p><h3>Base state</h3><p>In order to have more focus on this article, we are taking some assumptions at the starting point. So we are having:</p><ol><li>A GitHub repository called example-custom-domain</li><li>An app generated using create-react-app</li><li>The gh-pages NPM package is installed with both deploy and pre-deploy tasks configured so that it can be deployed to GH pages from the start</li><li>The homepage is being set to /example-custom-domain in package.json, so it can render create-react-app</li></ol><p>You can see the code of the base state <a href="https://github.com/nadais/example-custom-domain/tree/base-state">here</a></p><h3>Obtaining your own domain</h3><p>There are multiple ways to get your own domains, for example with websites like <a href="https://www.godaddy.com/">godaddy</a>, which in turn could help you set up other things like your own custom email address and server. However, sometimes you do not want or need a paid domain. so a free alternative comes in handy. In this case, you can use <a href="https://www.freenom.com/">Freenom</a>.</p><p>In order to get your own domain with Freenom, you&#39;ll need to create an account. Fortunately, Freenom supports login with socials so this step can only take you a couple of seconds</p><p>Once your account is created, you can now search for your domain. In my case, I&#39;m using the domain example-custom-domain, which matches the name of my repo and provides the following options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8I6yi22B8IOX9oebYUibKA.png" /></figure><p>You can pick any of those first 5 as free domains, while the ones below will have a cost per year. Since I&#39;m looking at only free ones, I&#39;ll be picking example-custom-domain.tk. As you can see in the image below, I tried first to go example-custom-domain.ga but it was unavailable so I picked another one</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nzJHxSMz3Kf4zh-xXmg8vA.png" /></figure><p>Once you&#39;re good to go press checkout (green top right button) and you should be forwarded to the following screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkNwclTVAhF3a0gptsTf6w.png" /></figure><p>The default of the domain is 3 months, but it can be extended up to 12 months for free, so we can extend that. We will also configure later DNS rules and domain forwarding, so you can ignore those buttons for now.</p><p>Once you press the continue button the following screen will appear:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uP6Onyg1eDGjGe71oSQ7aQ.png" /></figure><p>If everything matches what you expect, press the Complete Order button.</p><p>Done! Now you have your own domain, which we can use to set up our app on Github pages</p><h3>Configuring DNS rules and security</h3><p>While Freenom provides some flexibility in how to set your DNS rules, you can take advantage of other services to customize your domain, such as Cloudflare. Cloudflare is an application used in many enterprise-level applications with a proven track record of protecting against denial of server attacks as well as ensuring the security of your domain</p><p>Once you create an account with Cloudflare and validate your email we can start adding our new domain to it. Example image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*73nnHZutaer0OovoORs9zg.png" /></figure><p>Click on the top-right to add your domain. The following image should appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_p8RBL2OZEDfM3a-jJHTcw.png" /></figure><p>Choose the free plan and click on Get started. Cloudflare should now show that you need to remove the nameservers from Freenom and use the cloudflare ones. Images are blurred as the exact values might be different at the time you do it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RanbawMwHx6daH104NKoDw.png" /></figure><p>To do this, go back to your Freenom account, and on the top right select Services -&gt; My Domains. Once your domain appears click on Manage domain. On the domain page, select Management tools -&gt; Nameservers. You should have a page as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b1H0GXchLxe9cGnJIWcwbw.png" /></figure><p>Select use custom nameservers and then insert the values that Cloudflare provided. Once this is done, you&#39;re ready to proceed in Cloudflare, so you can click on Done, check nameservers</p><p>Your domain is now set using Cloudflare! Now it&#39;s time to go back to Github and set your page to use the new custom domain!</p><h3>Set your custom domain on GitHub</h3><p>In order to set your custom domain, you&#39;ll need to have a CNAME file in the <strong>public</strong> folder of your app. If it is not in the public folder, this file will not be taken The content of it should be just your domain name</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e1b2424bf7369a3d1a0558ba0c6efa0a/href">https://medium.com/media/e1b2424bf7369a3d1a0558ba0c6efa0a/href</a></iframe><p>Now you can push it to your repository and run the deploy command npm run deploy . In case you were using the default setup of GitHub pages, make sure to also remove the homepage tag in your package.json file, as it will now serve from root and not from a path.</p><p>We are almost there! For the final configurations head over to GitHub and navigate into Settings -&gt; Pages. You should see a screen like the one below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYI-yPThb_g5Iz98QrG4PQ.png" /></figure><p>Now the last step! To set your domain you&#39;ll need to set the IPs to point to GitHub IPs. To do so, you&#39;ll need to go back to Cloudflare and select your domain and then DNS. Once you&#39;re there, you should see a screen like the one below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHucz3xUxu-ftVb1VycSvA.png" /></figure><p>You&#39;ll need to set a CNAME rule to point to the root of your GitHub pages (mine is nadais.github.io) and set A rules, one for each IP that GitHub provides. At the time of writing, these were the IPs, but to get the most up-to-date information you should check them from Github documentation <a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site">here</a>.</p><p>And there you have it! Your custom domain is now set and secured!</p><h3>Conclusion</h3><p>This article is meant to work as a documentation tutorial, in case someone would also want to set up their own custom domain for their website and would like a one-stop-shop for it</p><p>As always, any comments or suggestions feel free to leave them in the comments and I&#39;m happy to discuss them!</p><p>Hope you enjoyed it and see you at the next one!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e8fd0dc4ac3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/how-to-host-your-own-frontend-with-a-custom-domain-for-free-3e8fd0dc4ac3">How to host your own frontend with a custom domain for free</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>
        <item>
            <title><![CDATA[Applying IT skills to karaoke parties]]></title>
            <link>https://medium.com/geekculture/applying-it-skills-to-karaoke-parties-cc66fce39bcd?source=rss-a2cd66f730c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc66fce39bcd</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[project-management]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[mongodb]]></category>
            <dc:creator><![CDATA[João Nadais]]></dc:creator>
            <pubDate>Thu, 05 May 2022 06:32:39 GMT</pubDate>
            <atom:updated>2022-05-05T06:32:39.188Z</atom:updated>
            <content:encoded><![CDATA[<h4>Development with people without an IT background</h4><h4>A cooperation story between people with and without IT background, to ease up the preparation of karaoke parties</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ztywtaSqRf0uH6ia" /><figcaption>Photo by <a href="https://unsplash.com/@alvarordesign?utm_source=medium&amp;utm_medium=referral">Alvaro Reyes</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Coming from an IT background, we tend to look into things around us and try to jump in on the next big thing: the newest library, programming language, framework, and so on. However, sometimes we can look into smaller things/events around us, and with a little amount of effort on our part, we can have an impact in easing up other people&#39;s lives, especially when those people do not come from the same background.</p><h3>The situation</h3><p>Due to new life circumstances, I started taking part in a new circle of friends who quite often like to organize karaoke parties. Since this group does not come from an IT background, I quickly figured out that some points could be improved in the preparations. For example:</p><ul><li>The catalogs were being maintained fully manually with word documents and passed to the event participants as PDFs. This meant that the only way to search through the catalogs was via the find option in the PDF reader</li><li>Every time a new song was added a number needed to be assigned. This also meant that they needed to keep track of all deleted songs in history to know which numbers were available. This was also achieved via a word document filled manually</li><li>As the numbers were all assigned manually, there was a fairly high possibility that due to human error multiple songs would get assigned the same number</li></ul><h3>Phase 1 — Proof of Concept (POC)</h3><p>For the first concept of the app, the following steps were necessary:</p><ol><li>Load the catalogs as a word document in some data storage</li><li>Return those catalogs into a UI that would allow people to filter and sort the content easily</li><li>Use some free hosting and data storage to deploy both the app and the frontend</li></ol><p><strong>Catalog loading</strong></p><p>Since the structure of data stored wasn&#39;t a problem and the data was not hierarchical, a caching solution (Redis) was used. This would be a decision that would come back to haunt me down the line, but it did fit for POC.</p><p><strong>Allow searching/sorting via UI</strong></p><p>There are many libraries out there that provide features like sorting, searching, and management of data in a table, so implementing this kind of functionality on our own was never really seen as an option. With this in mind, the library ag-grid (<a href="https://www.ag-grid.com/">https://www.ag-grid.com/</a>) was used. This library provided out of the box filtering and sorting for the data that we add in there, and it has quite extensive documentation and feature set which could help cover future needs</p><p><strong>Hosting and data storage</strong></p><p>Since the code was stored in GitHub already, hosting the frontend in GitHub pages seemed like an easy and convenient option. Hosting the backend had a couple more alternatives, but from the moment we were able to use Docker containers, any free service would suffice. In the end, Heroku was chosen, as not only it is free and requires little setup, but also it already has integrated solutions for data storage (for example a Redis solution for caching), which made the setup easier</p><h3>Feedback for phase 1</h3><p>Now the POC was out and ready for the initial feedback. The response was very positive all around! They loved what they could do already and it was seen as an improvement over the current situation. But of course, there were points for improvement, namely:</p><ul><li>The information about song categories from the catalogs was lost on the app. This had to be recovered</li><li>By loading the catalogs all together it became evident the presence of duplicates or overlapping numbers</li></ul><p><strong>Category management</strong></p><p>As the information of categories was already provided in the original word documents, this was just a matter of making sure this data is fetched and changing the UI to also show it and filter based on it.</p><p><strong>Catalog management — duplicate checks</strong></p><p>Managing the catalog required a lot more insights into the data, which we could not get simply from raw cached info. This triggered phase 2 of the project.</p><h3>Phase 2 — Generating insights and catalog management</h3><p>We needed to have some structure in our data storage to generate insights. Storing all information raw and then processing it in memory would just not be scalable if we wanted to address catalog problems like duplicate entries as well as checking the available numbers after a song was deleted. With this in mind, and since we could still benefit from a hierarchical structure, we decided to go for MongoDB. Since MongoDB provides a free tier and it&#39;s also very easy to connect locally by taking advantage of Docker containers, it also simplified the future development.</p><p>So now the data was not in cache anymore but in a MongoDB collection, how can we extract those insights? Here are some of the pieces of information we wanted to know:</p><ol><li>Are there two songs with the same number? Which ones?</li><li>Do we have songs that appear in multiple catalog files? Can we merge them?</li><li>Are there gaps in the number sequence that we have for our songs? If yes, which numbers are available?</li></ol><p><strong>Songs with the same number</strong></p><p>By changing the data to use an actual database where we could query on its attributes like the number, finding songs with the same number became an easy problem to solve, as we could just query for all the songs where the same number appeared more than once. Once we have that, we can produce a list of all those possible duplicates. This list would then be shared with the original author of the catalogs, who could then analyze whether this was a mistake and they needed different numbers, whether the song appeared as a duplicate by oversight or if it was on purpose.</p><p>Having this check proved to be very useful as future additions to the catalog could be run against it multiple times, giving us immediate feedback</p><p><strong>The same song appears in multiple catalog files</strong></p><p>This was a real scenario was we had two catalog files, one for songs in the French language and another for English. A song could appear in both catalogs provided they had parts of it in French and another in English for example.</p><p>After communication with the owner of the catalog, we agreed that a song with the same name, number, and artist appearing in multiple catalogs could just be merged into a single entry, which would have a reference for both catalogs</p><p><strong>Gaps in number sequence</strong></p><p>Since we now have the list of all assigned numbers together, we could query our list to find which numbers were not assigned and report a list with these numbers. As a result, the document where the deleted songs were being kept for future sake was made obsolete, since we could now obtain the same list in less than seconds, with no manual error</p><h3>Conclusion</h3><p>In this article, I went through the process of looking at a problem, establishing a POC, gathering the initial feedback, and iterating the POC into a more stable and useful version.</p><p>The app itself can be found <a href="https://nadais.github.io/karaoke-app/">here</a> and the code can be found <a href="https://github.com/nadais/karaoke-app">here</a></p><p>This is the first article I have ever written for a tech platform, so any comments or questions and sharing would be more than appreciated!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc66fce39bcd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/applying-it-skills-to-karaoke-parties-cc66fce39bcd">Applying IT skills to karaoke parties</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>