<?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.us-east-2.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 Let AI Agents Run My Friend Group and Honestly It Is Going Great</title>
      <dc:creator>Joel Jaison</dc:creator>
      <pubDate>Mon, 29 Jun 2026 13:47:18 +0000</pubDate>
      <link>https://dev.to/joeljaison394/i-let-ai-agents-run-my-friend-group-and-honestly-it-is-going-great-4dlo</link>
      <guid>https://dev.to/joeljaison394/i-let-ai-agents-run-my-friend-group-and-honestly-it-is-going-great-4dlo</guid>
      <description>&lt;h1&gt;
  
  
  I Built AI Agents That Plan Weekends So My Friends Don't Have to Reply in WhatsApp
&lt;/h1&gt;

&lt;p&gt;There is always that one group chat.&lt;/p&gt;

&lt;p&gt;Every Thursday someone sends,&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Guys... weekend plans?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then nothing.&lt;/p&gt;

&lt;p&gt;Three people read it. Two forget about it. Someone finally replies on Saturday afternoon asking if the plan is still happening. By then everyone has already made other plans or decided staying home sounds better.&lt;/p&gt;

&lt;p&gt;It happens every single week.&lt;/p&gt;

&lt;p&gt;I don't blame my friends. We're all busy. Work, college, deadlines, family stuff. Planning something with four or five people somehow ends up feeling like a full time job.&lt;/p&gt;

&lt;p&gt;Even if someone actually tries, the questions never stop.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftz61nowp6kbjuolti3tz.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftz61nowp6kbjuolti3tz.png" alt="problem" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Which movie?&lt;/p&gt;

&lt;p&gt;Which theatre?&lt;/p&gt;

&lt;p&gt;Who's vegetarian?&lt;/p&gt;

&lt;p&gt;Who's free after six?&lt;/p&gt;

&lt;p&gt;What's everyone's budget?&lt;/p&gt;

&lt;p&gt;Is this place too far?&lt;/p&gt;

&lt;p&gt;By the time you've answered everything, the weekend is basically over.&lt;/p&gt;

&lt;p&gt;After watching this happen for months I had one thought.&lt;/p&gt;

&lt;p&gt;What if everyone had someone to do the planning for them?&lt;/p&gt;

&lt;p&gt;Not another chatbot sitting in a group chat throwing random suggestions around.&lt;/p&gt;

&lt;p&gt;An actual personal AI agent.&lt;/p&gt;

&lt;p&gt;One agent per person.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6oqeco0uoom6ydhmvxw5.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6oqeco0uoom6ydhmvxw5.png" alt="One agent per person&lt;br&gt;
" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It knows your preferences, your budget, your schedule, the places you've hated before, and it argues on your behalf while you're busy doing something else.&lt;/p&gt;

&lt;p&gt;The agents negotiate with each other.&lt;/p&gt;

&lt;p&gt;You come back later.&lt;/p&gt;

&lt;p&gt;There's already a plan waiting.&lt;/p&gt;

&lt;p&gt;That became &lt;strong&gt;Pakt&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is how I built it.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://www.pakts.tech/" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpakts.tech%2FCoverImage.png" height="427" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://www.pakts.tech/" rel="noopener noreferrer" class="c-link"&gt;
            Pakt — Plan without the Pain
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Your AI agent negotiates with your friends' agents so you don't have to. Pick an activity, add friends, and get back a real plan — venue, time, and budget — without the group-chat back-and-forth.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.pakts.tech%2Ffavicon%2Ffavicon.ico" width="48" height="48"&gt;
          pakts.tech
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;





&lt;h1&gt;
  
  
  Why "Pakt"?
&lt;/h1&gt;

&lt;p&gt;The name came surprisingly early.&lt;/p&gt;

&lt;p&gt;It's based on the word &lt;em&gt;pact&lt;/em&gt;, a mutual agreement between people.&lt;/p&gt;

&lt;p&gt;That's exactly what the app is trying to create.&lt;/p&gt;

&lt;p&gt;Friends don't need another recommendation engine.&lt;/p&gt;

&lt;p&gt;They need help reaching an agreement.&lt;/p&gt;

&lt;p&gt;Changing the C to a K made it a little more memorable.&lt;/p&gt;

&lt;p&gt;It also works nicely as a verb.&lt;/p&gt;

&lt;p&gt;"Let's Pakt tonight."&lt;/p&gt;

&lt;p&gt;That sounded good enough to stick.&lt;/p&gt;




&lt;h1&gt;
  
  
  The First Decisions
&lt;/h1&gt;

&lt;p&gt;Before writing any code I spent a surprising amount of time deciding what &lt;strong&gt;not&lt;/strong&gt; to build.&lt;/p&gt;

&lt;p&gt;The hackathon required using AWS databases, so I had three options.&lt;/p&gt;

&lt;p&gt;Aurora PostgreSQL.&lt;/p&gt;

&lt;p&gt;Aurora DSQL.&lt;/p&gt;

&lt;p&gt;DynamoDB.&lt;/p&gt;

&lt;p&gt;For a chat application where multiple AI agents constantly write messages, DynamoDB felt like the obvious choice.&lt;/p&gt;

&lt;p&gt;High write throughput.&lt;/p&gt;

&lt;p&gt;Simple schema.&lt;/p&gt;

&lt;p&gt;And one feature that ended up becoming the backbone of the entire application.&lt;/p&gt;

&lt;p&gt;DynamoDB Streams.&lt;/p&gt;

&lt;p&gt;More on that in a bit.&lt;/p&gt;

&lt;p&gt;For the frontend I went with Next.js hosted on Vercel.&lt;/p&gt;

&lt;p&gt;Most of the UI started life inside v0.&lt;/p&gt;

&lt;p&gt;Honestly, it saved me an unbelievable amount of time.&lt;/p&gt;

&lt;p&gt;Instead of spending days aligning buttons and tweaking layouts, I could focus on building the actual product.&lt;/p&gt;

&lt;p&gt;The onboarding flow, dashboard and chat interface all started there before I customized everything.&lt;/p&gt;

&lt;p&gt;For the AI side I used GPT 4o.&lt;/p&gt;

&lt;p&gt;Every user gets their own agent powered by the same model.&lt;/p&gt;

&lt;p&gt;The interesting part isn't the model.&lt;/p&gt;

&lt;p&gt;It's the system prompt.&lt;/p&gt;

&lt;p&gt;Every agent has a different personality because every agent represents a different person.&lt;/p&gt;

&lt;p&gt;Someone who loves action movies shouldn't suddenly recommend romantic comedies just because everyone else likes them.&lt;/p&gt;

&lt;p&gt;The prompts had to make the agents feel like actual people instead of copies of each other.&lt;/p&gt;

&lt;p&gt;Finally there was LangGraph.&lt;/p&gt;

&lt;p&gt;That ended up becoming the brain of the whole application.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpnw0fseensa6wyg4srp5.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpnw0fseensa6wyg4srp5.png" alt=" " width="799" height="444"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  The Multi Agent Problem Nobody Warns You About
&lt;/h1&gt;

&lt;p&gt;Whenever people talk about multi agent systems, they usually focus on making agents smarter.&lt;/p&gt;

&lt;p&gt;Better prompts.&lt;/p&gt;

&lt;p&gt;Better tools.&lt;/p&gt;

&lt;p&gt;Better memory.&lt;/p&gt;

&lt;p&gt;Nobody talks about the real problem.&lt;/p&gt;

&lt;p&gt;How do you make them stop talking?&lt;/p&gt;

&lt;p&gt;Seriously.&lt;/p&gt;

&lt;p&gt;If you give four AI agents a shared goal and tell them to figure it out, they'll happily keep discussing forever.&lt;/p&gt;

&lt;p&gt;They'll agree.&lt;/p&gt;

&lt;p&gt;Then disagree.&lt;/p&gt;

&lt;p&gt;Then agree again.&lt;/p&gt;

&lt;p&gt;Then revisit a point from three rounds ago.&lt;/p&gt;

&lt;p&gt;LLMs don't naturally know when a conversation is finished.&lt;/p&gt;

&lt;p&gt;They need rules.&lt;/p&gt;

&lt;p&gt;That's exactly what LangGraph gave me.&lt;/p&gt;

&lt;p&gt;Instead of one long unpredictable conversation, I could define the negotiation as a graph.&lt;/p&gt;

&lt;p&gt;An agent speaks.&lt;/p&gt;

&lt;p&gt;The next agent responds.&lt;/p&gt;

&lt;p&gt;After everyone has spoken, another node checks whether they've reached consensus.&lt;/p&gt;

&lt;p&gt;If they have, great.&lt;/p&gt;

&lt;p&gt;Publish the plan.&lt;/p&gt;

&lt;p&gt;Finish.&lt;/p&gt;

&lt;p&gt;If not, start another round.&lt;/p&gt;

&lt;p&gt;If they've gone around in circles four times, stop the negotiation and ask the actual humans to decide.&lt;/p&gt;

&lt;p&gt;Without that hard stop, the app would have been one very expensive infinite conversation.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Decision That Changed Everything
&lt;/h1&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgsnnv8jlgna2i8saa85d.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgsnnv8jlgna2i8saa85d.png" alt="user flow " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One design choice completely changed how the app felt.&lt;/p&gt;

&lt;p&gt;Originally I wanted every agent to run in parallel.&lt;/p&gt;

&lt;p&gt;It sounded perfect.&lt;/p&gt;

&lt;p&gt;Everyone responds at the same time.&lt;/p&gt;

&lt;p&gt;Collect the responses.&lt;/p&gt;

&lt;p&gt;Done.&lt;/p&gt;

&lt;p&gt;Fast.&lt;/p&gt;

&lt;p&gt;Efficient.&lt;/p&gt;

&lt;p&gt;Then I realised something.&lt;/p&gt;

&lt;p&gt;If Agent Two starts thinking before Agent One finishes speaking, Agent Two never actually reacts to anything.&lt;/p&gt;

&lt;p&gt;The same goes for everyone else.&lt;/p&gt;

&lt;p&gt;What I built wasn't a negotiation.&lt;/p&gt;

&lt;p&gt;It was four independent opinions dumped into a chat window.&lt;/p&gt;

&lt;p&gt;It felt less like friends making plans and more like filling out a Google Form.&lt;/p&gt;

&lt;p&gt;Real conversations don't work like that.&lt;/p&gt;

&lt;p&gt;People react.&lt;/p&gt;

&lt;p&gt;They change their minds.&lt;/p&gt;

&lt;p&gt;They compromise.&lt;/p&gt;

&lt;p&gt;Sometimes they completely disagree.&lt;/p&gt;

&lt;p&gt;That only happens if everyone can hear what everyone else has already said.&lt;/p&gt;

&lt;p&gt;So I changed the graph.&lt;/p&gt;

&lt;p&gt;Every agent now runs one after another.&lt;/p&gt;

&lt;p&gt;Agent Two reads Agent One's response.&lt;/p&gt;

&lt;p&gt;Agent Three reads both.&lt;/p&gt;

&lt;p&gt;By the time the fourth person speaks, the conversation has actually evolved.&lt;/p&gt;

&lt;p&gt;Yes, it's slower.&lt;/p&gt;

&lt;p&gt;But the slowness is exactly what makes it feel real.&lt;/p&gt;

&lt;p&gt;Sometimes good software isn't about making something faster.&lt;/p&gt;

&lt;p&gt;It's about making it feel natural.&lt;/p&gt;

&lt;h1&gt;
  
  
  How Everything Actually Works
&lt;/h1&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fymikpmtgyt3ctn9jlyty.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fymikpmtgyt3ctn9jlyty.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is probably my favourite part of the project.&lt;/p&gt;

&lt;p&gt;Not because it's the most complicated.&lt;/p&gt;

&lt;p&gt;Because it's surprisingly simple once you see the pieces working together.&lt;/p&gt;

&lt;p&gt;The frontend never talks to the AI directly.&lt;/p&gt;

&lt;p&gt;The AI never talks back to the frontend.&lt;/p&gt;

&lt;p&gt;Everything happens through DynamoDB.&lt;/p&gt;

&lt;p&gt;Here's what happens when someone sends a message.&lt;/p&gt;

&lt;p&gt;The frontend writes the message into the &lt;code&gt;Messages&lt;/code&gt; table.&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;Its job is done.&lt;/p&gt;

&lt;p&gt;Now DynamoDB Streams notices that something new has been written.&lt;/p&gt;

&lt;p&gt;Think of Streams like a doorbell.&lt;/p&gt;

&lt;p&gt;Every time a new record appears, it rings automatically.&lt;/p&gt;

&lt;p&gt;That event wakes up an AWS Lambda function.&lt;/p&gt;

&lt;p&gt;Inside that Lambda is the entire LangGraph workflow.&lt;/p&gt;

&lt;p&gt;The function loads everyone's preferences, fetches memories, starts the negotiation, and lets each agent speak one after another.&lt;/p&gt;

&lt;p&gt;Every time an agent finishes its turn, Lambda immediately writes that response back into DynamoDB.&lt;/p&gt;

&lt;p&gt;It doesn't wait until the whole negotiation is finished.&lt;/p&gt;

&lt;p&gt;Each message appears as soon as it's generated.&lt;/p&gt;

&lt;p&gt;Back on the frontend there's a Server Sent Events connection quietly listening for anything new.&lt;/p&gt;

&lt;p&gt;The moment another message lands in DynamoDB, it's streamed straight into the chat.&lt;/p&gt;

&lt;p&gt;Watching the app feels surprisingly natural.&lt;/p&gt;

&lt;p&gt;One agent starts typing.&lt;/p&gt;

&lt;p&gt;A second later another replies.&lt;/p&gt;

&lt;p&gt;Then someone disagrees.&lt;/p&gt;

&lt;p&gt;Then another person suggests a compromise.&lt;/p&gt;

&lt;p&gt;It feels much closer to watching four friends text each other than watching an AI generate a giant wall of text.&lt;/p&gt;

&lt;p&gt;One thing I really liked about this architecture is that every component has exactly one responsibility.&lt;/p&gt;

&lt;p&gt;The frontend writes data.&lt;/p&gt;

&lt;p&gt;Lambda thinks.&lt;/p&gt;

&lt;p&gt;DynamoDB stores everything.&lt;/p&gt;

&lt;p&gt;That separation made debugging much easier because whenever something broke I already knew roughly where to start looking.&lt;/p&gt;




&lt;h1&gt;
  
  
  Giving Every Agent a Memory
&lt;/h1&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzcfvtxnoi0nn07ryuksj.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzcfvtxnoi0nn07ryuksj.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Making agents remember your favourite movie sounds impressive.&lt;/p&gt;

&lt;p&gt;Honestly, that's the easy part.&lt;/p&gt;

&lt;p&gt;The interesting challenge is deciding what they should remember.&lt;/p&gt;

&lt;p&gt;Pakt uses two different kinds of memory.&lt;/p&gt;

&lt;p&gt;The first is short term memory.&lt;/p&gt;

&lt;p&gt;This lives inside DynamoDB and only exists during an active negotiation.&lt;/p&gt;

&lt;p&gt;Things like which round we're on, what restaurants have already been suggested, whether someone has voted, whether consensus has been reached.&lt;/p&gt;

&lt;p&gt;Once the negotiation ends, that state disappears.&lt;/p&gt;

&lt;p&gt;The second is long term memory.&lt;/p&gt;

&lt;p&gt;That's stored in Amazon S3 Vectors.&lt;/p&gt;

&lt;p&gt;Whenever a plan is accepted or rejected, every user's agent writes a small memory about what happened.&lt;/p&gt;

&lt;p&gt;Maybe someone rejected a restaurant because parking was terrible.&lt;/p&gt;

&lt;p&gt;Maybe the group loved a particular theatre.&lt;/p&gt;

&lt;p&gt;Maybe everyone agreed never to suggest horror movies again.&lt;/p&gt;

&lt;p&gt;Those memories are embedded into vector storage and kept completely separate for each user.&lt;/p&gt;

&lt;p&gt;When a new conversation starts, the agent searches through those memories before it begins negotiating.&lt;/p&gt;

&lt;p&gt;The first time I saw this working properly genuinely caught me off guard.&lt;/p&gt;

&lt;p&gt;I started a completely new group.&lt;/p&gt;

&lt;p&gt;Nobody had mentioned restaurants yet.&lt;/p&gt;

&lt;p&gt;One of the agents immediately said something along the lines of,&lt;/p&gt;

&lt;p&gt;"We didn't really enjoy that restaurant last time. Maybe we should try somewhere else."&lt;/p&gt;

&lt;p&gt;That information came from a completely different conversation days earlier.&lt;/p&gt;

&lt;p&gt;Nobody told the model to mention it.&lt;/p&gt;

&lt;p&gt;It simply remembered.&lt;/p&gt;

&lt;p&gt;That was one of those moments where the project stopped feeling like a demo and started feeling like an actual product.&lt;/p&gt;




&lt;h1&gt;
  
  
  The Weirdest Bug I Ran Into
&lt;/h1&gt;

&lt;p&gt;Most bugs are predictable.&lt;/p&gt;

&lt;p&gt;This one wasn't.&lt;/p&gt;

&lt;p&gt;No matter what group I created, the agents somehow kept suggesting the exact same restaurant.&lt;/p&gt;

&lt;p&gt;Someone would reject it because it was too far away.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhiovewpjs4ids6ynb340.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhiovewpjs4ids6ynb340.png" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another negotiation round would begin.&lt;/p&gt;

&lt;p&gt;The same restaurant came back.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;And again.&lt;/p&gt;

&lt;p&gt;Then things got even stranger.&lt;/p&gt;

&lt;p&gt;My reviewer agent confidently explained that one of the restaurants was in Thrissur.&lt;/p&gt;

&lt;p&gt;The address wasn't in Thrissur.&lt;/p&gt;

&lt;p&gt;It was actually a mock address in Bangalore.&lt;/p&gt;

&lt;p&gt;The model wasn't reading location data.&lt;/p&gt;

&lt;p&gt;It was guessing based on the restaurant name.&lt;/p&gt;

&lt;p&gt;That sent me down a very long debugging session.&lt;/p&gt;

&lt;p&gt;Eventually I realised the problem wasn't the agent at all.&lt;/p&gt;

&lt;p&gt;It was my architecture.&lt;/p&gt;

&lt;p&gt;The venue search tool wasn't configured with a real Google Places API key yet.&lt;/p&gt;

&lt;p&gt;Every search quietly returned the exact same mock dataset regardless of what city anyone searched for.&lt;/p&gt;

&lt;p&gt;Every agent was independently calling the same tool.&lt;/p&gt;

&lt;p&gt;Every agent received the same fake data.&lt;/p&gt;

&lt;p&gt;And because there were no real addresses available, my reviewer agent had nothing concrete to compare.&lt;/p&gt;

&lt;p&gt;It had a venue name and a lot of confidence.&lt;/p&gt;

&lt;p&gt;That's a dangerous combination.&lt;/p&gt;

&lt;p&gt;The fix ended up changing the architecture quite a bit.&lt;/p&gt;

&lt;p&gt;Instead of letting every agent search for venues independently, I moved venue search into its own shared step inside the graph.&lt;/p&gt;

&lt;p&gt;Now venue search runs once per negotiation round.&lt;/p&gt;

&lt;p&gt;It performs a real search.&lt;/p&gt;

&lt;p&gt;The results are cached for that round.&lt;/p&gt;

&lt;p&gt;Any venue that was rejected gets filtered out before the next search.&lt;/p&gt;

&lt;p&gt;Every agent now negotiates using exactly the same list of real places.&lt;/p&gt;

&lt;p&gt;Nobody is guessing anymore.&lt;/p&gt;

&lt;p&gt;Even better, the reviewer agent now receives the actual address of the selected venue along with every group member's address.&lt;/p&gt;

&lt;p&gt;Checking whether somewhere is too far is no longer a guess.&lt;/p&gt;

&lt;p&gt;It's just distance calculations.&lt;/p&gt;

&lt;p&gt;That one bug completely changed how I thought about multi agent systems.&lt;/p&gt;

&lt;p&gt;Shared information beats independent guesses every single time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Guardrails Aren't Just About Safety
&lt;/h1&gt;

&lt;p&gt;Another lesson I learned was that guardrails save money just as much as they improve reliability.&lt;/p&gt;

&lt;p&gt;Originally every single message sent inside a group triggered a full negotiation.&lt;/p&gt;

&lt;p&gt;It didn't matter what the message said.&lt;/p&gt;

&lt;p&gt;Someone could paste a programming question.&lt;/p&gt;

&lt;p&gt;Ask for today's weather.&lt;/p&gt;

&lt;p&gt;Type complete nonsense.&lt;/p&gt;

&lt;p&gt;The app would still launch an entire LangGraph workflow.&lt;/p&gt;

&lt;p&gt;That meant multiple GPT 4o calls for absolutely no reason.&lt;/p&gt;

&lt;p&gt;The fix was surprisingly small.&lt;/p&gt;

&lt;p&gt;Before a message even gets written into DynamoDB, a tiny GPT 4o mini classifier checks whether it's actually related to planning.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5r81cz73bwtxf167e6q.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn5r81cz73bwtxf167e6q.png" alt=" " width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The prompt is tiny.&lt;/p&gt;

&lt;p&gt;The token limit is tiny.&lt;/p&gt;

&lt;p&gt;If the message isn't about planning, it never reaches Lambda.&lt;/p&gt;

&lt;p&gt;No negotiation.&lt;/p&gt;

&lt;p&gt;No unnecessary API calls.&lt;/p&gt;

&lt;p&gt;No wasted money.&lt;/p&gt;

&lt;p&gt;I also added another guardrail after integrating real venue search.&lt;/p&gt;

&lt;p&gt;Google Places isn't free.&lt;/p&gt;

&lt;p&gt;If something went wrong and negotiations kept restarting forever, the app could quietly burn through API credits.&lt;/p&gt;

&lt;p&gt;To avoid that, every search increments a shared counter stored in DynamoDB.&lt;/p&gt;

&lt;p&gt;Once the daily limit is reached, the app simply falls back to mock data instead of breaking completely.&lt;/p&gt;

&lt;p&gt;Hopefully nobody ever notices that fallback.&lt;/p&gt;

&lt;p&gt;But it means I don't wake up to an unexpectedly large bill either.&lt;/p&gt;




&lt;h1&gt;
  
  
  Teaching Humans How to Talk to Agents
&lt;/h1&gt;

&lt;p&gt;One thing became obvious during testing.&lt;/p&gt;

&lt;p&gt;Humans are terrible at giving useful information.&lt;/p&gt;

&lt;p&gt;Someone would create a group and type,&lt;/p&gt;

&lt;p&gt;"Let's do something this weekend."&lt;/p&gt;

&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;No date.&lt;/p&gt;

&lt;p&gt;No time.&lt;/p&gt;

&lt;p&gt;No area.&lt;/p&gt;

&lt;p&gt;No activity.&lt;/p&gt;

&lt;p&gt;No budget.&lt;/p&gt;

&lt;p&gt;The agents would spend the next few rounds asking questions instead of actually planning.&lt;/p&gt;

&lt;p&gt;Technically it worked.&lt;/p&gt;

&lt;p&gt;Practically it felt slow.&lt;/p&gt;

&lt;p&gt;So I added another small step before negotiations begin.&lt;/p&gt;

&lt;p&gt;The first message gets checked against a simple schema.&lt;/p&gt;

&lt;p&gt;Depending on the activity type, the app looks for things like the date, preferred time, search area, movie genre or cuisine.&lt;/p&gt;

&lt;p&gt;If enough information is missing, the chat doesn't even start negotiating.&lt;/p&gt;

&lt;p&gt;Instead it renders a small form directly inside the conversation asking only for the missing details.&lt;/p&gt;

&lt;p&gt;Once that's filled in, the agents finally have enough context to do something useful.&lt;/p&gt;

&lt;p&gt;I made a similar change during onboarding.&lt;/p&gt;

&lt;p&gt;Originally adding your home location was optional.&lt;/p&gt;

&lt;p&gt;Almost nobody filled it in.&lt;/p&gt;

&lt;p&gt;Which meant the distance calculations I had spent so much time building quietly stopped working for most users.&lt;/p&gt;

&lt;p&gt;Now it's required.&lt;/p&gt;

&lt;p&gt;Locality.&lt;/p&gt;

&lt;p&gt;District.&lt;/p&gt;

&lt;p&gt;State.&lt;/p&gt;

&lt;p&gt;Pincode.&lt;/p&gt;

&lt;p&gt;Everything gets geocoded into latitude and longitude during onboarding.&lt;/p&gt;

&lt;p&gt;From that point onwards, every venue recommendation actually considers how far everyone has to travel.&lt;/p&gt;

&lt;p&gt;That tiny onboarding change ended up making the recommendations feel dramatically smarter without changing the agents themselves.&lt;/p&gt;




&lt;h1&gt;
  
  
  Making Memory Visible
&lt;/h1&gt;

&lt;p&gt;I realised something after building long term memory.&lt;/p&gt;

&lt;p&gt;Users had no idea what their agent actually remembered.&lt;/p&gt;

&lt;p&gt;They just had to trust me.&lt;/p&gt;

&lt;p&gt;I didn't like that.&lt;/p&gt;

&lt;p&gt;So I added a Memory page to the dashboard.&lt;/p&gt;

&lt;p&gt;Every memory the agent stores is visible there.&lt;/p&gt;

&lt;p&gt;Users can browse through them, see why they were saved, and delete anything they don't want anymore.&lt;/p&gt;

&lt;p&gt;It doesn't make the AI smarter.&lt;/p&gt;

&lt;p&gt;It makes the product feel more trustworthy.&lt;/p&gt;

&lt;p&gt;I think that's just as important.&lt;/p&gt;

&lt;p&gt;People are much more comfortable with AI remembering things when they can actually see what those things are.&lt;/p&gt;

&lt;h1&gt;
  
  
  What Pakt Looks Like Today
&lt;/h1&gt;

&lt;p&gt;After weeks of building, rebuilding, debugging and questioning my own decisions, Pakt finally feels like a real product instead of a collection of AI experiments glued together.&lt;/p&gt;

&lt;p&gt;The experience is intentionally simple.&lt;/p&gt;

&lt;p&gt;You sign up once.&lt;/p&gt;

&lt;p&gt;Tell the app a little about yourself.&lt;/p&gt;

&lt;p&gt;Your favourite movies.&lt;/p&gt;

&lt;p&gt;Food preferences.&lt;/p&gt;

&lt;p&gt;Budget.&lt;/p&gt;

&lt;p&gt;Your general schedule.&lt;/p&gt;

&lt;p&gt;Where you live.&lt;/p&gt;

&lt;p&gt;That's all the setup you need.&lt;/p&gt;

&lt;p&gt;From there everything happens inside the group chat.&lt;/p&gt;

&lt;p&gt;Create a group.&lt;/p&gt;

&lt;p&gt;Invite your friends.&lt;/p&gt;

&lt;p&gt;The moment everyone joins, their agents get to work.&lt;/p&gt;

&lt;p&gt;Nobody has to tell the agents to start.&lt;/p&gt;

&lt;p&gt;Nobody has to type "any suggestions?"&lt;/p&gt;

&lt;p&gt;The conversation begins automatically.&lt;/p&gt;

&lt;p&gt;The agents discuss different options, recommend movies from TMDB, find restaurants using Google Places, remember what the group enjoyed before, and slowly work towards something everyone is happy with.&lt;/p&gt;

&lt;p&gt;Sometimes they agree almost immediately.&lt;/p&gt;

&lt;p&gt;Sometimes they don't.&lt;/p&gt;

&lt;p&gt;When there's a genuine split between two good options, Pakt creates a vote inside the chat.&lt;/p&gt;

&lt;p&gt;Real people vote.&lt;/p&gt;

&lt;p&gt;The agents take that result and continue negotiating from there.&lt;/p&gt;

&lt;p&gt;Humans stay in control.&lt;/p&gt;

&lt;p&gt;The agents just remove all the exhausting back and forth.&lt;/p&gt;

&lt;p&gt;And if someone suddenly joins the conversation halfway through and says,&lt;/p&gt;

&lt;p&gt;"I can't stay out too late tonight."&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;"I'm not really in the mood for pizza anymore."&lt;/p&gt;

&lt;p&gt;The agents immediately adjust the negotiation around that new information.&lt;/p&gt;

&lt;p&gt;Nothing has to restart.&lt;/p&gt;

&lt;p&gt;The conversation simply continues.&lt;/p&gt;

&lt;p&gt;Once everyone reaches an agreement, the chat ends with a plan card containing everything the group needs.&lt;/p&gt;

&lt;p&gt;The venue.&lt;/p&gt;

&lt;p&gt;The time.&lt;/p&gt;

&lt;p&gt;The people joining.&lt;/p&gt;

&lt;p&gt;And eventually, I want that card to include the actual booking as well.&lt;/p&gt;




&lt;h1&gt;
  
  
  A Few Small Things That Made a Big Difference
&lt;/h1&gt;

&lt;p&gt;Not every improvement involved complicated architecture.&lt;/p&gt;

&lt;p&gt;Some of my favourite fixes were tiny.&lt;/p&gt;

&lt;p&gt;One of the first things I noticed during demos was that GPT naturally writes Markdown.&lt;/p&gt;

&lt;p&gt;Lists.&lt;/p&gt;

&lt;p&gt;Bold text.&lt;/p&gt;

&lt;p&gt;Headers.&lt;/p&gt;

&lt;p&gt;The chat wasn't rendering any of it.&lt;/p&gt;

&lt;p&gt;Instead people saw a screen full of random asterisks.&lt;/p&gt;

&lt;p&gt;It looked broken.&lt;/p&gt;

&lt;p&gt;One Markdown renderer later, the entire conversation suddenly felt polished.&lt;/p&gt;

&lt;p&gt;Another surprisingly important improvement involved the demo accounts.&lt;/p&gt;

&lt;p&gt;Originally they all had empty profiles or random addresses.&lt;/p&gt;

&lt;p&gt;The agents would recommend places that made absolutely no sense because nobody actually lived anywhere.&lt;/p&gt;

&lt;p&gt;Before recording demos, I replaced those with real nearby locations.&lt;/p&gt;

&lt;p&gt;Suddenly the recommendations became believable.&lt;/p&gt;

&lt;p&gt;Sometimes the smallest details make the biggest difference when you're showing a product to someone for the first time.&lt;/p&gt;




&lt;h1&gt;
  
  
  Under the Hood
&lt;/h1&gt;

&lt;p&gt;The final architecture ended up being much bigger than I originally expected.&lt;/p&gt;

&lt;p&gt;There are six DynamoDB tables.&lt;/p&gt;

&lt;p&gt;Users.&lt;/p&gt;

&lt;p&gt;Groups.&lt;/p&gt;

&lt;p&gt;Messages.&lt;/p&gt;

&lt;p&gt;Negotiation state.&lt;/p&gt;

&lt;p&gt;Polls.&lt;/p&gt;

&lt;p&gt;And one extra table that exists for one reason only.&lt;/p&gt;

&lt;p&gt;Making sure usernames stay unique using transactional writes.&lt;/p&gt;

&lt;p&gt;The AI workflow runs inside AWS Lambda.&lt;/p&gt;

&lt;p&gt;Each execution gets a 300 second timeout, which is far more than a normal negotiation ever needs.&lt;/p&gt;

&lt;p&gt;To avoid cold starts during demos, EventBridge pings the function every few minutes.&lt;/p&gt;

&lt;p&gt;Nobody watching a live demo wants to wait while Lambda wakes up.&lt;/p&gt;

&lt;p&gt;Some engineering decisions exist purely because you've been embarrassed once.&lt;/p&gt;

&lt;p&gt;That was one of them.&lt;/p&gt;




&lt;h1&gt;
  
  
  What I Want To Build Next
&lt;/h1&gt;

&lt;p&gt;I think Pakt solves the hardest part of planning.&lt;/p&gt;

&lt;p&gt;Getting people to agree.&lt;/p&gt;

&lt;p&gt;But there's still one obvious gap.&lt;/p&gt;

&lt;p&gt;Right now the agents decide where everyone should go.&lt;/p&gt;

&lt;p&gt;The humans still have to book the movie tickets.&lt;/p&gt;

&lt;p&gt;Reserve the restaurant.&lt;/p&gt;

&lt;p&gt;Buy the event tickets.&lt;/p&gt;

&lt;p&gt;I want the conversation to end with the booking already completed.&lt;/p&gt;

&lt;p&gt;The agents shouldn't just recommend something.&lt;/p&gt;

&lt;p&gt;They should finish the job.&lt;/p&gt;

&lt;p&gt;The second thing I want to build is a proper mobile app.&lt;/p&gt;

&lt;p&gt;This problem lives on phones.&lt;/p&gt;

&lt;p&gt;Every group chat lives on phones.&lt;/p&gt;

&lt;p&gt;People aren't sitting at a laptop wondering what they're doing on Saturday night.&lt;/p&gt;

&lt;p&gt;They're checking WhatsApp while waiting for a bus or standing in a queue somewhere.&lt;/p&gt;

&lt;p&gt;The experience belongs on mobile.&lt;/p&gt;

&lt;p&gt;Longer term, movies and restaurants are just the beginning.&lt;/p&gt;

&lt;p&gt;Weekend trips.&lt;/p&gt;

&lt;p&gt;Concerts.&lt;/p&gt;

&lt;p&gt;Sports.&lt;/p&gt;

&lt;p&gt;Road trips.&lt;/p&gt;

&lt;p&gt;Coffee catch ups.&lt;/p&gt;

&lt;p&gt;Game nights.&lt;/p&gt;

&lt;p&gt;The negotiation engine doesn't really care what it's planning.&lt;/p&gt;

&lt;p&gt;It just needs different tools and different questions.&lt;/p&gt;

&lt;p&gt;That part is surprisingly scalable.&lt;/p&gt;




&lt;h1&gt;
  
  
  What This Project Actually Taught Me
&lt;/h1&gt;

&lt;p&gt;When I started building Pakt, I thought the hardest part would be getting the AI to make good decisions.&lt;/p&gt;

&lt;p&gt;It wasn't.&lt;/p&gt;

&lt;p&gt;The AI was probably the easiest part.&lt;/p&gt;

&lt;p&gt;The difficult part was everything around it.&lt;/p&gt;

&lt;p&gt;Designing the architecture.&lt;/p&gt;

&lt;p&gt;Making sure every agent had the same information.&lt;/p&gt;

&lt;p&gt;Knowing when a negotiation should stop.&lt;/p&gt;

&lt;p&gt;Making sure memory actually helped instead of confusing the conversation.&lt;/p&gt;

&lt;p&gt;Keeping costs under control.&lt;/p&gt;

&lt;p&gt;Building guardrails.&lt;/p&gt;

&lt;p&gt;Handling failures without breaking the experience.&lt;/p&gt;

&lt;p&gt;Those ended up being the real engineering problems.&lt;/p&gt;

&lt;p&gt;One lesson stood out more than anything else.&lt;/p&gt;

&lt;p&gt;I originally thought running every agent in parallel would make the app feel smarter.&lt;/p&gt;

&lt;p&gt;Instead it made the conversation feel fake.&lt;/p&gt;

&lt;p&gt;The moment I switched to sequential negotiation, everything changed.&lt;/p&gt;

&lt;p&gt;The agents actually started responding to each other.&lt;/p&gt;

&lt;p&gt;Compromises appeared naturally.&lt;/p&gt;

&lt;p&gt;Arguments felt believable.&lt;/p&gt;

&lt;p&gt;The conversation slowed down.&lt;/p&gt;

&lt;p&gt;Ironically, that slower experience felt much more human.&lt;/p&gt;

&lt;p&gt;Sometimes making software feel intelligent isn't about making it faster.&lt;/p&gt;

&lt;p&gt;It's about making it behave the way real people do.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Pakt started because my friends couldn't decide where to go on weekends.&lt;/p&gt;

&lt;p&gt;Somewhere along the way it turned into one of the most enjoyable projects I've ever built.&lt;/p&gt;

&lt;p&gt;Not because of the technologies.&lt;/p&gt;

&lt;p&gt;Not because of the hackathon.&lt;/p&gt;

&lt;p&gt;But because it kept forcing me to rethink how AI systems should actually work.&lt;/p&gt;

&lt;p&gt;I went into this project thinking I was building a chatbot.&lt;/p&gt;

&lt;p&gt;I came out of it thinking much more about orchestration, memory, shared context, architecture and trust than prompts or models.&lt;/p&gt;

&lt;p&gt;That's probably the biggest lesson I took away.&lt;/p&gt;

&lt;p&gt;If you're building multi agent applications, spend less time trying to make individual agents smarter.&lt;/p&gt;

&lt;p&gt;Spend more time thinking about the system they live inside.&lt;/p&gt;

&lt;p&gt;Shared context.&lt;/p&gt;

&lt;p&gt;Clear responsibilities.&lt;/p&gt;

&lt;p&gt;Good orchestration.&lt;/p&gt;

&lt;p&gt;Reliable memory.&lt;/p&gt;

&lt;p&gt;Those matter far more than another clever prompt.&lt;/p&gt;

&lt;p&gt;And if your group chat still spends three days deciding where to eat every weekend, hopefully Pakt can save you from reading another message that says,&lt;/p&gt;

&lt;p&gt;"So... are we doing anything or not?"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8yieqvgtdjk6u02mzd41.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8yieqvgtdjk6u02mzd41.png" alt=" " width="800" height="533"&gt;&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://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/JoelJaison394" rel="noopener noreferrer"&gt;
        JoelJaison394
      &lt;/a&gt; / &lt;a href="https://github.com/JoelJaison394/Pakt" rel="noopener noreferrer"&gt;
        Pakt
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      AI agents that negotiate your social plans, so you don't have to.
    &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;Pakt&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/JoelJaison394/Pakt/apps/web/public/CoverImage.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FJoelJaison394%2FPakt%2FHEAD%2Fapps%2Fweb%2Fpublic%2FCoverImage.png" alt="Pakt cover"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AI agents that negotiate your social plans, so you don't have to.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Each user has a personal AI agent that knows their tastes, schedule, and budget. When a group wants to plan a movie night or dinner, their agents negotiate with each other in a shared chat — proposing, compromising, polling, and converging on a single confirmed plan — with the real humans able to jump in and override at any point.&lt;/p&gt;
&lt;p&gt;Built for &lt;strong&gt;H0: Hack the Zero Stack&lt;/strong&gt; (AWS DynamoDB + Vercel + Next.js) — deadline &lt;strong&gt;30 June 2026&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;The Problem&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Planning leisure time with friends is broken — not because people don't want to hang out, but because of the coordination overhead:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;"Can we do Saturday?" starts a 40-message thread that takes 3 days to resolve.&lt;/li&gt;
&lt;li&gt;Everyone has different schedules, budgets, food preferences, and movie tastes.&lt;/li&gt;
&lt;li&gt;Someone always says "IDK, up to you" — decision paralysis…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/JoelJaison394/Pakt" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://pakts.vercel.app/story" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpakts.tech%2FCoverImage.png" height="427" class="m-0" width="800"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://pakts.vercel.app/story" rel="noopener noreferrer" class="c-link"&gt;
            Our Story · Pakt
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            How one chaotic group chat with zero plans turned into Pakt — AI agents that negotiate a real plan so your friends don't have to argue about it.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fpakts.vercel.app%2Ffavicon%2Ffavicon.ico" width="48" height="48"&gt;
          pakts.vercel.app
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


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

&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Built for the H0 Hack the Zero Stack Hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stack&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Vercel&lt;/li&gt;
&lt;li&gt;AWS Lambda&lt;/li&gt;
&lt;li&gt;Amazon DynamoDB&lt;/li&gt;
&lt;li&gt;DynamoDB Streams&lt;/li&gt;
&lt;li&gt;LangGraph&lt;/li&gt;
&lt;li&gt;OpenAI GPT 4o&lt;/li&gt;
&lt;li&gt;Amazon S3 Vectors&lt;/li&gt;
&lt;li&gt;TMDB API&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>h0hackathon</category>
      <category>hackathon</category>
    </item>
    <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>
  </channel>
</rss>
