<?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: Joel Jaison</title>
    <description>The latest articles on DEV Community by Joel Jaison (@joeljaison394).</description>
    <link>https://dev.to/joeljaison394</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%2F907172%2Ffba0b190-60e6-4608-8b5d-5f4aa6969df3.jpg</url>
      <title>DEV Community: Joel Jaison</title>
      <link>https://dev.to/joeljaison394</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joeljaison394"/>
    <language>en</language>
    <item>
      <title>I Finally Built Something Real for People Like Me Who Procrastinate – Break the Block</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sun, 01 Mar 2026 19:24:58 +0000</pubDate>
      <link>https://dev.to/joeljaison394/i-finally-built-something-real-for-people-like-me-who-procrastinate-break-the-block-29aj</link>
      <guid>https://dev.to/joeljaison394/i-finally-built-something-real-for-people-like-me-who-procrastinate-break-the-block-29aj</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/weekend-2026-02-28"&gt;DEV Weekend Challenge: Community&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Community I Built For
&lt;/h2&gt;

&lt;p&gt;I built this for a community I deeply belong to:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Developers. Students. Indie hackers. Creators.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We are ambitious — but stuck.&lt;/p&gt;

&lt;p&gt;We:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Research productivity instead of being productive&lt;/li&gt;
&lt;li&gt;Optimize workflows instead of finishing projects&lt;/li&gt;
&lt;li&gt;Watch tutorials instead of shipping&lt;/li&gt;
&lt;li&gt;Open YouTube when tasks feel overwhelming&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are not lazy.&lt;br&gt;&lt;br&gt;
We are &lt;strong&gt;digitally paralyzed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That is the community I built for.&lt;/p&gt;
&lt;h2&gt;
  
  
  💡 The Problem
&lt;/h2&gt;

&lt;p&gt;Modern apps are engineered for passive engagement:&lt;br&gt;&lt;br&gt;
Infinite scroll. Variable rewards. Dopamine loops.&lt;/p&gt;

&lt;p&gt;But real-world goals feel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Abstract&lt;/li&gt;
&lt;li&gt;Heavy&lt;/li&gt;
&lt;li&gt;Intimidating&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The gap between intention and action keeps growing.&lt;/p&gt;

&lt;p&gt;So I asked:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;What if the same dopamine loops that keep us scrolling could be redirected toward real-world execution?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That question became &lt;strong&gt;Break the Block&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  🚀 What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Break the Block&lt;/strong&gt; is a gamified, proof-based goal execution platform.&lt;/p&gt;

&lt;p&gt;It turns productivity into a cooperative RPG.&lt;/p&gt;

&lt;p&gt;Instead of tracking habits alone and feeling guilty, users collaborate to defeat a shared enemy:&lt;/p&gt;

&lt;p&gt;🪨 &lt;strong&gt;The Global Stasis Stone&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
A visual “raid boss” representing procrastination.&lt;/p&gt;

&lt;p&gt;Every real-world action:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deals damage to the Stone&lt;/li&gt;
&lt;li&gt;Earns XP&lt;/li&gt;
&lt;li&gt;Advances your faction&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are three layers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🛡️ Group Stone&lt;/li&gt;
&lt;li&gt;🌍 Regional Stone&lt;/li&gt;
&lt;li&gt;🌎 Global Stone&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hit 100% → confetti + badge → monthly reset.&lt;/p&gt;

&lt;p&gt;Execution becomes &lt;strong&gt;collective&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  🎥 Demo
&lt;/h2&gt;

&lt;p&gt;Live - &lt;a href="[View%20the%20source%20code%20on%20GitHub%20%E2%86%92](https://github.com/Joeljaison391/BreakTheBlock)"&gt;BreakTheBlock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/W7JCuoaLvDE"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/Joeljaison391/BreakTheBlock" rel="noopener noreferrer"&gt;View the source code on GitHub →&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ How I Built It
&lt;/h2&gt;

&lt;p&gt;I know we all hate getting bogged down in complex setups, so I wanted to keep things simple, fast, and reliable. Here is the stack I used to outsmart our own procrastination:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Next.js, Tailwind &amp;amp; Vercel&lt;/strong&gt; — I actually thought about just using plain React, but I went with Next.js for that snappy performance. Hosted on Vercel because deployments should take seconds, not hours. Tailwind CSS to make the UI feel "crunchy"—every click gives that little dopamine hit you usually get from scrolling.&lt;/li&gt;
&lt;li&gt;*&lt;em&gt;Supabase *&lt;/em&gt; — Supabase for auth and real-time database (perfect for live Faction Leaderboards).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI API&lt;/strong&gt; — Powers the "Friction Breaker." Custom prompt that takes a big scary goal (like "start my portfolio") and chops it into three stupidly easy 5-minute tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inngest&lt;/strong&gt; — Handles background jobs (XP calculation, AI prompts) so the frontend always feels instant—no loading spinners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backblaze&lt;/strong&gt; — "Proof of Action" means no photo = no XP. User image uploads go straight to Backblaze B2: fast, reliable, cheap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sentry&lt;/strong&gt; — Catches bugs immediately so I don't get distracted hunting silent errors.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🧠 The (Quick) Science Behind the Features&lt;/p&gt;

&lt;p&gt;I’m no neuroscientist, but during my late-night research (which was definitely just me procrastinating on actually coding), I dug into why our brains freeze up. I built the core features around a few specific behavioral science tricks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task Decomposition (The Friction Breaker AI)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
When we look at a massive goal like "Build a Portfolio," our brains process that ambiguity as a literal threat → "freeze" response. By forcing the AI to chop it into three 5-minute micro-steps, we drastically lower the &lt;strong&gt;Activation Energy&lt;/strong&gt; required to start. It tricks your brain into thinking, "Oh, I just have to open a new file? I can do that."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Köhler Effect (The Stasis Stone &amp;amp; Factions)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
In psychology, the Köhler Effect is when people work harder as part of a team so they don't let others down. By making the "Stasis Stone" a shared community boss, we weaponize our natural desire for social belonging. You aren't just doing the task for you; you're doing it so your Faction doesn't lose momentum.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;High-Friction Accountability (Proof Verification)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
We are numb to digital checkboxes. Clicking "Done" gives almost no dopamine anymore. Forcing users to take a physical photo of the completed task creates &lt;strong&gt;Intentional Friction&lt;/strong&gt;. It pulls you out of the screen, into the real world, and makes the achievement feel &lt;em&gt;earned&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it out!
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://break-the-block.vercel.app/" rel="noopener noreferrer"&gt;→ Try Break the Block and Defeat the Stasis Stone!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>showdev</category>
    </item>
    <item>
      <title>KeyPilot – Semantic API Gateway with Real-Time AI Routing &amp; Caching</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sun, 10 Aug 2025 18:03:40 +0000</pubDate>
      <link>https://dev.to/joeljaison394/keypilot-semantic-api-gateway-with-real-time-ai-routing-caching-2b94</link>
      <guid>https://dev.to/joeljaison394/keypilot-semantic-api-gateway-with-real-time-ai-routing-caching-2b94</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/redis-2025-07-23"&gt;Redis AI Challenge&lt;/a&gt;: Beyond the Cache&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;One request, one intent and KeyPilot knows exactly which API to call.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Imagine you’re juggling five different AI services.&lt;br&gt;
Each has its own API key, its own endpoint, and its own quirks.&lt;br&gt;
Now, every time you want to build something, you have to stop and think:&lt;br&gt;
"Which key should I use? Which service is cheaper for this request? Which one even supports what I need?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falhhigcagi505hnqe3xv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Falhhigcagi505hnqe3xv.png" alt="A cartoon-style illustration of a worried developer sitting at a desk with a laptop,"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s where KeyPilot steps in....&lt;/p&gt;

&lt;p&gt;I’ve built a semantic API gateway that listens to what you actually want to do&lt;br&gt;
"Summarize this document" or "Generate an image of a mountain village"&lt;br&gt;
and instantly picks the right API key and endpoint for you.&lt;br&gt;
No hunting through docs. No manual switching.&lt;/p&gt;

&lt;p&gt;Here’s the magic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redis Vector Search understands the intent behind your request.&lt;/li&gt;
&lt;li&gt;Redis Caching remembers if we’ve answered this before&lt;/li&gt;
&lt;li&gt;and serves it back in milliseconds without hitting the API again.&lt;/li&gt;
&lt;li&gt;You save time, you save money, and your integration just works faster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With KeyPilot, I’m not just routing requests,&lt;br&gt;
I’m making API integration faster to build, cheaper to run, and smarter every time you use it.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5kndgw5j71f29e8mbc9.png" alt="key-pilot"&gt;
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/jQLmU0ZJfQc"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo - Before You Jump In…
&lt;/h2&gt;

&lt;p&gt;I know what you’re thinking…&lt;br&gt;
&lt;em&gt;"Joel, just give me the live link, I’ll click it right now and start playing with it!"&lt;/em&gt; 😏&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b9k8kbssloli3plldui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0b9k8kbssloli3plldui.png" alt="login-keypilot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But here’s the thing—without the login credentials, you’ll just end up staring at the login screen wondering what went wrong.&lt;br&gt;
And then… you’ll have to come back here looking for the details anyway.&lt;/p&gt;

&lt;p&gt;So let’s save you that awkward extra step, shall we? 😉&lt;/p&gt;



&lt;p&gt;👉 Live App - &lt;a href="https://smartkeypilot.vercel.app/" rel="noopener noreferrer"&gt;https://smartkeypilot.vercel.app/&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Quick Heads-Up
&lt;/h3&gt;

&lt;p&gt;This is a demo app, built fast to show you the core idea. It’s not a locked-down, production grade fortress. Think of it as a cool prototype enough to impress, but not something you’d run your banking on.&lt;/p&gt;

&lt;p&gt;A few ground rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No personal API keys, please. 🙅‍♂️ I’ve already included demo-friendly keys for you.&lt;/li&gt;
&lt;li&gt;If you absolutely must use your own, make sure they’re temporary and revocable.&lt;/li&gt;
&lt;li&gt;Demo sessions last 8 minutes. When time’s up, poof all keys are wiped.&lt;/li&gt;
&lt;li&gt;Be nice to the system ❤️ —no spam, no abuse, let’s keep the experience smooth for everyone.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🔐 Demo Login
&lt;/h2&gt;

&lt;p&gt;Follow this simple pattern:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Username: demo + 1–3 digits → (Example: demo123)

Password: pass + the same digits → (Example: pass123)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pick any number combo you like just stick to the format. Once you’re in, you’re free to explore with the built in demo API keys.&lt;br&gt;
✅ No setup. ✅ No risk. ✅ Instant fun.&lt;/p&gt;
&lt;h3&gt;
  
  
  Using the Demo Keys
&lt;/h3&gt;

&lt;p&gt;The app already has demo API keys built in, so you can try out everything semantic intent matching, routing, caching right away.&lt;br&gt;
If you do add your own keys, remember—they’ll vanish as soon as your session expires.&lt;/p&gt;
&lt;h4&gt;
  
  
  Run It Locally (Optional)
&lt;/h4&gt;

&lt;p&gt;If you landed here before smashing the demo link… I like you already. 🤝&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1d32ipq7b4730kg5hjul.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1d32ipq7b4730kg5hjul.png" alt="from giffy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the best performance, hook it up to Redis Cloud for your connection string this gives you superfast vector search and caching ( fast and simple ).&lt;/p&gt;

&lt;p&gt;Frontend repo: &lt;a href="https://github.com/Joeljaison391/KeyPilot-Frontend" rel="noopener noreferrer"&gt;https://github.com/Joeljaison391/KeyPilot-Frontend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Backend repo: &lt;a href="https://github.com/Joeljaison391/KeyPilot" rel="noopener noreferrer"&gt;https://github.com/Joeljaison391/KeyPilot&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  ⏱ Short on time?
&lt;/h2&gt;

&lt;p&gt;No problem I’ve got you.&lt;br&gt;
Here’s a quick intro video so you can watch the demo without lifting a finger:&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/cemS_zdPVJ0"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  ScreenShots
&lt;/h3&gt;

&lt;p&gt;Welcome to KeyPilot&lt;/p&gt;

&lt;p&gt;This is our Landing Page — clean, simple, and inviting.&lt;br&gt;
The goal is to instantly tell you what KeyPilot does and give you a way to dive right in.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feno87sspuz5c4a05brxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feno87sspuz5c4a05brxt.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Getting Started&lt;/p&gt;

&lt;p&gt;Here’s the Login Page no fuss, no confusion.&lt;br&gt;
Just sign in, or hop in using the demo mode to explore without creating an account.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgjmdnb71anghec5qnqo0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgjmdnb71anghec5qnqo0.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Onboarding in Minutes&lt;/p&gt;

&lt;p&gt;New here?&lt;br&gt;
Our Onboarding Tutorial walks you through the essentials, from finding your API keys to using the testing playground so you can get productive right away.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foo74wdhqijdmjqvizk28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foo74wdhqijdmjqvizk28.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Your Mission Control – The Dashboard&lt;/p&gt;

&lt;p&gt;Once inside, the Dashboard is your command center.&lt;br&gt;
See your keys, usage stats, and quick actions all in one place.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijezxpsn7s8cr8c8qk96.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijezxpsn7s8cr8c8qk96.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Adding a Key&lt;/p&gt;

&lt;p&gt;Need a new API key? The Add Key Modal makes it easy.&lt;br&gt;
Choose a provider template, set limits, define allowed origins and you’re done.&lt;br&gt;
Keys are encrypted and automatically expire when they should.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxlv2nnk2kruclt8ds0h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxlv2nnk2kruclt8ds0h.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Powered by Redis&lt;/p&gt;

&lt;p&gt;Behind the scenes, Redis Cloud powers everything from storing encrypted keys to caching API responses.&lt;br&gt;
Here’s the Redis Cloud dashboard keeping it all running lightning-fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9c17hjvx9i2icst0lgvx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9c17hjvx9i2icst0lgvx.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Testing APIs in Real-Time&lt;/p&gt;

&lt;p&gt;Welcome to the API Testing Playground tweak payloads, change your intent, and watch KeyPilot choose the best template using semantic matching.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4z2yf6wzvanlljh2o4n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4z2yf6wzvanlljh2o4n.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Intent Testing (Without Spending Tokens)&lt;/p&gt;

&lt;p&gt;Curious which template your request would trigger but don’t want to hit a real API?&lt;br&gt;
The Intent Testing Tool lets you check without making an actual API call.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9awdsd9wdj36lycz7zl0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9awdsd9wdj36lycz7zl0.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Smart Caching for Cost &amp;amp; Speed&lt;/p&gt;

&lt;p&gt;Why pay for the same API call twice?&lt;br&gt;
KeyPilot uses semantic caching if a similar request was made before, it serves the stored response instantly, saving cost and time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1ywis02psdqvm4fuohh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1ywis02psdqvm4fuohh.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Monitoring &amp;amp; Insights&lt;br&gt;
Finally, keep track of everything with API Usage Monitoring from tokens used and uptime/downtime, to success rate and cache hits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fidb93tw14vjnzzyn97j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fidb93tw14vjnzzyn97j1.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;p&gt;Here’s what powered this build:&lt;/p&gt;

&lt;p&gt;Frontend&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
I went with Vite + React because I wanted blazing fast dev speed and a smooth production build. Styling? Tailwind CSS because writing raw CSS at 3 AM is not a vibe. Everything’s hosted on Vercel, so deployment is just a push away.&lt;/p&gt;

&lt;p&gt;Backend&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
The server runs on Node.js + Express.js, written in TypeScript for that sweet type safety. I hosted it on Render, which meant I could focus on coding instead of babysitting servers.&lt;/p&gt;

&lt;p&gt;Data Layer&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
This is where things get interesting. Redis Cloud is my main database, handling both vector search and caching like a champ. For ultralow latency ops, I also keep a Redis in-memory instance because milliseconds matter.&lt;/p&gt;

&lt;p&gt;Workflow &lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
Version control? Git, obviously.&lt;br&gt;
Brainstorming and team planning? Notion, where ideas go from “what if…” to “ship it.”&lt;/p&gt;


&lt;h2&gt;
  
  
  How I Used Redis 8
&lt;/h2&gt;

&lt;p&gt;Why Redis? Why Not “Normal” Databases?&lt;/p&gt;

&lt;p&gt;Most people think of databases like PostgreSQL, MySQL and MongoDB when building apps.&lt;br&gt;
They’re great for longterm, structured storage, but for this project, I needed something different&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;⚡ Speed over everything – I wanted sub-millisecond lookups.&lt;/li&gt;
&lt;li&gt;🕒 Built-in expiration – Sessions and API keys should self-destruct after a few minutes, no cron jobs.&lt;/li&gt;
&lt;li&gt;🔐 Simple, atomic ops – Set it, get it, delete it. No complex joins.&lt;/li&gt;
&lt;li&gt;🧠 Works as cache and DB – Why juggle two systems when one can do both?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If I had used a normal database:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I’d have to write extra code to delete expired sessions.&lt;/li&gt;
&lt;li&gt;Every API call would be slower due to disk-based queries.&lt;/li&gt;
&lt;li&gt;Caching would require a separate Redis instance anyway.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of this twosystem headache, I went all in on Redis 8 as a full-fledged primary database for this app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea9me8yw1llvjjz62xws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fea9me8yw1llvjjz62xws.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  How Redis Runs the Show in KeyPilot
&lt;/h3&gt;

&lt;p&gt;When I say Redis is the backbone, I mean it literally runs everything from logging you in, to storing your API keys, to making sure your session politely disappears after 8 minutes without me lifting a finger.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authentication Routes – “You’re In!”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We used Redis Strings &amp;amp; Hashes to store user sessions and encrypted API keys, with TTL auto expiration so they vanish when no longer needed.&lt;br&gt;
This means no manual cleanup, no stale logins, and instant access.&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`user:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;480&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;sessionData&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;expire&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`keys:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;480&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;API Key Management – “Your Keys, Your Rules”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every API key got stored in a Redis Hash with metadata like creation time and description.&lt;br&gt;
No duplicate keys, no outdated entries — just clean, encrypted storage.&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;hSet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`keys:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;template&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;encrypted_key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&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;&lt;strong&gt;Proxy &amp;amp; Semantic Cache – “Smartest Route Wins”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redis RediSearch + Vector Index let us match the right API key to the right request based on meaning, not just keywords.&lt;br&gt;
Once fetched, the response got cached for blazing replays.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ft&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;idx:intents&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*=&amp;gt;[KNN 1 @vector $query_vector]&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;span class="na"&gt;PARAMS&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;query_vector&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;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setEx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`cache:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;intentHash&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3600&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;apiResponse&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Analytics &amp;amp; RealTime Tracking – “See It As It Happens”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We combined Redis Pub/Sub, Streams, and Counters to track every request in real time.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pub/Sub&lt;/strong&gt; broadcasts “received” and “completed” events to the dashboard instantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streams&lt;/strong&gt; keep a time-ordered history of activity and cached requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Counters&lt;/strong&gt; aggregate daily and weekly stats for quick summaries.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Live event broadcasts&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;channel:request:received&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;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;intent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;publish&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;channel:request:completed&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;userId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;latency&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;cacheHit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;

&lt;span class="c1"&gt;// Activity stream (last 50 events)&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xAdd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`analytics:activity:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;*&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;span class="na"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;request:success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;intent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;latency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;xTrim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`analytics:activity:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;MAXLEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Daily counters&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;incr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`analytics:daily_requests:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Analytics Dashboard – “Know What’s Trending”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every intent a user triggered got counted using Sorted Sets.&lt;br&gt;
This gave us instant leaderboards of top requests  perfect for spotting patterns.&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zIncrBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`intent_trends:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:daily`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;intent&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;topIntents&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zRange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`intent_trends:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:daily`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;REV&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Cache Management – “One Sweep, All Clean”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Redis made it easy to find and wipe old cache keys in bulk.&lt;br&gt;
No messy SQL queries, just a quick scan and delete.&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;keys&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;scanIterator&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`cache:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:*`&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="k"&gt;await &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;key&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;del&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;Intent Tracking &amp;amp; Trends – “What Users Want, Right Now”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We kept a running tally of weekly user intents using Sorted Sets.&lt;br&gt;
This helped us predict what users would request next almost like reading minds.&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="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;redis&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;zIncrBy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`intent_trends:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;:weekly`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;detectedIntent&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8r7lders4wmqfmko9gyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8r7lders4wmqfmko9gyf.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By combining multiple Redis 8 features, we replaced &lt;strong&gt;five different systems&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No extra SQL database for sessions&lt;/li&gt;
&lt;li&gt;No Elasticsearch for search&lt;/li&gt;
&lt;li&gt;No Kafka for event streaming&lt;/li&gt;
&lt;li&gt;No cron jobs for cleanup&lt;/li&gt;
&lt;li&gt;No separate analytics DB&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Tried to Slow Me Down (But Didn’t) 💪
&lt;/h2&gt;

&lt;p&gt;Minimal UI, Maximum Clarity&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
My rule was simple: if someone needs a manual, I messed up.&lt;br&gt;
So I kept cutting extra text, moving things around at random hours, and swapping long explanations for small icons. I just wanted people to open the app and instantly know what to do.&lt;/p&gt;

&lt;p&gt;Time Pressure (Hackathon Mode)&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
The clock felt louder than my keyboard.&lt;br&gt;
Every decision was the same question: should I make it perfect or just make it work? I went with “make it work.”&lt;/p&gt;

&lt;p&gt;Semantic Matching &amp;amp; Provider Templates&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
The idea was simple: type what you want in plain English, and the app figures out which API to call. Sounds easy… but it wasn’t. &lt;br&gt;
I had to create flexible templates for different services and still keep them accurate. By the time I was done, I’d listened to over 150 songs and sat through 60+ Spotify 🎧 ads while coding.&lt;/p&gt;

&lt;p&gt;Speed Optimization in Practice&lt;br&gt;
&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;em&gt;-&lt;/em&gt;-&lt;br&gt;
Saying “sub-millisecond” is easy. Making it happen? Not so much.&lt;br&gt;
I spent hours tuning Redis queries, cutting down data sizes, and setting up caching all while making sure nothing else broke.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fers8j6nbqbs1stxoi3jg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fers8j6nbqbs1stxoi3jg.png" alt="keypilot-complete"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Team
&lt;/h2&gt;

&lt;p&gt;Special thanks to &lt;strong&gt;&lt;a href="https://dev.to/abelboby"&gt;abelboby&lt;/a&gt;&lt;/strong&gt; for contributing to the frontend development and helping bring the user experience to life.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank You for Reading
&lt;/h2&gt;

&lt;p&gt;If you made it this far, thank you! 🚀&lt;br&gt;
I truly appreciate you taking the time to explore this project and follow along with the journey.&lt;/p&gt;

</description>
      <category>redischallenge</category>
      <category>devchallenge</category>
      <category>database</category>
      <category>ai</category>
    </item>
    <item>
      <title>Download Manager v0.1.0</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Mon, 23 Dec 2024 13:08:57 +0000</pubDate>
      <link>https://dev.to/joeljaison394/download-manager-v010-5eh9</link>
      <guid>https://dev.to/joeljaison394/download-manager-v010-5eh9</guid>
      <description>&lt;p&gt;I’m excited to announce the release of &lt;strong&gt;Download Manager v0.1.0&lt;/strong&gt;, an enhanced version of this lightweight Rust-based file organizer. This release marks a significant upgrade, adding new features, refining existing functionalities, and overcoming challenges to make Downloads folder management even more efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s New in v0.1.0?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Initial Report Generation
&lt;/h3&gt;

&lt;p&gt;When you first run the application, it generates an &lt;strong&gt;HTML report&lt;/strong&gt; summarizing the state of your Downloads folder. This report provides insights into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Total number of files&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution of file types&lt;/strong&gt; (e.g., Images, Videos, Documents).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage usage by category&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This feature ensures users start with an immediate overview of their Downloads folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Weekly Reports
&lt;/h3&gt;

&lt;p&gt;Every week, the application generates a &lt;strong&gt;detailed HTML report&lt;/strong&gt;, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File type breakdowns&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total size and number of files&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Insights into unused files&lt;/strong&gt; taking up space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual charts&lt;/strong&gt; (pie and bar graphs) for better data representation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These reports are automatically generated at the beginning of each week, keeping you informed without manual effort.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Unused File Management
&lt;/h3&gt;

&lt;p&gt;Files not accessed for &lt;strong&gt;30 days&lt;/strong&gt; are now moved to a dedicated &lt;strong&gt;Unused&lt;/strong&gt; folder. Within this folder, files are categorized into subdirectories like &lt;strong&gt;Images&lt;/strong&gt;, &lt;strong&gt;Videos&lt;/strong&gt;, and &lt;strong&gt;Documents&lt;/strong&gt;, making it easier to revisit or clean up these files.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Process of Adding New Features
&lt;/h2&gt;

&lt;p&gt;Every feature in this release was driven by the goal of making file organization smarter and more intuitive. Here’s how I approached each addition:&lt;/p&gt;

&lt;h3&gt;
  
  
  Initial Report Generation
&lt;/h3&gt;

&lt;p&gt;I started with the requirement to analyze the entire Downloads directory on the program's first run. Using Rust's efficient file-handling capabilities, I created an &lt;strong&gt;HTML report&lt;/strong&gt; that’s both visually appealing and easy to read. Handling large directories was challenging, but with optimized file iteration and selective metadata extraction, this process is now seamless.&lt;/p&gt;

&lt;h3&gt;
  
  
  Weekly Reports
&lt;/h3&gt;

&lt;p&gt;Automating weekly reports involved tracking the last report’s generation using a &lt;strong&gt;report_status.txt&lt;/strong&gt; file. This ensured reports are created at the right intervals. If the program wasn’t running during the scheduled time, the system checks the report generation status on the next startup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unused File Handling
&lt;/h3&gt;

&lt;p&gt;Defining "unused" files as those inactive for 30 days was the first step. Scanning large directories efficiently was another challenge, but by leveraging Rust’s performance-optimized file system libraries, I ensured the process doesn’t interrupt real-time monitoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges and How I Overcame Them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  File Stability During Monitoring
&lt;/h3&gt;

&lt;p&gt;Temporary and incomplete files caused errors during processing. To handle this, I added a &lt;strong&gt;file stability check&lt;/strong&gt; that waits until the file size remains constant before organizing it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visualizing Data
&lt;/h3&gt;

&lt;p&gt;Generating visually appealing reports involved integrating &lt;strong&gt;Chart.js&lt;/strong&gt; into the HTML reports. Converting file metadata into chart-friendly formats was tricky but rewarding. The result is an aesthetically pleasing report that combines functionality with design.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automated Testing with GitHub Actions
&lt;/h3&gt;

&lt;p&gt;Testing these features required simulating a &lt;strong&gt;Downloads environment&lt;/strong&gt;. Using &lt;strong&gt;GitHub Actions&lt;/strong&gt;, I automated the process by downloading sample files, running the application, and verifying outcomes. Challenges like handling network issues during downloads were resolved with retries and caching.&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;While v0.1.0 introduces exciting features, I’m already planning for the future:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Platform Support&lt;/strong&gt;: Extend the tool to Linux and macOS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Customizable Rules&lt;/strong&gt;: Allow users to define their own file organization rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Integration&lt;/strong&gt;: For users who want reports and organized files backed up.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Joeljaison391" rel="noopener noreferrer"&gt;
        Joeljaison391
      &lt;/a&gt; / &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;
        Downloads-Organizer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Rust application designed to automate the organization of your downloads. It watches for new files and moves them to appropriate directories based on their extension, simplifying file management and improving workflow.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Download Manager&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/065a7119c5bae1967d9d7237af6da1a644332e96bd8d6cbb69d13981208d342f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630382f446f776e6c6f61644f7267616e697a65722f7063686f6c776a6c7a7168697430666e357962302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/065a7119c5bae1967d9d7237af6da1a644332e96bd8d6cbb69d13981208d342f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630382f446f776e6c6f61644f7267616e697a65722f7063686f6c776a6c7a7168697430666e357962302e706e67" alt="Logo" width="600" height="350"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Overview&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e1912fad1a4661b9d3526484e4b6c3a284cd770e753065e20dfe73de5cf81041/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630352f446f776e6c6f61644f7267616e697a65722f646b6376746b61636a3472716836626874626e712e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/e1912fad1a4661b9d3526484e4b6c3a284cd770e753065e20dfe73de5cf81041/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630352f446f776e6c6f61644f7267616e697a65722f646b6376746b61636a3472716836626874626e712e706e67" alt="Banner" width="100"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;A lightweight Rust-based file monitoring and organizing tool designed to automatically segregate files downloaded into appropriate folders based on their type. The program monitors the &lt;strong&gt;Downloads&lt;/strong&gt; folder for file events and organizes files into categories like Images, Videos, Documents, Archives, Audio, and Others&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;strong&gt;File Monitoring&lt;/strong&gt;: Monitors the Downloads folder for new files and organizes them based on file type.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Stability Check&lt;/strong&gt;: Waits for file stability before processing (e.g., for partially downloaded files).&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;File Categorization&lt;/strong&gt;: Automatically moves files into appropriate subfolders (e.g., Images, Videos, Documents).&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Unused File Management&lt;/strong&gt;: Identifies unused files and moves them to the &lt;code&gt;Unused&lt;/code&gt; folder, organized by type.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Initial Report Generation&lt;/strong&gt;: Generates a detailed report about the Downloads folder on the first run.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Weekly Reports&lt;/strong&gt;: Automatically generates a detailed weekly report summarizing the files in the Downloads folder.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Subdirectory Analysis&lt;/strong&gt;: Includes all subdirectories (e.g., &lt;code&gt;Images&lt;/code&gt;, &lt;code&gt;Videos&lt;/code&gt;…&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Download Manager v0.1.0 is a big step forward, and I’m thrilled to share it with you. If you haven’t tried it yet, head over to the &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer/releases" rel="noopener noreferrer"&gt;release page&lt;/a&gt; and give it a go. Your feedback is invaluable, and I look forward to hearing your thoughts!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>sideprojects</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Building an Efficient File Organizer with Rust</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Thu, 12 Dec 2024 18:55:08 +0000</pubDate>
      <link>https://dev.to/joeljaison394/building-an-efficient-file-organizer-with-rust-172f</link>
      <guid>https://dev.to/joeljaison394/building-an-efficient-file-organizer-with-rust-172f</guid>
      <description>&lt;p&gt;Managing a cluttered Downloads folder is a problem that many of us face. Files pile up quickly, and before we know it, important documents, images, and videos get lost in a sea of irrelevant or outdated downloads. With this in mind, I set out to build a tool that organizes files automatically while being lightweight and efficient. Here’s the journey of how I developed the &lt;strong&gt;Download Manager&lt;/strong&gt;, the challenges I encountered, and the lessons I learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Download Manager?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Download Manager&lt;/strong&gt; is a Rust-based application that I built to automatically organize the Downloads folder. It monitors new file events, waits for files to stabilize, and categorizes them into folders like Images, Videos, Documents, Archives, Audio, and Others. The tool is built for Windows and is designed to be both fast and resource-efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to Use Download Manager&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Download the Executable&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Visit the &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer/releases" rel="noopener noreferrer"&gt;GitHub releases page&lt;/a&gt; and download the prebuilt executable file (&lt;code&gt;downloadManager.exe&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Configure in Task Scheduler&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To ensure the tool runs automatically at system startup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Task Scheduler&lt;/strong&gt; (Press &lt;code&gt;Win + R&lt;/code&gt;, type &lt;code&gt;taskschd.msc&lt;/code&gt;, and press Enter).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Task&lt;/strong&gt; on the right-hand side.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;General&lt;/strong&gt; tab:

&lt;ul&gt;
&lt;li&gt;Name the task (e.g., "Download Organizer").&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Run whether user is logged on or not&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Check &lt;strong&gt;Run with highest privileges&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Triggers&lt;/strong&gt; tab:

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;New&lt;/strong&gt; and set the trigger to &lt;strong&gt;At system startup&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Actions&lt;/strong&gt; tab:

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;New&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Action&lt;/strong&gt; to &lt;strong&gt;Start a program&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Browse to the downloaded &lt;code&gt;downloadManager.exe&lt;/code&gt; file and select it.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Go to the &lt;strong&gt;Conditions&lt;/strong&gt; tab:

&lt;ul&gt;
&lt;li&gt;Uncheck &lt;strong&gt;Start the task only if the computer is on AC power&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Check &lt;strong&gt;Wake the computer to run this task&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; to save the task.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The tool will now run automatically at startup and monitor your Downloads folder.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Running Manually&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you prefer to run the program manually, simply double-click the &lt;code&gt;downloadManager.exe&lt;/code&gt; file. The tool will start monitoring the Downloads folder immediately.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Problems I Faced and How I Solved Them&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Handling Temporary Files&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Many browsers like Chrome create &lt;code&gt;.tmp&lt;/code&gt; or &lt;code&gt;.crdownload&lt;/code&gt; files while downloading. If my tool processed these files prematurely, it interrupted downloads.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: I implemented a file stability mechanism. The program ignores &lt;code&gt;.tmp&lt;/code&gt; and &lt;code&gt;.crdownload&lt;/code&gt; files until they are renamed. Additionally, I periodically check file size to ensure the file is stable before moving it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Monitoring Resource Usage&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: File monitoring could easily become resource-intensive, consuming significant CPU and memory, especially during frequent file events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: To address this, I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used Rust's efficient libraries like &lt;code&gt;notify&lt;/code&gt; for file event monitoring.&lt;/li&gt;
&lt;li&gt;Implemented benchmarks to analyze and optimize CPU and memory usage. The program stabilizes at ~13 MB of memory usage and spikes to ~0.77% CPU during active monitoring, making it suitable for everyday use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Fun Fact&lt;/strong&gt;: Did you know that Rust is often called a "memory-safe language" because it avoids common memory errors like null pointer dereferences and buffer overflows?&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Ensuring Cross-File Compatibility&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Files come in a variety of formats. I needed to ensure proper categorization for dozens of extensions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: I implemented an extensive list of file extensions, mapping them to their respective categories like Images, Videos, and Documents. For unknown extensions, I used a default "Others" folder. This keeps the system future-proof for new file types.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;4. Avoiding Interruptions During System Startup&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Running the tool via Task Scheduler sometimes caused a terminal window to appear, disrupting the user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: I recompiled the program using the &lt;code&gt;windows_subsystem = "windows"&lt;/code&gt; flag in Rust, ensuring the tool runs silently in the background without a visible terminal window.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;5. Keeping It User-Friendly&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Many users are not comfortable with command-line tools or complex setups.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: I:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provided a prebuilt executable for direct download from GitHub releases.&lt;/li&gt;
&lt;li&gt;Included detailed instructions for configuring the tool in Task Scheduler for automatic startup.&lt;/li&gt;
&lt;li&gt;Added desktop notifications to inform users of file movements, making the experience interactive and transparent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benchmarking and Testing&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I tested the &lt;strong&gt;Download Manager&lt;/strong&gt; on the following device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Device Name&lt;/strong&gt;: Lenovo Ideapad Gamming 3i&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processor&lt;/strong&gt;: 12th Gen Intel(R) Core(TM) i5-12450H @ 2.00 GHz&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Installed RAM&lt;/strong&gt;: 32.0 GB&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OS&lt;/strong&gt;: Windows 11 Home, Version 23H2&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Benchmark Results&lt;/strong&gt;:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CPU Usage&lt;/strong&gt;: Peaks at ~0.77% during active file monitoring.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Usage&lt;/strong&gt;: Stabilizes at ~13 MB during regular operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Insights&lt;/strong&gt;:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The tool runs efficiently in the background and is ideal for users who want a "set it and forget it" solution. I made sure it remains user-friendly and lightweight.&lt;/li&gt;
&lt;li&gt;Resource usage remains minimal even during heavy file operations, thanks to Rust's performance and low-level control.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Ideas for Similar Projects&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you're inspired by this project, here are some ideas you can explore yourself:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Photo Organizer&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Automatically sort photos by date, location (using EXIF data), or event name.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Music Library Manager&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Categorize audio files based on artist, album, or genre.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Document Digitizer&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Monitor scanned documents and automatically rename and move them based on OCR-detected content.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Video Compressor&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Monitor video folders and compress large files automatically to save disk space.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Platform File Organizer&lt;/strong&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Extend the file organizer concept to support Linux and macOS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Final Thoughts&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Download Manager&lt;/strong&gt; project was both a challenging and rewarding experience. It taught me the importance of handling edge cases like temporary files and optimizing for low resource usage. Most importantly, it reinforced the power of automation to make life simpler and more productive.&lt;/p&gt;

&lt;p&gt;I hope &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;this tool helps you keep your Downloads&lt;/a&gt; folder tidy. I'd love to hear your feedback and ideas! If you’d like to contribute or suggest features, check out our &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Joeljaison391" rel="noopener noreferrer"&gt;
        Joeljaison391
      &lt;/a&gt; / &lt;a href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;
        Downloads-Organizer
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Rust application designed to automate the organization of your downloads. It watches for new files and moves them to appropriate directories based on their extension, simplifying file management and improving workflow.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Download Manager&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/065a7119c5bae1967d9d7237af6da1a644332e96bd8d6cbb69d13981208d342f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630382f446f776e6c6f61644f7267616e697a65722f7063686f6c776a6c7a7168697430666e357962302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/065a7119c5bae1967d9d7237af6da1a644332e96bd8d6cbb69d13981208d342f/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630382f446f776e6c6f61644f7267616e697a65722f7063686f6c776a6c7a7168697430666e357962302e706e67" alt="Logo" width="600" height="350"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Overview&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e1912fad1a4661b9d3526484e4b6c3a284cd770e753065e20dfe73de5cf81041/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630352f446f776e6c6f61644f7267616e697a65722f646b6376746b61636a3472716836626874626e712e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/e1912fad1a4661b9d3526484e4b6c3a284cd770e753065e20dfe73de5cf81041/68747470733a2f2f7265732e636c6f7564696e6172792e636f6d2f6478726167677770342f696d6167652f75706c6f61642f76313733353134333630352f446f776e6c6f61644f7267616e697a65722f646b6376746b61636a3472716836626874626e712e706e67" alt="Banner" width="100"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;A lightweight Rust-based file monitoring and organizing tool designed to automatically segregate files downloaded into appropriate folders based on their type. The program monitors the &lt;strong&gt;Downloads&lt;/strong&gt; folder for file events and organizes files into categories like Images, Videos, Documents, Archives, Audio, and Others&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;

&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt;

&lt;strong&gt;File Monitoring&lt;/strong&gt;: Monitors the Downloads folder for new files and organizes them based on file type.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Stability Check&lt;/strong&gt;: Waits for file stability before processing (e.g., for partially downloaded files).&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;File Categorization&lt;/strong&gt;: Automatically moves files into appropriate subfolders (e.g., Images, Videos, Documents).&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Unused File Management&lt;/strong&gt;: Identifies unused files and moves them to the &lt;code&gt;Unused&lt;/code&gt; folder, organized by type.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Initial Report Generation&lt;/strong&gt;: Generates a detailed report about the Downloads folder on the first run.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Weekly Reports&lt;/strong&gt;: Automatically generates a detailed weekly report summarizing the files in the Downloads folder.&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Subdirectory Analysis&lt;/strong&gt;: Includes all subdirectories (e.g., &lt;code&gt;Images&lt;/code&gt;, &lt;code&gt;Videos&lt;/code&gt;…&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Joeljaison391/Downloads-Organizer" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Feel free to leave your comments or suggestions below. Happy coding!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>programming</category>
      <category>sideprojects</category>
    </item>
    <item>
      <title>"Color Maze" - an accidental project</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sat, 30 Mar 2024 17:29:27 +0000</pubDate>
      <link>https://dev.to/joeljaison394/color-maze-an-accidental-project-798</link>
      <guid>https://dev.to/joeljaison394/color-maze-an-accidental-project-798</guid>
      <description>&lt;h2&gt;
  
  
  The Inspiration Behind ColorMaze
&lt;/h2&gt;

&lt;p&gt;It all started with another project – an ambitious one aimed at creating an AI-powered color suggestion tool for Figma, the popular design platform. To make this AI truly insightful, we needed a massive dataset of color palettes, each carefully tagged with details about the emotions and feelings they evoke.&lt;/p&gt;

&lt;p&gt;Unfortunately, there wasn't a single, perfect dataset readily available. So, we decided to get creative and build our own!&lt;/p&gt;

&lt;h3&gt;
  
  
  Data Collection
&lt;/h3&gt;

&lt;p&gt;The data collection process involved scouring the web for freely available images through scrapping only from free sources🙂 .... (think stunning landscapes, eye-catching product designs, and everything in between). Using clever algorithms from the scikit-learn library, we extracted the dominant colors from each image.&lt;/p&gt;

&lt;p&gt;But here's the twist: we didn't stop there. We leveraged the principles of color psychology to create three unique color palettes from those extracted colors. This way, our AI could learn the subtle associations between colors and human emotions.&lt;/p&gt;

&lt;p&gt;To automate this data collection process, I chained together a series of Azure Cloud Functions. These functions acted like tiny robots, diligently scraping images, extracting colors, and generating palettes. And to avoid those pesky captchas that slow things down, we employed a clever cron job scheduling technique.&lt;/p&gt;

&lt;p&gt;The result? A treasure trove of color data, meticulously collected and stored in the cloud &lt;/p&gt;

&lt;h2&gt;
  
  
  ColorMaze: A Sneak Peek
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2138yx3pm2ciujr1884.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk2138yx3pm2ciujr1884.png" alt="color maze logo" width="800" height="289"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But wait, there's more! With this vast collection at our disposal, we decided to create something special for everyone – ColorMaze. This website allows you to explore the world of color palettes, including some hidden gems you might not find anywhere else (think premium palettes from all your favorite design sites!).&lt;/p&gt;

&lt;p&gt;Right now, ColorMaze is still under development, undergoing its finishing touches and functionality tweaks. But feel free to check it out and let us know if you encounter any bugs – we view them as our little companions on the path to perfection!😅&lt;/p&gt;

&lt;p&gt;The future of ColorMaze is brimming with possibilities. With the approval of my teammates, we plan to populate the site with the entirety of our color data collection. This will create a truly unique resource for designers and anyone who loves the language of color.&lt;/p&gt;

&lt;p&gt;As for the source code, we're keeping that under wraps for now, but we're excited to share the final product with the world! So, stay tuned and keep an eye out for ColorMaze – it's destined to become your go-to destination for all things color inspiration.&lt;/p&gt;

&lt;p&gt;checkout colormaze here - &lt;a href="https://color-maze.vercel.app/" rel="noopener noreferrer"&gt;colormaze website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and also wishing everyone  who reads on 3/31/2024 a Happy Easter🥚&lt;/p&gt;

</description>
      <category>project</category>
      <category>programming</category>
    </item>
    <item>
      <title>StarBoard v1.0.0</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sun, 03 Mar 2024 13:58:56 +0000</pubDate>
      <link>https://dev.to/joeljaison394/starboard-v100-207</link>
      <guid>https://dev.to/joeljaison394/starboard-v100-207</guid>
      <description>&lt;p&gt;A few weeks ago, I found myself searching for the perfect productivity tool, blending the user-friendliness of Notion, the intuitive layout of Trello, and the automation prowess of Zapier. Surprisingly, the options I discovered were mostly paid, and open-source alternatives were either less user-friendly or demanded extensive configurations. Faced with these challenges, I recalled my experience with an old task manager CMD tool built in Rust and decided to build something new, which led to the birth of StarBoard.&lt;/p&gt;

&lt;h2&gt;
  
  
  StarBoard's Origin Story
&lt;/h2&gt;

&lt;p&gt;StarBoard, a name chosen hastily, might evolve in the future. The tool aims to streamline task and work management, eliminating unnecessary complexities. The vision includes automating repetitive steps, integrating with various platforms, and providing an efficient solution for task management.&lt;/p&gt;

&lt;h2&gt;
  
  
  Development Approach
&lt;/h2&gt;

&lt;p&gt;To address concerns about privacy, data storage, and server setup, I decided to build StarBoard as a desktop software, focusing on Windows users. As a Windows user myself, this choice not only aligns with my preferences but also streamlines the development process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current Status
&lt;/h2&gt;

&lt;p&gt;StarBoard has been pre-released with fundamental features allowing users to create collections and group tasks within them. Users can easily change the status of tasks from pending to completed or mark them as in progress. While this pre-release is not stable, the upcoming version 1.1.0, expected by the end of June, will offer a more polished and stable experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhn9ihka9sx58ovx405o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhn9ihka9sx58ovx405o.png" alt="StarBoard Screenshot" width="800" height="450"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqoqd34m8p2b9iofdaoio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqoqd34m8p2b9iofdaoio.png" alt="StarBoard Screenshot" width="800" height="454"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwg3szbqlgu38daedwjjn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwg3szbqlgu38daedwjjn.png" alt="StarBoard Screenshot" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxun1xpn8fma84cw9o16.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flxun1xpn8fma84cw9o16.png" alt="StarBoard Screenshot" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Contribution and Collaboration
&lt;/h2&gt;

&lt;p&gt;Building a project from scratch is a challenging task, and I invite anyone interested to join and contribute to StarBoard's development. Every contribution is valuable, whether it's code, UI improvements, or feedback. Together, we can shape StarBoard into a robust and user-friendly productivity tool.&lt;/p&gt;
&lt;h2&gt;
  
  
  Get Involved
&lt;/h2&gt;

&lt;p&gt;If you're interested, you can explore the pre-released version on GitHub. Feel free to test it out, provide feedback, or contribute to its development.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/JoelJaison394/StarBoard" rel="noopener noreferrer"&gt;StarBoard GitHub Repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LPrJtdPjS4k"&gt;
&lt;/iframe&gt;
&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/joeljaison394" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F907172%2Ffba0b190-60e6-4608-8b5d-5f4aa6969df3.jpg" alt="joeljaison394"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/joeljaison394/a-cliche-rusty-project-built-using-rust-8oi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;A cliché rusty project built using rust&lt;/h2&gt;
      &lt;h3&gt;Joel Jaison ・ Feb 20 '24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#rust&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>rust</category>
      <category>tauri</category>
      <category>product</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Rust Daily Challenge Day-1</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Thu, 29 Feb 2024 04:08:16 +0000</pubDate>
      <link>https://dev.to/joeljaison394/rust-daily-challenge-day-1-53mh</link>
      <guid>https://dev.to/joeljaison394/rust-daily-challenge-day-1-53mh</guid>
      <description>&lt;p&gt;Today, we will focus on creating a Rust function called &lt;code&gt;greet_user&lt;/code&gt; that takes a user's name as a parameter, reads input from the terminal, and prints a personalized greeting message.&lt;/p&gt;

&lt;p&gt;In Rust, a function is defined using the &lt;code&gt;fn&lt;/code&gt; keyword followed by the function name, parameters, return type (if any), and the function body enclosed in curly braces &lt;code&gt;{}&lt;/code&gt;. Let's break down the structure of the &lt;code&gt;greet_user&lt;/code&gt; function:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjwakn3q187iximmopu89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjwakn3q187iximmopu89.png" alt="greet_user function" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here&lt;br&gt;
&lt;code&gt;fn&lt;/code&gt;: Keyword indicating the start of a function definition.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;greet_user&lt;/code&gt;: Name of the function.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;(name :&amp;amp;str)&lt;/code&gt;: Parameter list enclosed in parentheses &lt;strong&gt;&lt;code&gt;()&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;name&lt;/code&gt;: Name of the parameter.&lt;br&gt;
&lt;code&gt;&amp;amp;str&lt;/code&gt;: Type of the parameter, indicating a string slice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fltr7e98eob8e6wpxp8gi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fltr7e98eob8e6wpxp8gi.png" alt="main function body" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The main function is the entry point of a Rust program.It contains the code that will be executed when the program is run.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;println!("Enter the name ");&lt;/code&gt;: Prints a message asking the user to enter a name.&lt;br&gt;
&lt;code&gt;let mut userName = String::new();&lt;/code&gt;: Declares a mutable variable userName of type String to store the user's input.&lt;br&gt;
&lt;code&gt;std::io::stdin().read_line(&amp;amp;mut userName).expect("Something error happened");&lt;/code&gt; - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Reads a line from the standard input (keyboard) and stores it in the &lt;code&gt;userName&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;amp;mut userName&lt;/code&gt; passes a mutable reference to userName to allow the read_line function to modify its contents.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;expect("Something error happened");&lt;/code&gt; handles any potential errors that may occur during the input operation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;greet_user(&amp;amp;userName);&lt;/code&gt;: Calls the greet_user function with a reference to the userName variable as an argument.&lt;/p&gt;

&lt;p&gt;Passing a reference (&lt;code&gt;&amp;amp;&lt;/code&gt;) to &lt;code&gt;userName&lt;/code&gt; allows &lt;code&gt;greet_user&lt;/code&gt; to access the value without taking ownership of it.&lt;/p&gt;

&lt;p&gt;Now when we run this code the output will be &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0oencym5bm3d15xi2o4o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0oencym5bm3d15xi2o4o.png" alt="output 1 without trim" width="800" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To avoid the problem of newline character causing the ouput template string to be in newline after the template word , we need to trim out the user input &lt;/p&gt;

&lt;p&gt;so for that the code should be modified like wise&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44isuhfmo4e5kc7xiyx4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F44isuhfmo4e5kc7xiyx4.png" alt="code using the trim" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the user input is trimmed before passing it to &lt;code&gt;greet_user&lt;/code&gt;, any leading or trailing whitespace will be removed.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;to_string()&lt;/code&gt; method is used to convert a string slice (&lt;code&gt;&amp;amp;str&lt;/code&gt;) to an owned &lt;code&gt;String&lt;/code&gt;.This conversion is necessary because greet_user expects a &lt;code&gt;&amp;amp;str&lt;/code&gt; parameter, and &lt;code&gt;to_string()&lt;/code&gt; creates a new &lt;code&gt;String&lt;/code&gt;instance from the trimmed input&lt;/p&gt;

&lt;p&gt;Now the final output will look like&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv9sx72sbl0x4wywa6wd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv9sx72sbl0x4wywa6wd.png" alt="Final output" width="800" height="315"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;so that's all for this challenge , Thank You&lt;/p&gt;

&lt;p&gt;For a more detailed explanation, you can watch my YouTube video.&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ewyU7QkjMdI"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;GitHub - &lt;a href="https://github.com/JoelJaison394/RustDailyChallenge.git" rel="noopener noreferrer"&gt;Link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rust</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>A cliché rusty project built using rust</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Tue, 20 Feb 2024 15:50:09 +0000</pubDate>
      <link>https://dev.to/joeljaison394/a-cliche-rusty-project-built-using-rust-8oi</link>
      <guid>https://dev.to/joeljaison394/a-cliche-rusty-project-built-using-rust-8oi</guid>
      <description>&lt;p&gt;So, it's been a week, and I have been relearning &lt;strong&gt;Rust&lt;/strong&gt;. Hopefully, without falling into many pitfalls, I was able to cover the basics of &lt;strong&gt;Rust&lt;/strong&gt; in a detailed and explanatory manner.&lt;/p&gt;

&lt;p&gt;By incorporating fundamental concepts such as enums, structs, tuples, vectors, loops, strings, types, match, etc., I have successfully created a simple yet functional project—a task manager designed to operate in the command line interface (CMD).&lt;/p&gt;

&lt;p&gt;The project building was fun, mainly because there weren't many confusing parts or head-scratching doubts or errors that I fell into. I believe it's mainly because of having a good foundation to stand upon. I have recorded the live coding of the project as a document.&lt;/p&gt;

&lt;p&gt;The main aim of this blog is to keep track of my Rust progress, so that later when I look back, I can see the steps I have climbed in my learning journey. Rust is a tough language, but dedicating appropriate time and having good resources to learn will always be beneficial.&lt;/p&gt;

&lt;p&gt;And a simple piece of advice to fellow readers: if you learn anything, always try to build something with that knowledge, even if it's small—no problem. It doesn't have to be perfect, bug-free, or very attractive. Just build; it will boost your confidence along with your motivation to code. Try to document the journey, take up challenges one by one. Likewise, you could build a strong foundation, and that foundation will support you forever, even if whatever AI comes to take over.&lt;/p&gt;

&lt;p&gt;So, thank you, and have a great day! Don't forget to write at least a line of code today 😂. Below, I will provide the link to the live coding of the project, along with the GitHub repository link. If you have time and interest, do check it out.&lt;/p&gt;

&lt;p&gt;Github repo - &lt;a href="https://github.com/JoelJaison394/Rust_Taskmanager" rel="noopener noreferrer"&gt;Link&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FfmfWk_kOA4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>rust</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>KeyMomentum: My First TypeScript Project</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Wed, 13 Dec 2023 11:32:22 +0000</pubDate>
      <link>https://dev.to/joeljaison394/keymomentum-my-first-typescript-project-4n1d</link>
      <guid>https://dev.to/joeljaison394/keymomentum-my-first-typescript-project-4n1d</guid>
      <description>&lt;p&gt;Last week, I enrolled in a TypeScript course. While learning, I got excited and decided to build a project using it as well. I challenged myself to learn and build a medium-complexity project within just 7 days.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Master Plan
&lt;/h3&gt;

&lt;p&gt;For the first three days, I focused solely on understanding TypeScript. In my free time during those days, I explored project ideas and settled on building a type speed testing app. I created a basic outline in Figma, more like a rough sketch than a full design.&lt;/p&gt;

&lt;p&gt;The remaining 4 days were dedicated to building the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  DAY-4
&lt;/h3&gt;

&lt;p&gt;The real challenge began on the first day of development. I chose Svelte as my framework but encountered difficulties with even basic tasks like managing simple states. My lack of experience in this framework likely contributed to these obstacles. Every line I wrote was instantly highlighted in red, highlighting my errors. This constant push of negativity led to discouragement, exhaustion, and ultimately, abandonment of the project.&lt;/p&gt;

&lt;h3&gt;
  
  
  DAY-5
&lt;/h3&gt;

&lt;p&gt;The next day, fuelled by renewed determination, I took a bold step. Before even the thought of brushing my teeth crossed my mind, I deleted the Svelte project folder. In its place, I began a new project in React and Tailwind, embarking on a fresh path with renewed optimism.&lt;/p&gt;

&lt;p&gt;Despite the initial comfort in setting up the UI with React and Tailwind, my progress soon encountered roadblocks again. The logic for matching the user's input against the provided sentence proved troublesome, deviating from my initial vision. Another hurdle arose with TypeScript, as the application's structure and complexities demanded a different understanding than the fundamentals I had learned. Specifically, the lack of experience with states, complex interfaces, and null checks presented a significant challenge.&lt;/p&gt;

&lt;p&gt;Determined to overcome these obstacles, I searched for similar projects on GitHub. Though I found a JavaScript project, it provided valuable insights into the logic and function structure. This knowledge served as a springboard for recreating the logic in TypeScript, incorporating my modifications, and tailoring it to my specific needs. This process demanded long hours, often exceeding 10-11 hours, significantly impacting my sleep cycle.&lt;/p&gt;

&lt;h3&gt;
  
  
  DAY-6
&lt;/h3&gt;

&lt;p&gt;On the third day, I was super tired, but I finally understood the logic from the day before. I was able to make a simple working prototype with a basic UI, even though it wasn't fancy and everything was in one file. By the end of the day, I was so happy! I can't wait to show you how simple it looked back then.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vx5gk7teybncum94bw2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vx5gk7teybncum94bw2.png" alt="blog-cover" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That same day, fueled by my accomplishment, I took the extra step of crafting a logo, christening the project with a name, and establishing a dedicated repository on GitHub. This marked a significant milestone, solidifying the project's existence and paving the way for further development.&lt;/p&gt;

&lt;h3&gt;
  
  
  Day-7
&lt;/h3&gt;

&lt;p&gt;On the final day, while I knew I couldn't complete all the desired features, my goal was to build a working prototype with basic functionality. This included setting a timer range, adjusting difficulty levels, implementing proper state and context management, and creating a minimalist UI. I started from scratch in React, referencing my previous version and working tirelessly until midnight. I realized that focusing on specific dates was only adding stress, so I shifted my mindset to continuous learning and problem-solving through project development. Setting up a solid foundation was my main objective, and it took an additional two days to achieve the current state. While KeyMomentum may appear simple now, it represents a significant accomplishment and a stepping stone for future enhancements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702447975536%2F658d1ed0-92e2-4c72-baca-1fc5d6c0e3e6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702447975536%2F658d1ed0-92e2-4c72-baca-1fc5d6c0e3e6.png" width="800" height="394"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm so proud to share my experience with you. I encourage you to learn by doing and show the world what you've learned by building or solving something real. Don't just show off certificates or badges! When you face challenges, don't give up. Roadblocks are signs you're on the right path to progress. If you don't face any, it means you're not growing. I know I made a mistake when I gave up on Svelte. Now I know I need to improve there. When we meet next time, I'll be coming back with an amazing new project in Svelte using the latest features. See you soon!&lt;/p&gt;

&lt;p&gt;the Keymometum project gallery and lnk to the porject will be provided below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702448027885%2F92456b70-bc1c-49ae-a64f-c2fed1c30054.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702448027885%2F92456b70-bc1c-49ae-a64f-c2fed1c30054.png" alt="keymomentum-preview" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702448171011%2F3e7e93d3-56f4-47ed-bff9-2913561cf2e4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1702448171011%2F3e7e93d3-56f4-47ed-bff9-2913561cf2e4.png" alt="keymomentum-preview" width="800" height="284"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5pv5k2nfso9j28pkhr8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft5pv5k2nfso9j28pkhr8.png" alt="keymomentum-preview" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gz7b6od95v54o25mso3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2gz7b6od95v54o25mso3.png" alt="keymomentum-preview" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvwf6hef80t494tnvurf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffvwf6hef80t494tnvurf.png" alt="keymomentum-preview" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22hy9e1wy7u7dmoa4utt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F22hy9e1wy7u7dmoa4utt.png" alt="keymomentum-preview" width="800" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/JoelJaison394/KEYMOMENTUM.git" rel="noopener noreferrer"&gt;&lt;code&gt;githublink&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>typescript</category>
    </item>
    <item>
      <title>Mastering Conditional Rendering and Lists in Svelte</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Mon, 25 Sep 2023 15:23:03 +0000</pubDate>
      <link>https://dev.to/joeljaison394/mastering-conditional-rendering-and-lists-in-svelte-1e30</link>
      <guid>https://dev.to/joeljaison394/mastering-conditional-rendering-and-lists-in-svelte-1e30</guid>
      <description>&lt;p&gt;In the previous assignment, you had the task of creating a counter and exploring the functionality of components in Svelte. Today, our focus will shift towards mastering the art of conditionally rendering components and efficiently rendering lists using loops.&lt;/p&gt;

&lt;p&gt;if you haven't read part 1 and 2 check&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/joeljaison394/unlocking-the-power-of-svelte-mastering-bindings-70l"&gt;https://dev.to/joeljaison394/unlocking-the-power-of-svelte-mastering-bindings-70l&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/joeljaison394/getting-started-with-svelte-a-comprehensive-tutorial-series-44a3"&gt;https://dev.to/joeljaison394/getting-started-with-svelte-a-comprehensive-tutorial-series-44a3&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conditional Rendering in Svelte&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Conditional rendering is a crucial concept in web development, allowing us to display different content based on certain conditions. In Svelte, this is quite straightforward thanks to its clean and intuitive syntax.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Basic Conditional Rendering&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let's start with the basics. To conditionally render content in Svelte, we use the &lt;code&gt;{#if}&lt;/code&gt; and &lt;code&gt;{/if}&lt;/code&gt; blocks. Here's an example:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;showContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&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="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;showContent&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="nx"&gt;only&lt;/span&gt; &lt;span class="nx"&gt;display&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;showContent&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="kc"&gt;true&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/if&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, the paragraph will be shown only if &lt;code&gt;showContent&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conditional Rendering with&lt;/strong&gt; &lt;code&gt;else&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Sometimes, you want to display one thing when a condition is true and something else when it's false. Svelte allows you to do this with the &lt;code&gt;{:else}&lt;/code&gt; block:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;loggedIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&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="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;loggedIn&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;{:&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Please&lt;/span&gt; &lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="k"&gt;in&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/if&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, if &lt;code&gt;loggedIn&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;, it will display the welcome message, and if &lt;code&gt;loggedIn&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt;, it will display the login prompt.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conditional Rendering with Ternary Operator&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you have a simple conditional, you can use a ternary operator for a concise syntax:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;isLoggedIn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;isLoggedIn&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Welcome&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Please&lt;/span&gt; &lt;span class="nx"&gt;log&lt;/span&gt; &lt;span class="k"&gt;in&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code achieves the same result as the previous example but with a more compact format.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Ticket Pricing for the Fun Ride&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, let's apply our knowledge of conditional rendering to a real-world scenario: pricing tickets for a fun ride. Our pricing scheme is as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Children below 10 years&lt;/strong&gt;: $5&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Children between 10 and 20 years&lt;/strong&gt;: $10&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Teenagers and young adults up to 60 years&lt;/strong&gt;: $15&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Children below 5 years and adults above 60 years&lt;/strong&gt;: Not allowed to enter.&lt;br&gt;
&lt;/p&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;ticketPrice&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;showTicket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&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;calculateTicketPrice&lt;/span&gt;&lt;span class="p"&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;ticketPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;ticketPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;ticketPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&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;age&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;ticketPrice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15&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;ticketPrice&lt;/span&gt;&lt;span class="p"&gt;;&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;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container mx-auto p-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-3xl font-semibold mb-4 underline&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Fun&lt;/span&gt; &lt;span class="nx"&gt;Ride&lt;/span&gt; &lt;span class="nx"&gt;Ticket&lt;/span&gt; &lt;span class="nx"&gt;Pricing&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&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;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mb-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;block text-gray-700 text-xl p-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Enter&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;name&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;/label&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;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded-lg p-4 w-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&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;label&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;block text-gray-700 text-xl p-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Enter&lt;/span&gt; &lt;span class="nx"&gt;your&lt;/span&gt; &lt;span class="nx"&gt;age&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;/label&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;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;age&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded-lg p-4 w-24 mr-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&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;button&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;showTicket&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-full transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-md &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Get&lt;/span&gt; &lt;span class="nx"&gt;Ticket&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&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="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;showTicket&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;ticketPrice&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; bg-yellow-300 w-52 hover:bg-yellow-400 border-2 border-yellow-500 rounded-lg p-4 shadow-lg transform scale-105 transition duration-300 ease-in-out &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-2xl font-bold mb-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Ticket&lt;/span&gt; &lt;span class="nx"&gt;Details&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-blue-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;name&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;/p&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-blue-500&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toLocaleDateString&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;/p&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-green-600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Ticket&lt;/span&gt; &lt;span class="nx"&gt;Price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;calculateTicketPrice&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;/p&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-purple-500 mt-2 hover:text-purple-700 cursor-pointer transition duration-300 ease-in-out&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Enjoy&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;ride&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&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="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;{:&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
                &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-red-500 text-xl mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Sorry&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;are&lt;/span&gt; &lt;span class="nx"&gt;not&lt;/span&gt; &lt;span class="nx"&gt;allowed&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;enter&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;fun&lt;/span&gt; &lt;span class="nx"&gt;ride&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/if&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/if&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;    &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/if&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;In this example, we calculate the ticket price based on the &lt;code&gt;age&lt;/code&gt; variable using conditional statements. If the age falls within one of the specified ranges, it displays the ticket price; otherwise, it informs the user that they are not allowed to enter the fun ride.&lt;/p&gt;

&lt;p&gt;Conditional rendering in Svelte makes it easy to create dynamic and responsive interfaces, like our ticket pricing system for the fun ride.🎢🎉&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiavqykd0rpn7kdrkiojf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiavqykd0rpn7kdrkiojf.png" alt="demo app" width="800" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff04njm0tzd1ik75cieki.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff04njm0tzd1ik75cieki.png" alt="demo app" width="800" height="554"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8xsh2xcoeucybn79ohz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw8xsh2xcoeucybn79ohz.png" alt="demo app" width="600" height="369"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Rendering Lists in Svelte&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now, let's see another aspect of Svelte: rendering lists using the &lt;code&gt;{#each}&lt;/code&gt; block.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using&lt;/strong&gt; &lt;code&gt;{#each}&lt;/code&gt; to Render Lists
&lt;/h3&gt;

&lt;p&gt;Svelte provides a convenient way to iterate over arrays and render lists of elements using the &lt;code&gt;{#each}&lt;/code&gt; block. Here's an example:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cherry&lt;/span&gt;&lt;span class="dl"&gt;'&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;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list-disc pl-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;fruit&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-green-600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fruit&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;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/each&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We have an array of &lt;code&gt;fruits&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We use &lt;code&gt;{#each}&lt;/code&gt; to iterate over the &lt;code&gt;fruits&lt;/code&gt; array and render a list item (&lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt;) for each fruit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;We also display the index of each fruit in the array.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Using Keys in Lists&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;When rendering lists in Svelte, it's crucial to understand the significance of using keys. Keys are unique identifiers assigned to each item in the list, helping Svelte efficiently update and manipulate the DOM when the list changes.&lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Why Use Keys?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Imagine you have a list of items displayed on a web page. This list can change dynamically due to various actions, such as adding or removing items. When a change occurs, Svelte needs to update the DOM to reflect the new state of the list.&lt;/p&gt;

&lt;p&gt;Without keys, Svelte might struggle to differentiate between items in the old list and items in the new list. This can lead to unnecessary re-rendering of elements, affecting performance and potentially causing unintended side effects.&lt;/p&gt;

&lt;p&gt;Let's illustrate the importance of keys with an example:&lt;br&gt;
&lt;/p&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cherry&lt;/span&gt;&lt;span class="dl"&gt;'&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;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;list-disc pl-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nf"&gt;fruit &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fruitIndex&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-green-600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fruit&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;fruitIndex&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;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/each&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;In this code, we have a list of fruits. Each item in the list is rendered as an &lt;code&gt;&amp;lt;li&amp;gt;&lt;/code&gt; element within an unordered list. The index of each fruit is also displayed.&lt;/p&gt;

&lt;p&gt;Now, let's say we want to add a new fruit to our list:&lt;br&gt;
&lt;/p&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;fruits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Apple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Banana&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Cherry&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Date&lt;/span&gt;&lt;span class="dl"&gt;'&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;/code&gt;&lt;/pre&gt;


&lt;p&gt;Without keys, when Svelte updates the list, it might re-render all elements, even though the existing items haven't changed. This inefficiency can lead to performance issues, especially with larger lists.&lt;/p&gt;

&lt;p&gt;By using keys, we provide Svelte with a unique identifier for each item. When we add the 'Date' fruit with a key, Svelte knows precisely which item has been added and can efficiently update the DOM without affecting other elements.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now a note - [Svelte's reactivity system ensures that when you add or remove elements from an array, your UI stays in sync with the data, providing a seamless and responsive user experience.]&lt;/p&gt;

&lt;p&gt;example :&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding and Removing Elements of an Array
&lt;/h3&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Product A&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Product B&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Product C&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;

  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newProduct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&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;addProduct&lt;/span&gt;&lt;span class="p"&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;newProduct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nx"&gt;newProduct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;newProduct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;products&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="nx"&gt;newProduct&lt;/span&gt; &lt;span class="p"&gt;}];&lt;/span&gt;
      &lt;span class="nx"&gt;newProduct&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;removeProduct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&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;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mx-auto p-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;newProduct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Product Name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded-lg p-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;newProduct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Price&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded-lg p-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;addProduct&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-full transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Add&lt;/span&gt; &lt;span class="nx"&gt;Product&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&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="sr"&gt;/div&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;ul&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;&lt;span class="nx"&gt;each&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nf"&gt;product &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-yellow-100 p-4 mb-2 rounded-lg shadow-md flex justify-between items-center&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-xl font-semibold&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&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;/p&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text-gray-600&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;price&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;/p&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="sr"&gt;/div&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;button&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;removeProduct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bg-red-500 hover:bg-red-600 text-white py-2 px-4 rounded-full transition duration-300 ease-in-out transform hover:scale-105 hover:shadow-md&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Remove&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&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="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sr"&gt;/each&lt;/span&gt;&lt;span class="err"&gt;}
&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizxyaadwxbdl6h4tmrit.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizxyaadwxbdl6h4tmrit.png" alt="demo img-1" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We've laid the foundation of Svelte's basics, but this is just the beginning. The world of Svelte is full of possibilities waiting to be explored.&lt;/p&gt;

&lt;p&gt;For the assignment, take the fun ride we built earlier and expand it. Add more exciting rides using lists and create separate tickets for each ride. This will not only solidify your understanding but also enhance your web development skills.&lt;/p&gt;

&lt;p&gt;Remember, learning is a journey. If you face any challenges or need clarification, don't hesitate to reach out via email or comments. Your path to mastering Svelte has just begun, and the adventures ahead are limitless! 🎢🚀.&lt;/p&gt;

&lt;p&gt;Thank you❤️&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Unlocking the Power of Svelte: Mastering Bindings</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sun, 24 Sep 2023 03:21:19 +0000</pubDate>
      <link>https://dev.to/joeljaison394/unlocking-the-power-of-svelte-mastering-bindings-70l</link>
      <guid>https://dev.to/joeljaison394/unlocking-the-power-of-svelte-mastering-bindings-70l</guid>
      <description>&lt;p&gt;So, previously, we stopped after just making that demo skeleton. Your folder structure looks something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc0e6rlweq4deurtmcnt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frc0e6rlweq4deurtmcnt.png" alt="project directory" width="800" height="1560"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, let's set up our working environment by creating some folders. Follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Inside the &lt;code&gt;lib&lt;/code&gt; directory, create a new folder named &lt;code&gt;components&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Within the &lt;code&gt;components&lt;/code&gt; folder, create a new file, and name it &lt;code&gt;binding.svelte&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, your project structure should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; lib/
  - components/
    - binding.svelte
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We've created a dedicated folder for our components, and we'll be working with the &lt;code&gt;binding.svelte&lt;/code&gt; file shortly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Import&lt;/strong&gt; &lt;code&gt;binding.svelte&lt;/code&gt; &lt;strong&gt;into&lt;/strong&gt; &lt;code&gt;+page.svelte&lt;/code&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open your &lt;code&gt;src/routes/+page.svelte&lt;/code&gt; file, and add the following import statement at the top:&lt;br&gt;
&lt;/p&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="nx"&gt;Binding&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/components/binding.svelte&lt;/span&gt;&lt;span class="dl"&gt;'&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;/code&gt;&lt;/pre&gt;


&lt;p&gt;This imports the &lt;code&gt;binding.svelte&lt;/code&gt; component into your &lt;code&gt;+page.svelte&lt;/code&gt; file, allowing you to use it.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add Content to&lt;/strong&gt; &lt;code&gt;binding.svelte&lt;/code&gt;&lt;strong&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, navigate to your &lt;code&gt;binding.svelte&lt;/code&gt; file located in &lt;code&gt;lib/components/&lt;/code&gt;. Add the following content as a sample:&lt;br&gt;
&lt;/p&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="c1"&gt;// You can add script logic here if needed&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;style&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="cm"&gt;/* You can apply styles specific to this component here */&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/style&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;h2&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;This&lt;/span&gt; &lt;span class="nx"&gt;is&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;Sample&lt;/span&gt; &lt;span class="nx"&gt;Heading&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nx"&gt;binding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;svelte&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h2&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;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;Welcome&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="nx"&gt;the&lt;/span&gt; &lt;span class="nx"&gt;world&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;Svelte&lt;/span&gt; &lt;span class="nx"&gt;bindings&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nx"&gt;You&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt; &lt;span class="nx"&gt;add&lt;/span&gt; &lt;span class="nx"&gt;more&lt;/span&gt; &lt;span class="nx"&gt;content&lt;/span&gt; &lt;span class="nx"&gt;and&lt;/span&gt; &lt;span class="nx"&gt;functionality&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;explore&lt;/span&gt; &lt;span class="nx"&gt;Svelte&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;s capabilities.
&amp;lt;/p&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Remember, in Svelte, &lt;code&gt;.svelte&lt;/code&gt; files can contain both script logic and styles within the same file. This component now has a sample heading and paragraph. and in here we will not be using much custom styles&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With these changes, your &lt;code&gt;binding.svelte&lt;/code&gt; component is ready with some content, and you've imported it into your &lt;code&gt;+page.svelte&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Now that you've made those changes, take a moment to appreciate the magic of Svelte. The content you added to &lt;code&gt;binding.svelte&lt;/code&gt; is static.But what exactly is making it so?&lt;/p&gt;

&lt;p&gt;Let's dive into the exciting world of &lt;strong&gt;binding&lt;/strong&gt; in Svelte.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding Binding in Svelte&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Binding is a core concept in Svelte that allows you to create dynamic and interactive web applications effortlessly. At its heart, binding establishes a connection between your component's data and the user interface (UI). This connection ensures that any changes to your data are automatically reflected in the UI, and vice versa.&lt;/p&gt;

&lt;p&gt;In other words, when you update a variable, input field, or any other UI element in a bound Svelte component, the corresponding data is updated, and the change is immediately reflected everywhere it's used in your app. No need to write complex event listeners or manually update the DOM – Svelte takes care of it for you.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of Bindings&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Svelte offers various types of bindings, each designed for different use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Two-way binding&lt;/strong&gt;: This binds a variable to an input element, allowing changes in the input to update the variable and vice versa.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;One-way binding&lt;/strong&gt;: Also known as "binding," this connects a variable to an element's property, such as text content or attribute values, ensuring that changes in the variable are reflected in the UI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Group binding&lt;/strong&gt;: Useful for managing multiple related input elements, this binds a group of inputs to an array or object, simplifying data handling.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Event binding&lt;/strong&gt;: This lets you respond to user interactions by binding an event handler function to an element, like a button click or mouseover event.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Two-way binding
&lt;/h3&gt;

&lt;p&gt;let's look a example&lt;/p&gt;

&lt;p&gt;update our binding.svelte with this code&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;inputValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Initialize an empty variable to store the input value&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;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inputValue&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded p-2 w-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter your name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hii&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;👋&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inputValue&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;We declare a variable called &lt;code&gt;inputValue&lt;/code&gt; in the Svelte script section.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We use the &lt;code&gt;bind:value&lt;/code&gt; directive on the &lt;code&gt;input&lt;/code&gt; element. This directive establishes a two-way binding between the input element and the &lt;code&gt;inputValue&lt;/code&gt; variable. It means that any changes made to the input element will automatically update the &lt;code&gt;inputValue&lt;/code&gt;, and vice versa.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Below the input element, we display the value of &lt;code&gt;inputValue&lt;/code&gt; inside a paragraph (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;) element. This demonstrates that the &lt;code&gt;inputValue&lt;/code&gt; variable is reactive, and any changes in the input element are immediately reflected in the UI.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you type in the input field, you'll see that the text below it updates in real-time to reflect the changes. This is the essence of two-way binding in Svelte, where data and the UI stay in sync without the need for manual event handling.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fili6htjiewn676qdqfl5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fili6htjiewn676qdqfl5.png" alt="binding" width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tqc3ontj4qnlz8um300.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tqc3ontj4qnlz8um300.png" alt="binding" width="600" height="337"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  one-way binding
&lt;/h3&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;inputValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Initialize an empty variable to store the input value&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;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-4&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;
      &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inputValue&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="nl"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inputValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
      &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;border rounded p-2 w-50&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
      &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Enter your name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&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;p&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mt-2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hii&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="err"&gt;👋&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inputValue&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;We declare a variable called &lt;code&gt;inputValue&lt;/code&gt; in the Svelte script section.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We use the &lt;code&gt;value&lt;/code&gt; property on the &lt;code&gt;input&lt;/code&gt; element to bind it to the &lt;code&gt;inputValue&lt;/code&gt; variable. This establishes a one-way binding, where the input field displays the value of &lt;code&gt;inputValue&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We add an &lt;code&gt;on:input&lt;/code&gt; event handler to the &lt;code&gt;input&lt;/code&gt; element. This event handler listens for changes in the input field. When the input field value changes, it updates the &lt;code&gt;inputValue&lt;/code&gt; variable with the new value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Below the input element, we display the value of &lt;code&gt;inputValue&lt;/code&gt; inside a paragraph (&lt;code&gt;&amp;lt;p&amp;gt;&lt;/code&gt;) element. This demonstrates that changes in the input field are reflected in the &lt;code&gt;inputValue&lt;/code&gt; variable and, consequently, in the UI.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this one-way binding example, changes in the input field update the variable (&lt;code&gt;inputValue&lt;/code&gt;), but changes made directly to the variable (&lt;code&gt;inputValue&lt;/code&gt;) do not update the input field. This is the essence of one-way binding, where data flows from the variable to the UI.&lt;/p&gt;

&lt;p&gt;next is&lt;/p&gt;

&lt;h3&gt;
  
  
  group binding
&lt;/h3&gt;

&lt;p&gt;group binding in Svelte that's interactive and dynamic. In this example, we'll create a list of items, and users can add, remove, and edit items. The items will be bound to an array using group binding, simplifying data handling:&lt;/p&gt;

&lt;h3&gt;
  
  
  Event binding
&lt;/h3&gt;

&lt;p&gt;Event binding in Svelte allows you to respond to user interactions, such as button clicks, mouse events, and keyboard events. Let's explore event binding with some examples and code.&lt;/p&gt;

&lt;p&gt;In this example, we'll demonstrate how to bind a button click event to a function in Svelte.&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button clicked!&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;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;button&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Click&lt;/span&gt; &lt;span class="nx"&gt;Me&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We define a JavaScript function &lt;code&gt;handleClick&lt;/code&gt; that displays an alert when called.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;on:click&lt;/code&gt; directive binds the &lt;code&gt;handleClick&lt;/code&gt; function to the button's click event. When the button is clicked, the &lt;code&gt;handleClick&lt;/code&gt; function is executed, triggering the alert.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's another example of binding an input field's change event to dynamically update a variable in Svelte.&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;inputValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Initialize an empty variable to store the input value&lt;/span&gt;
  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleChange&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;inputValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&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;input&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;placeholder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Type something...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;You&lt;/span&gt; &lt;span class="nx"&gt;typed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;inputValue&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;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We declare a variable &lt;code&gt;inputValue&lt;/code&gt; to store the input field's value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;on:input&lt;/code&gt; directive binds the &lt;code&gt;handleChange&lt;/code&gt; function to the input field's change event. Whenever the user types something in the input field, the &lt;code&gt;handleChange&lt;/code&gt; function is called, updating the &lt;code&gt;inputValue&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We display the value of &lt;code&gt;inputValue&lt;/code&gt; below the input field, showing real-time updates as the user types.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now let's see how to handle a mouseover event on an element:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleMouseover&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Mouseover detected!&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;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;div&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;mouseover&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleMouseover&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;width: 100px; height: 100px; background-color: lightblue;&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;Hover&lt;/span&gt; &lt;span class="nx"&gt;over&lt;/span&gt; &lt;span class="nx"&gt;me&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We define a JavaScript function &lt;code&gt;handleMouseover&lt;/code&gt; that displays an alert when the mouseover event occurs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;code&gt;on:mouseover&lt;/code&gt; directive binds the &lt;code&gt;handleMouseover&lt;/code&gt; function to the &lt;code&gt;mouseover&lt;/code&gt; event of the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element. When the mouse cursor is over the element, the &lt;code&gt;handleMouseover&lt;/code&gt; function is called, triggering the alert.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are just a few examples of event binding in Svelte. You can bind various events to different elements and perform actions based on user interactions, making your Svelte applications highly interactive and responsive.&lt;/p&gt;

&lt;p&gt;we will learn much about it will going through coming topics&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Binding HTML Content in Svelte&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In Svelte, you can dynamically bind and render HTML content within your components. This feature is incredibly useful when you want to display rich, dynamic content that includes HTML markup. Let's dive right into it with a hands-on example.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The {&lt;a class="mentioned-user" href="https://dev.to/html"&gt;@html&lt;/a&gt; ...} Syntax&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To bind and render HTML content in Svelte, you'll use the &lt;code&gt;{@html ...}&lt;/code&gt; syntax. This special syntax allows you to inject raw HTML content directly into your templates.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example: Displaying Dynamic HTML Content
&lt;/h4&gt;

&lt;p&gt;Let's say you have a use case where you want to display user-generated HTML content. Here's how you can do it:&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="nx"&gt;htmlCopy&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;dynamicHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;p&amp;gt;&amp;lt;strong&amp;gt;This is bold text&amp;lt;/strong&amp;gt; and &amp;lt;em&amp;gt;this is italicized text&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&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;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{@&lt;/span&gt;&lt;span class="nd"&gt;html&lt;/span&gt; &lt;span class="nx"&gt;dynamicHTML&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;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We have a variable &lt;code&gt;dynamicHTML&lt;/code&gt; that contains an HTML string.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We use the &lt;code&gt;{@html ...}&lt;/code&gt; syntax inside a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; element to render the HTML content dynamically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The content of &lt;code&gt;dynamicHTML&lt;/code&gt; can change based on user interactions, data from an API, or any other source.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you run this code, the HTML content stored in &lt;code&gt;dynamicHTML&lt;/code&gt; will be rendered as part of your web page. This is a powerful way to incorporate dynamic and user-generated content into your Svelte applications.&lt;/p&gt;

&lt;h4&gt;
  
  
  Example: Updating HTML Content
&lt;/h4&gt;

&lt;p&gt;You can also update the HTML content dynamically. Let's add a button to update the HTML content when clicked:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;dynamicHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;p&amp;gt;This is the initial HTML content&amp;lt;/p&amp;gt;&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;updateHTML&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;dynamicHTML&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;p&amp;gt;Now the HTML content has been updated!&amp;lt;/p&amp;gt;&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;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;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{@&lt;/span&gt;&lt;span class="nd"&gt;html&lt;/span&gt; &lt;span class="nx"&gt;dynamicHTML&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;/div&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;button&lt;/span&gt; &lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;updateHTML&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Update&lt;/span&gt; &lt;span class="nx"&gt;HTML&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We have initial HTML content in the &lt;code&gt;dynamicHTML&lt;/code&gt; variable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There's a button with an &lt;code&gt;on:click&lt;/code&gt; handler that triggers the &lt;code&gt;updateHTML&lt;/code&gt; function when clicked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inside the &lt;code&gt;updateHTML&lt;/code&gt; function, we change the value of &lt;code&gt;dynamicHTML&lt;/code&gt; to update the HTML content.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, when you click the "Update HTML" button, the HTML content displayed on the page will change dynamically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assignment #2: Create an Interactive Counter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Build a simple web page that features a counter. You'll use event binding to increment and decrement the counter's value based on user interactions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instructions:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Set up a new Svelte project if you haven't already. You can use the Svelte project template or an existing project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a component named &lt;code&gt;Counter.svelte&lt;/code&gt;. This component will represent the counter and handle its functionality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inside &lt;code&gt;Counter.svelte&lt;/code&gt;, declare a variable named &lt;code&gt;count&lt;/code&gt; and initialize it to &lt;code&gt;0&lt;/code&gt;. This variable will store the current count value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create two buttons in your component: one for incrementing the count and one for decrementing it. Bind the appropriate event handlers to these buttons.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement event binding to increment and decrement the &lt;code&gt;count&lt;/code&gt; variable when the corresponding buttons are clicked. Make sure the counter value is updated accordingly.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Display the current count value on your web page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Style your counter component to make it visually appealing. You can use CSS or Tailwind CSS if you're familiar with it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create an instance of the &lt;code&gt;Counter&lt;/code&gt; component in your main application file (+page.svelte) and render it on your web page.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Test your counter by interacting with the increment and decrement buttons. Ensure that the count updates correctly and that the UI reflects the changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Bonus (Optional):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add validation to prevent the count from going below zero (i.e., the counter should not go negative).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement additional features, such as a reset button to set the count back to zero.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Explore other events and interactions you can add to your counter, such as mouseover effects or animations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the next part of our Svelte tutorial series, we'll continue our journey by exploring even more essential concepts. Get ready to dive into:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Conditional Rendering&lt;/strong&gt;: Learn how to conditionally display or hide elements based on certain conditions, making your components adaptable and flexible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lists and Iteration&lt;/strong&gt;: Discover how to work with lists of data and iterate over them to generate dynamic content, such as lists of items or dynamic tables.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These topics are fundamental for building complex and dynamic web applications with Svelte. So, stay tuned for the next episode, where we'll continue our exploration of Svelte's capabilities.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>sveltekit</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Getting Started with Svelte: A Comprehensive Tutorial Series</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Sat, 23 Sep 2023 15:48:23 +0000</pubDate>
      <link>https://dev.to/joeljaison394/getting-started-with-svelte-a-comprehensive-tutorial-series-44a3</link>
      <guid>https://dev.to/joeljaison394/getting-started-with-svelte-a-comprehensive-tutorial-series-44a3</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hey there, fellow learners!&lt;/p&gt;

&lt;p&gt;I'll be straight with you—I'm not a fan of those cookie-cutter tutorial templates that follow the usual intro, content, and conclusion formula. So, for this entire tutorial series on Svelte, we're going off-script. Each part of this series will dive into a small, bite-sized topic, toss in a fun assignment, and gradually ramp up from basic SvelteKit concepts to some seriously advanced stuff. And trust me, there's a big surprise waiting at the end!&lt;/p&gt;

&lt;p&gt;Ready? Okay, let's dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Svelte?
&lt;/h2&gt;

&lt;p&gt;Seriously, if you're here and you don't know what Svelte is, you might be wondering why you clicked on this blog post, right? There are tons of articles out there that explain the pros, cons, and features of Svelte. I'd recommend Googling those. But if you're still here and ready to roll, understanding what Svelte brings to the table is vital for our series.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assignment #1&lt;/strong&gt;: Get to know Svelte, its benefits, and what makes it different from the rest of the JavaScript framework gang.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Alright, let's get the basics covered. Before we embark on this Svelte journey, here's what you need to have in your toolkit:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTML, CSS, JS&lt;/strong&gt;: A solid grasp of these web development basics will serve you well.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Editor&lt;/strong&gt;: Please, let's not go old-school with Notepad. Grab a code editor of your choice, like Visual Studio Code, Sublime Text, or whatever suits your fancy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt;: Make sure you have Node.js installed on your system. You can snag it from &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GitHub Account and Git&lt;/strong&gt;: Having a GitHub account is a good idea for version control and collaboration. If you don't have one yet, sign up at &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Got all that? Excellent!&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's Dive In
&lt;/h2&gt;

&lt;p&gt;Now, let's get our hands dirty. In this first part, we'll set up a basic Svelte project and get acquainted with its project structure. Ready to jump in? Let's roll!&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting Up a SvelteKit Project with Tailwind CSS
&lt;/h2&gt;

&lt;p&gt;In this section, we'll follow the steps from the &lt;a href="https://tailwindcss.com/docs/guides/sveltekit" rel="noopener noreferrer"&gt;Tailwind CSS documentation&lt;/a&gt; to set up a SvelteKit project with Tailwind CSS.&lt;/p&gt;

&lt;p&gt;You can name your project whatever you like. Open your terminal and run these commands:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ex9motrt6f02988q4px.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ex9motrt6f02988q4px.png" alt="tailwind configuration" width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Replace &lt;code&gt;my-project&lt;/code&gt; with your desired project name. After running this command, you'll be prompted to select a template.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fntp8jfzrmfxebx8a5ojj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fntp8jfzrmfxebx8a5ojj.png" alt="terminal guide" width="800" height="229"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose Skeleton project and for the rest of the template options choose as per the image references I given below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fko7qaya5f05h0mao8sps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fko7qaya5f05h0mao8sps.png" alt="terminal guide" width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwkbpefeudnfo0j80xt3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuwkbpefeudnfo0j80xt3.png" alt="terminal guide" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk707jrb1dvki9r9duj4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk707jrb1dvki9r9duj4v.png" alt="terminal guide" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frqpu0co3knpu5hrre2vx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frqpu0co3knpu5hrre2vx.png" alt="terminal guide" width="800" height="675"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay now complete the tailwind configuration&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6cr7gcpzvjmuhjgw9cy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl6cr7gcpzvjmuhjgw9cy.png" alt="terminal guide" width="789" height="227"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feb8w0ahnd543whwkor01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feb8w0ahnd543whwkor01.png" alt="terminal guide" width="783" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1dompfcx9ub95fbdb0i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr1dompfcx9ub95fbdb0i.png" alt="terminal guide" width="797" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8r7zuofaa92kflpslfj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl8r7zuofaa92kflpslfj.png" alt="terminal guide" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8pviqogthvlwhzmacv7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8pviqogthvlwhzmacv7z.png" alt="terminal guide" width="800" height="334"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here there is a small change, in our setup, you cannot see &lt;code&gt;+layout.svelte&lt;/code&gt; file so import app.css in &lt;code&gt;+page.svelte&lt;/code&gt; which is inside &lt;code&gt;src/routes&lt;/code&gt; directory&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffs41aw94jimdon41tkwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffs41aw94jimdon41tkwl.png" alt="change" width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, run the following command in your terminal to install the project's dependencies:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm i&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;next, let'find what our demo project looks like currently bu running &lt;code&gt;npm run dev&lt;/code&gt; command in the terminal&lt;/p&gt;

&lt;p&gt;You will notice that tailwind is not working for that we have to do a small tweak, change &lt;code&gt;app.css&lt;/code&gt; into &lt;code&gt;app.postcss&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now should could see development server running in &lt;a href="http://localhost:5174/" rel="noopener noreferrer"&gt;http://localhost:5174/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgofz4jazdxvobve3em3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgofz4jazdxvobve3em3q.png" alt="demo app" width="800" height="392"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This means our setup has been done successfully . If you face any difficulties there is another way&lt;/p&gt;

&lt;p&gt;go here - &lt;a href="https://github.com/JoelJaison394/svelte-Learning.git" rel="noopener noreferrer"&gt;https://github.com/JoelJaison394/svelte-Learning.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;go to branches and select starter-template-skeleton&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnf306cdtrgylt9a4um87.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnf306cdtrgylt9a4um87.png" alt="github guide" width="800" height="840"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3e4irpfefilt5xesxtlu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3e4irpfefilt5xesxtlu.png" alt="github-guide" width="800" height="608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download and open in the code editor and in that directory run &lt;code&gt;npm i&lt;/code&gt; and then run &lt;code&gt;npm run dev&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or I suggest cloning the GitHub repository.&lt;/p&gt;

&lt;p&gt;We will be talking about folder structure as we move on , If you are so curious about it right now itself i suggest googling and if you want to do some experiments now itself i suggest you go to +page.svelte and add some markup and tailwind css and brushup you styling skills and guys don't forgot about the assignment-1 .&lt;/p&gt;

&lt;p&gt;In next We will be learning about Binding in svelte&lt;/p&gt;

&lt;p&gt;We'll be talking about the project's folder structure as we move on. If you're curious about it right now, I suggest doing a quick online search for "SvelteKit folder structure" to satisfy your curiosity.&lt;/p&gt;

&lt;p&gt;For those eager to get hands-on experience, here's a little experiment for you:&lt;/p&gt;

&lt;p&gt;1. Open the &lt;code&gt;src/routes/+page.svelte&lt;/code&gt; file in your project directory.&lt;/p&gt;

&lt;p&gt;2. Add some HTML markup and apply Tailwind CSS classes to style your content.&lt;/p&gt;

&lt;p&gt;3. Experiment with different layouts, components, or styles to get a feel for how SvelteKit and Tailwind CSS work together. It's a great opportunity to brush up on your styling skills!&lt;/p&gt;

&lt;p&gt;Don't forget about &lt;strong&gt;Assignment #1&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Make sure you understand the benefits of Svelte and what sets it apart from other frameworks.&lt;/p&gt;

&lt;p&gt;In the next section, we'll dive into the exciting world of binding in Svelte!&lt;/p&gt;

&lt;p&gt;Learning About Binding in Svelte Stay tuned for our next installment, where we'll explore the concept of binding in Svelte. This powerful feature allows you to create dynamic and interactive web applications with ease. Get ready to take your Svelte skills to the next level!&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>svelte</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
