<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: IAmNelu</title>
    <description>The latest articles on DEV Community by IAmNelu (@iamnelu).</description>
    <link>https://dev.to/iamnelu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1343497%2Feb110928-966c-4ce3-98ea-e73a81826e2b.png</url>
      <title>DEV Community: IAmNelu</title>
      <link>https://dev.to/iamnelu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iamnelu"/>
    <language>en</language>
    <item>
      <title>Binary Duel, front-end in 2 weeks with Svelte and DaisyUI</title>
      <dc:creator>IAmNelu</dc:creator>
      <pubDate>Sun, 10 Mar 2024 18:39:24 +0000</pubDate>
      <link>https://dev.to/iamnelu/binary-duel-front-end-in-2-weeks-with-svelte-and-daisyui-oc5</link>
      <guid>https://dev.to/iamnelu/binary-duel-front-end-in-2-weeks-with-svelte-and-daisyui-oc5</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the ever-evolving landscape of frontend development, developers like me are always looking for tools and frameworks that can help us build efficient, responsive, and visually appealing UIs. A powerful combination that is getting more and more attention is &lt;a href="https://svelte.dev/"&gt;Svelte&lt;/a&gt;, a lightweight JavaScript framework for making interactive web pages, coupled with &lt;a href="https://daisyui.com/"&gt;DaisyUI&lt;/a&gt;, a high-performance &lt;a href="https://tailwindcss.com/"&gt;Tailwind CSS&lt;/a&gt; component library.&lt;/p&gt;

&lt;p&gt;In this article, I will discuss this two-week journey to build a web app and learn this fantastic tooling combination.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the App?
&lt;/h2&gt;

&lt;p&gt;The idea behind &lt;a href="https://binary-duel.com/"&gt;Binary Duel&lt;/a&gt; was to build a real-time quiz game for programmers. It was supposed to be easy to understand, snappy, and funny when possible. The game status can be divided into four main stages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create/join a duel and wait for an opponent&lt;/li&gt;
&lt;li&gt;Choose a category&lt;/li&gt;
&lt;li&gt;Answer a question&lt;/li&gt;
&lt;li&gt;View the result of the game&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The flow of a duel consists of these four stages in order, with a repetition of the two middle stages multiple times, depending on the number of questions per game.&lt;/p&gt;

&lt;p&gt;The next step was then to choose how many pages to build and how they should interact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Frontend Architecture
&lt;/h2&gt;

&lt;p&gt;Unsurprisingly, the main dependency of the project is Svelte, and for that reason, I used &lt;a href="https://kit.svelte.dev/"&gt;SvelteKit&lt;/a&gt; to lay down the structure of the website. The wonderful thing about this &lt;em&gt;metaframework&lt;/em&gt; is that it comes with &lt;a href="https://kit.svelte.dev/docs/routing"&gt;filesystem-based routing&lt;/a&gt;: in short, means that depending on the folder structure of the project, the routing was already taken care of.&lt;/p&gt;

&lt;p&gt;For passing data across the app, I leveraged the &lt;a href="https://svelte.dev/docs/svelte#setcontext"&gt;Svelte Context API&lt;/a&gt; instead. For state management, I used &lt;a href="https://github.com/AmadeusITGroup/tansu"&gt;Tansu&lt;/a&gt;, a lightweight open-source library inspired by the implementation of Svelte stores.&lt;/p&gt;

&lt;p&gt;The styling was handled by &lt;a href="https://tailwindcss.com/"&gt;Tailwind&lt;/a&gt; and &lt;a href="https://daisyui.com/"&gt;DaisyUI&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  State Management
&lt;/h2&gt;

&lt;p&gt;The state in the app relied on three main pillars: the &lt;a href="https://svelte.dev/docs/svelte#setcontext"&gt;Svelte Context API&lt;/a&gt;, the &lt;a href="https://github.com/AmadeusITGroup/tansu"&gt;Tansu&lt;/a&gt; library, and browser &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage"&gt;Local Storage&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Context API
&lt;/h3&gt;

&lt;p&gt;Since the game is divided into multiple stages with different pages, I needed a solution for having the same persistent state across the app. First of all, the state of the application is quite small, defined by individual &lt;a href="https://github.com/AmadeusITGroup/tansu"&gt;Tansu&lt;/a&gt; stores that are accessible everywhere. The &lt;a href="https://svelte.dev/docs/svelte#setcontext"&gt;Svelte Context API&lt;/a&gt; works like a dictionary: using a key, you can store some values. Therefore, the dependency injection required for this was achieved in two steps: first, I stored the values, then, whenever I needed them, I could retrieve them. To make things easier, I used two helper functions, one for storing and one for retrieving. With this approach, I did not have to worry about which key to use.&lt;/p&gt;

&lt;p&gt;An important notice: &lt;code&gt;setContext&lt;/code&gt; and &lt;code&gt;getContext&lt;/code&gt; functions must be called during the initialization of the component, exactly like the lifecycle methods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gameStatus$&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;writable&lt;/span&gt;&lt;span class="p"&gt;({}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;GameStatus&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gameStatusInjectionKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Symbol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gameStatus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setGameStatus&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameStatusInjectionKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;gameStatus$&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getGameStatus&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;Writable&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;GameStatus&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameStatusInjectionKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;a href="https://binary-duel.com/"&gt;Binary Duel&lt;/a&gt; web app, I decided to split the state into multiple &lt;em&gt;sub-states&lt;/em&gt;. This granularity allowed me to use only the pieces of state I needed. I used a single function to initialize the state in the &lt;code&gt;+layout.svelte&lt;/code&gt; file at the top of the project, to be sure that no matter the component, I would always have access to the state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;initContext&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$lib&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../app.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nf"&gt;initContext&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;slot&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Tansu
&lt;/h3&gt;

&lt;p&gt;The main reason why I used &lt;a href="https://github.com/AmadeusITGroup/tansu"&gt;Tansu&lt;/a&gt; was that I wanted to experiment with a reactive library that was not framework-dependent and easily reusable for future projects. It implements all the features of the &lt;a href="https://svelte.dev/docs/svelte-store"&gt;Svelte stores&lt;/a&gt; and can be used inside reactive blocks without any issues. It also comes with other features that were not leveraged during the project, but I will keep experimenting with it since it looks really promising.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local Storage
&lt;/h3&gt;

&lt;p&gt;One might ask why there is a need to use local storage if we are already using Dependency Injection and a store system (&lt;a href="https://github.com/AmadeusITGroup/tansu"&gt;Tansu&lt;/a&gt; in this case). The answer is simple: I used the local storage as a fallback in case of a page refresh. As mentioned in the introduction, the idea was to build something lightweight and simple; therefore, I avoided sending more requests to the backend when possible.&lt;/p&gt;

&lt;p&gt;Once again, I used the same implementation as for the Context API with getter and setter functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;setGameStatusInStorage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gameStatus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameStatus&lt;/span&gt;&lt;span class="nf"&gt;$&lt;/span&gt;&lt;span class="p"&gt;()));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getGameStatusFromStorage&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;GameStatus&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;gameStatus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gameStatus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameStatus&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gameStatus&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;clearGameStatusFromStorage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;removeItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;gameStatus&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Backend Communication
&lt;/h2&gt;

&lt;p&gt;As a front-end developer, I only worked on the UI; the backend was done by a friend of mine. You can check his article &lt;a href="https://simonedutto.github.io/2024-03-09/binary-duel"&gt;here&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;One might think that since it is a real-time quiz game, there is some sophisticated system to sync the state between the players...well, they would be wrong. This was a small side project for both of us, and we did not invest money into it (except for the domain name).&lt;/p&gt;

&lt;p&gt;We were therefore limited by the free tiers, and the fastest and quickest solution that we developed was a polling system (more details about why we took that decision and did not go with sockets can be found &lt;a href="https://simonedutto.github.io/2024-03-09/binary-duel"&gt;here&lt;/a&gt;). In fact, when a player has made an action and is waiting for the opponent, their client will start polling the server with a request every second, demanding the status of the game.&lt;br&gt;
Requests will be sent until the status changes, and the game moves on.&lt;/p&gt;

&lt;p&gt;To safeguard the backend, we put limits in place regarding the maximum number of games and the number of requests that can be sent in a certain time period. These limit values were found after &lt;strong&gt;friendly&lt;/strong&gt; DDoSing the backend multiple times.&lt;/p&gt;

&lt;h2&gt;
  
  
  Error Handling
&lt;/h2&gt;

&lt;p&gt;I also implemented a basic error handling system in case of a communication error with the backend server or if trying to access a non-existent game. The app will redirect to the home screen, and thanks to the local storage, display the error message.&lt;/p&gt;

&lt;h2&gt;
  
  
  Customization
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://tailwindcss.com/"&gt;Tailwind CSS&lt;/a&gt; is the backbone used for all the styling present in the app, allowing me to write close to no CSS at all and using only helper classes.&lt;/p&gt;

&lt;p&gt;For the components, I used &lt;a href="https://daisyui.com/"&gt;DaisyUI&lt;/a&gt; with the customization theming tool present on their page. I could easily pick the custom color theme present in the app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pua903zp3hwefysscs8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pua903zp3hwefysscs8.png" alt="Home" width="620" height="1338"&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6zy6gk5m713q11o40hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo6zy6gk5m713q11o40hw.png" alt="Lobby" width="620" height="1338"&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30nwz5tlyraczb2ms9s5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F30nwz5tlyraczb2ms9s5.png" alt="Rules" width="620" height="1338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb7jo2q11lemjooumnaj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb7jo2q11lemjooumnaj8.png" alt="Category" width="620" height="1338"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fort1oyzo75ly437siezp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fort1oyzo75ly437siezp.png" alt="Question" width="620" height="1338"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5893zv2jf0kik2gmap0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5893zv2jf0kik2gmap0.png" alt="Ending" width="620" height="1338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I also used &lt;a href="https://www.tailwindcss-animated.com/"&gt;tailwindcss-animated&lt;/a&gt; which made the animations on the screen in a few seconds.&lt;/p&gt;

&lt;p&gt;The end screen drawings were my creations, of which I am very proud. They were first sketched and then redrawn with &lt;a href="https://inkscape.org/"&gt;Inkscape&lt;/a&gt; to have them as SVGs. The same goes for the app's logo.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting
&lt;/h2&gt;

&lt;p&gt;For hosting, I went with &lt;a href="https://www.cloudflare.com/"&gt;Cloudflare&lt;/a&gt;'s solution because the free tier is extremely convenient for what they offer and for the seamless integration with &lt;a href="https://kit.svelte.dev/"&gt;SvelteKit&lt;/a&gt;. In just a few minutes, it was possible to set up the process and automatically deploy the frontend for every update on the main branch (and they also offer the possibility to deploy previews for every PR on the main branch).&lt;/p&gt;

&lt;p&gt;Another great feature of &lt;a href="https://www.cloudflare.com/"&gt;Cloudflare&lt;/a&gt; (they are not paying me; I just loved the service they offer) is the analytics they provide. In fact, they are not using any cookies and are really careful with data anonymization.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Would I Do Better?
&lt;/h2&gt;

&lt;p&gt;First of all, I want to make it clear that this was an experiment, and I do not consider myself an expert on the technologies used. I used them to become more familiar.&lt;/p&gt;

&lt;p&gt;One thing that I would work on would be to better structure the app and extract more components to make it more modular and easier to maintain.&lt;/p&gt;

&lt;p&gt;I would probably optimize the app a bit more to maximize Lighthouse metrics.&lt;/p&gt;

&lt;p&gt;Even though I am really proud of the end-game screen, I would work on that to make it funnier and catchier, and maybe with more animations.&lt;/p&gt;

&lt;p&gt;I would also experiment with some animations here and there throughout the game to make the app more engaging.&lt;/p&gt;

&lt;p&gt;Regarding the game itself, it would be nice to have a global leaderboard and some ELO system, but that would require a login for each user and would go against the idea of a simple and easy-to-use app.&lt;/p&gt;

&lt;p&gt;Maybe if there is demand, we will add more questions and more features to the app, so consider &lt;a href="https://www.buymeacoffee.com/binary.duel"&gt;buying us a coffee&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We developed this app as a fun side project to experiment with technologies that we wanted to test, and I personally enjoyed working with my friend and creating this small, fun app. Soon I will have the code available so you can judge my mistakes 😇&lt;/p&gt;

&lt;p&gt;Please consider reading my friend’s article. Please consider reading his article &lt;a href="https://simonedutto.github.io/2024-03-09/binary-duel"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>svelte</category>
      <category>daisyui</category>
      <category>tailwindcss</category>
    </item>
  </channel>
</rss>
