<?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: Merajul Haque</title>
    <description>The latest articles on DEV Community by Merajul Haque (@haquedot).</description>
    <link>https://dev.to/haquedot</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%2F1968162%2Fdd8e16a5-892a-41e6-9b7f-125e139401fd.png</url>
      <title>DEV Community: Merajul Haque</title>
      <link>https://dev.to/haquedot</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/haquedot"/>
    <language>en</language>
    <item>
      <title>Learning to Build in the Age of AI</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Mon, 26 Oct 2026 19:31:54 +0000</pubDate>
      <link>https://dev.to/haquedot/learning-to-build-in-the-age-of-ai-3k9o</link>
      <guid>https://dev.to/haquedot/learning-to-build-in-the-age-of-ai-3k9o</guid>
      <description>&lt;h2&gt;
  
  
  AI can write the code. Can you explain it?
&lt;/h2&gt;

&lt;p&gt;Learning to code has become a lot easier in some ways.&lt;/p&gt;

&lt;p&gt;A few years ago, if you wanted to build something, you would probably spend hours reading documentation, searching Stack Overflow, watching tutorials, and trying to understand why your code wasn't working.&lt;/p&gt;

&lt;p&gt;Now, you can describe what you want to build to an AI assistant and get a working starting point in seconds. Need a React component? Done. Need help with a database query? Just ask. Stuck on an error you've never seen before? Paste it into the chat.&lt;/p&gt;

&lt;p&gt;I use these tools too, and they're genuinely useful. They help me move faster, explore unfamiliar technologies, and get past problems that might otherwise take hours to solve.&lt;/p&gt;

&lt;p&gt;But there's something I've been thinking about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When AI does more of the work for us, are we actually learning as much as we think we are?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's easy to finish a project with AI and feel like you've learned a lot. You have a working application, the UI looks good, and the code seems to make sense. But sometimes, that confidence disappears the moment something breaks and you have to figure out what's happening without simply asking AI for another fix.&lt;/p&gt;

&lt;p&gt;That's where the difference between writing code and understanding it starts to show.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with feeling productive
&lt;/h2&gt;

&lt;p&gt;Imagine you're learning React.&lt;/p&gt;

&lt;p&gt;You watch a tutorial, follow along, and build a small application. Everything works. You understand the explanation, recognize the code, and feel comfortable with the concepts.&lt;/p&gt;

&lt;p&gt;A few days later, you decide to build something similar on your own. Suddenly, you aren't sure how to structure the components, where the state should live, or why updating one value causes other parts of the interface to re-render.&lt;/p&gt;

&lt;p&gt;What happened? You understood the tutorial while watching it, but you hadn't necessarily learned how to make those decisions yourself.&lt;/p&gt;

&lt;p&gt;AI can make this even harder to notice.&lt;/p&gt;

&lt;p&gt;You can ask it to build the entire application, fix every error, and explain each step. The result might be impressive, even if you couldn't reproduce the important parts independently.&lt;/p&gt;

&lt;p&gt;There's nothing wrong with getting help. The problem is confusing a completed task with a skill you've developed.&lt;/p&gt;

&lt;p&gt;I've started to think about learning in terms of a simple question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If this code stopped working tomorrow, would I know where to start?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You don't need to remember every line of code or understand every implementation detail immediately. But you should gradually develop the ability to investigate a problem, form a hypothesis, and work towards a solution.&lt;/p&gt;

&lt;p&gt;That's a different kind of progress from simply shipping code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build something small enough to understand
&lt;/h2&gt;

&lt;p&gt;One thing that helps is choosing projects where you have to make decisions yourself.&lt;/p&gt;

&lt;p&gt;You don't need to build another massive SaaS application or spend months working on an ambitious idea. Start with something small that forces you to understand one concept properly.&lt;/p&gt;

&lt;p&gt;For example, if you're learning how APIs work, build a small application that fetches data, handles loading and error states, and deals with a failed request.&lt;/p&gt;

&lt;p&gt;If you're learning state management, create a task manager where changes need to stay consistent across different components.&lt;/p&gt;

&lt;p&gt;If you're exploring offline-first applications, try storing data locally and making sure it remains available after a page refresh or loss of internet connectivity.&lt;/p&gt;

&lt;p&gt;These projects become much more useful when something goes wrong.&lt;/p&gt;

&lt;p&gt;What happens if the request fails? What if the user clicks a button twice? What if the browser refreshes before the data is saved? What happens when two updates arrive in an unexpected order?&lt;/p&gt;

&lt;p&gt;You don't have to solve every possible edge case. The point is to encounter problems that require you to think beyond the happy path.&lt;/p&gt;

&lt;p&gt;This is also where reading documentation becomes more valuable. Instead of reading about a concept because you think you should, you're looking for an answer to a problem you've actually encountered.&lt;/p&gt;

&lt;p&gt;You're no longer just collecting information. You're using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use AI, but don't skip the thinking
&lt;/h2&gt;

&lt;p&gt;I don't think the answer is to stop using AI or to write every line of code manually.&lt;/p&gt;

&lt;p&gt;That would mean ignoring tools that can make development significantly more efficient.&lt;/p&gt;

&lt;p&gt;Instead, I think it's worth being more deliberate about when and how we use them.&lt;/p&gt;

&lt;p&gt;When I'm learning something unfamiliar, one approach is to spend a little time trying to solve the problem myself before asking AI for help.&lt;/p&gt;

&lt;p&gt;Even if my first attempt is wrong, I've had to think about the problem, make a decision, and discover where my understanding falls short.&lt;/p&gt;

&lt;p&gt;Then I can use AI to compare approaches, explain concepts I missed, or point out weaknesses in my solution.&lt;/p&gt;

&lt;p&gt;Here are a few ways to make that process more useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Try first, ask second.&lt;/strong&gt; Spend some time understanding the problem before requesting a complete implementation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask why, not just how.&lt;/strong&gt; If AI suggests a solution, ask why it works, what alternatives exist, and what trade-offs you're accepting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Predict before you run.&lt;/strong&gt; Before executing a piece of code, try to work out what it will do. Then compare your prediction with the actual result.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change something yourself.&lt;/strong&gt; Once the code works, modify it. Add a requirement, handle an edge case, or change the implementation. See whether you can adapt it without asking AI to rewrite everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Investigate errors instead of immediately replacing the code.&lt;/strong&gt; Read the error message, inspect the relevant code, and form a possible explanation before asking for help.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You won't need to follow this process for every task. If you're doing something routine that you already understand, letting AI handle more of the implementation makes perfect sense.&lt;/p&gt;

&lt;p&gt;The important distinction is whether you're using AI to save time on familiar work or to avoid learning something you actually need to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding code matters more than memorizing it
&lt;/h2&gt;

&lt;p&gt;There's another reason I don't think developers need to compete with AI at writing code.&lt;/p&gt;

&lt;p&gt;AI can already generate syntax, suggest common patterns, and produce implementations for many familiar problems. Trying to prove your value by typing faster or memorizing more syntax misses the point.&lt;/p&gt;

&lt;p&gt;What matters is knowing what to build, how the pieces fit together, and whether the result actually solves the problem.&lt;/p&gt;

&lt;p&gt;Consider a simple feature that fetches data from an API.&lt;/p&gt;

&lt;p&gt;Generating the request itself isn't particularly difficult. But a real application might also need to handle authentication, timeouts, retries, stale data, loading states, and unexpected responses.&lt;/p&gt;

&lt;p&gt;You need to decide which of these situations matter, how the application should respond, and what trade-offs are reasonable.&lt;/p&gt;

&lt;p&gt;AI can help with those decisions, too. But you still need enough understanding to evaluate its suggestions.&lt;/p&gt;

&lt;p&gt;For me, that's one of the most interesting parts of software development: going beyond making something work and figuring out how to make it work reliably.&lt;/p&gt;

&lt;p&gt;You don't need to become an expert in every part of the stack. You do need to understand the parts that your application depends on and know how to investigate the ones you don't understand yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn by building things that can break
&lt;/h2&gt;

&lt;p&gt;A useful exercise is to implement a small feature yourself before looking at an AI-generated solution.&lt;/p&gt;

&lt;p&gt;For example, imagine you're building an API request helper that retries a request when it fails.&lt;/p&gt;

&lt;p&gt;You might start with something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;fetchWithRetry&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&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;fn&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;gt;&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&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;retries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;delay&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;T&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&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;retries&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&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="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;error&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="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&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;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;delay&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="nf"&gt;fetchWithRetry&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;retries&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;delay&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first glance, the implementation looks straightforward. If the request fails, wait a little and try again, doubling the delay each time.&lt;/p&gt;

&lt;p&gt;But understanding it means asking a few more questions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does the retry count behave as expected?&lt;/li&gt;
&lt;li&gt;Should every error trigger a retry, or only certain errors?&lt;/li&gt;
&lt;li&gt;What happens if the server is unavailable for a long time?&lt;/li&gt;
&lt;li&gt;Should the function support cancellation?&lt;/li&gt;
&lt;li&gt;How would you test the delays without waiting several seconds?&lt;/li&gt;
&lt;li&gt;Could multiple failing requests create too much traffic?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The example isn't a complete production-ready retry system. It deliberately leaves room for questions.&lt;/p&gt;

&lt;p&gt;You can ask AI to explain the implementation or suggest improvements. But try answering some of these questions yourself first. You'll get much more out of the exercise than simply copying the code into a project.&lt;/p&gt;

&lt;p&gt;The same approach works for almost anything: a search feature, an authentication flow, a database query, or a background synchronization process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The goal isn't to write everything from scratch. It's to understand the decisions behind the code you're using.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  You don't have to learn everything at once
&lt;/h2&gt;

&lt;p&gt;It's easy to feel behind when new frameworks, models, and development tools keep appearing.&lt;/p&gt;

&lt;p&gt;You might start learning one technology and see someone online building an entire product with another. Before you've finished one project, there's already a new tool everyone seems to be talking about.&lt;/p&gt;

&lt;p&gt;I've found it useful to remember that exploring something new and actually learning it are two different things.&lt;/p&gt;

&lt;p&gt;You can experiment with lots of tools, but depth comes from spending enough time with a problem to understand it properly.&lt;/p&gt;

&lt;p&gt;Instead of starting a new project every few days, try taking one project a little further.&lt;/p&gt;

&lt;p&gt;Make the error handling better. Understand how the data flows through the application. Write a few tests. Improve the way it behaves when something goes wrong. Revisit an earlier decision and see whether you'd make the same choice today.&lt;/p&gt;

&lt;p&gt;You might learn more from improving a small application over several weeks than from building five similar applications that you never revisit.&lt;/p&gt;

&lt;p&gt;And you don't need to code every waking hour to make progress. Consistency matters, but so does having enough time to think about what you've learned.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, what does learning look like now?
&lt;/h2&gt;

&lt;p&gt;I don't think AI makes learning software development pointless. If anything, it changes what we need to pay attention to.&lt;/p&gt;

&lt;p&gt;We can spend less time struggling with repetitive syntax and more time exploring ideas, testing assumptions, and understanding how systems behave. But that only happens if we remain involved in the process.&lt;/p&gt;

&lt;p&gt;A working application is a good result. Being able to explain how it works, identify its weaknesses, and improve it is an even better one.&lt;/p&gt;

&lt;p&gt;The next time you use AI to build something, try going a little further than getting it to work. Ask yourself what you learned, what you still don't understand, and what would happen if you had to change the implementation tomorrow.&lt;/p&gt;

&lt;p&gt;You don't need to reject AI to become a better developer. You just need to make sure you're not handing over the part of the process that helps you grow.&lt;/p&gt;

&lt;p&gt;Because in the end, the goal isn't to prove that you can write code without assistance.&lt;/p&gt;

&lt;p&gt;It's to become someone who can take an idea, understand the problem, use the tools available, and figure out how to build something that works.&lt;/p&gt;

&lt;p&gt;And that's still worth learning.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>programming</category>
    </item>
    <item>
      <title>How We Became Google DeepMind Hackathon Special Winners With KMesh</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Thu, 22 Oct 2026 11:46:06 +0000</pubDate>
      <link>https://dev.to/haquedot/how-we-became-google-deepmind-hackathon-special-winners-with-kmesh-2lbc</link>
      <guid>https://dev.to/haquedot/how-we-became-google-deepmind-hackathon-special-winners-with-kmesh-2lbc</guid>
      <description>&lt;p&gt;My first physical hackathon turned out very differently from what I expected.&lt;/p&gt;

&lt;p&gt;Our project, &lt;strong&gt;KMesh: Local AI over Mesh Network for Disaster Management&lt;/strong&gt;, was announced as a &lt;strong&gt;Special Winner in the Best Use of Gemma 4 category&lt;/strong&gt; at the Google DeepMind Hyderabad Hackathon on Kaggle.&lt;/p&gt;

&lt;p&gt;The funny part is that we left the venue thinking we probably wouldn't make it into the top 10.&lt;/p&gt;

&lt;p&gt;Here's how it happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  I didn't even know I was going to a hackathon
&lt;/h2&gt;

&lt;p&gt;A couple of days before the Google DeepMind Hyderabad Hackathon, I wasn't planning to attend a hackathon at all.&lt;/p&gt;

&lt;p&gt;Then Huzefa bin Juned asked me to check my email. He had registered our team, and suddenly, I had a hackathon to prepare for.&lt;/p&gt;

&lt;p&gt;The funny part? We didn't know the theme of the hackathon yet.&lt;/p&gt;

&lt;p&gt;The night before the event, we had a team meeting to figure out what we might build. Osama bin Juned suggested that we should be ready to work on an Android app, so he asked us to set up Android Studio.&lt;/p&gt;

&lt;p&gt;I already had it installed, but I hadn't used it for quite some time.&lt;/p&gt;

&lt;p&gt;Since the event focused on Google's Gemini APIs, I made a basic Android app to test a live Gemini API connection. Nothing fancy, just enough to make sure I could get something running when the actual challenge arrived.&lt;/p&gt;

&lt;h2&gt;
  
  
  The morning started with an alarm that didn't ring
&lt;/h2&gt;

&lt;p&gt;On the day of the hackathon, I had to wake up early. My alarm didn't ring, but somehow I woke up anyway.&lt;/p&gt;

&lt;p&gt;We still reached the venue late. The initial activities had already happened, but we made it before the problem statements were revealed.&lt;/p&gt;

&lt;p&gt;Once the challenge was announced, we found our workspace and split up the problem statements among ourselves. Everyone spent around half an hour researching different options. Then we came back together to discuss what we had found.&lt;/p&gt;

&lt;p&gt;One idea stood out: Osama's idea around disaster management.&lt;/p&gt;

&lt;p&gt;It felt like a problem where technology could make a real difference, especially when people need help and the usual communication infrastructure might not be available.&lt;/p&gt;

&lt;p&gt;We agreed to work on it.&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%2F0eamo9luk3mk0bsfq6s4.jpg" 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%2F0eamo9luk3mk0bsfq6s4.jpg" alt=" " width="585" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The real project was the mobile app
&lt;/h2&gt;

&lt;p&gt;KMesh wasn't just a dashboard. &lt;strong&gt;The most important part of our project was the Android mobile app&lt;/strong&gt;, designed for citizens and responders during a disaster.&lt;/p&gt;

&lt;p&gt;Think about a flood or another emergency where internet connectivity is unavailable. Someone needs help, but they can't send a report to a central server.&lt;/p&gt;

&lt;p&gt;What if their phone could still save that report and pass it to nearby devices?&lt;/p&gt;

&lt;p&gt;That was the idea behind KMesh.&lt;/p&gt;

&lt;p&gt;A citizen could compose an SOS message on their phone. The app would save it locally first, so the report wouldn't depend on an immediate internet connection. Nearby phones could then pass messages along through a mesh-style relay system, helping information travel between citizens, relay devices, and responders.&lt;/p&gt;

&lt;p&gt;We also integrated &lt;strong&gt;Gemma 4 for on-device triage&lt;/strong&gt;, with the goal of identifying which people appeared to need help most urgently.&lt;/p&gt;

&lt;p&gt;During a disaster, responders may receive more requests than they can act on at once. We wanted to explore how local AI could help surface high-priority reports without always waiting for a server response.&lt;/p&gt;

&lt;p&gt;The dashboard helped us visualise the wider response workflow, but the core idea was the mobile app and the network connecting people in the field.&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%2F4z11pzrrhsi7np8mejgk.jpg" 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%2F4z11pzrrhsi7np8mejgk.jpg" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How the offline mesh flow worked
&lt;/h2&gt;

&lt;p&gt;The design aimed to keep reports moving even when internet connectivity was unavailable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Citizen phone
     |
     | Compose SOS
     v
Save locally using Room
     |
     v
Nearby Connections
(Bluetooth / Wi-Fi Direct)
     |
     v
Nearby relay phones
     |
     | Store, deduplicate and relay
     | Seen-set + TTL
     v
Responder device
     |
     v
On-device triage with Gemma 4
     |
     v
Internet becomes available
     |
     v
Central command + Gemini
     |
     v
Response relayed back through the mesh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There were a few important design choices behind this flow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Save first:&lt;/strong&gt; An SOS is stored on the device before attempting to send it, reducing the chance of losing a report when connectivity is poor.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Relay between nearby devices:&lt;/strong&gt; Phones can pass messages using Bluetooth or Wi-Fi Direct through Nearby Connections instead of requiring every citizen to reach a central server directly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avoid duplicate relays:&lt;/strong&gt; A seen-set and time-to-live (TTL) help prevent messages from circulating indefinitely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Triage on-device:&lt;/strong&gt; Gemma 4 can help assess incoming reports locally, so prioritisation doesn't always have to wait for a server round trip.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sync when possible:&lt;/strong&gt; When internet access returns, information can reach central command, where Gemini can support the broader workflow. Replies can then be relayed back through the mesh.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The intention was to make emergency communication more resilient, not to assume that every device would always have internet access.&lt;/p&gt;

&lt;h2&gt;
  
  
  The people behind KMesh
&lt;/h2&gt;

&lt;p&gt;A special thanks to &lt;strong&gt;Osama bin Juned&lt;/strong&gt;, who led our team and introduced the disaster management idea. It gave us a meaningful direction to work toward in a very limited amount of time.&lt;/p&gt;

&lt;p&gt;I worked on this with &lt;strong&gt;Osama bin Juned, Huzefa bin Juned, and Imran&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Huzefa was the reason I knew about the event in the first place, and I'm glad he reached out. We researched different problem statements, discussed the trade-offs, and worked together to turn the selected idea into a demonstration.&lt;/p&gt;

&lt;p&gt;And between the planning, coding, and discussions, there were the usual hackathon moments too: food breaks, coffee, and quick conversations about what to try next.&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%2Feldaxzyv56li0k1t9sf5.jpg" 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%2Feldaxzyv56li0k1t9sf5.jpg" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The judging round, and why we thought it was over
&lt;/h2&gt;

&lt;p&gt;When it was time for judging, a judge came to our workspace. Unfortunately, one of our team members wasn't there at that moment, so we went to the organisers and explained the situation.&lt;/p&gt;

&lt;p&gt;They assigned us another judge, who gave us just &lt;strong&gt;five minutes&lt;/strong&gt; to explain the project.&lt;/p&gt;

&lt;p&gt;Osama did most of the explaining, and we walked the judge through the idea and gave a demo.&lt;/p&gt;

&lt;p&gt;To be honest, the demo didn't go as well as we'd hoped.&lt;/p&gt;

&lt;p&gt;We left thinking we probably wouldn't make it into the top 10.&lt;/p&gt;

&lt;p&gt;And, as it turned out, we weren't in the top 10. We accepted that and headed back, talking more about how good the experience had been than about the result.&lt;/p&gt;

&lt;p&gt;It was our first physical hackathon, and we'd still learned a lot and given the project our best.&lt;/p&gt;

&lt;p&gt;Then, a few days later, something unexpected happened.&lt;/p&gt;

&lt;h2&gt;
  
  
  The message that made our day
&lt;/h2&gt;

&lt;p&gt;The Special Winner announcement came out on Kaggle.&lt;/p&gt;

&lt;p&gt;Once again, Huzefa was the one who spotted it and shared the news in our WhatsApp group.&lt;/p&gt;

&lt;p&gt;We were genuinely happy and proud. After leaving the venue thinking we'd probably missed out, finding out that KMesh had been recognised as a &lt;strong&gt;Special Winner in the Best Use of Gemma 4 category&lt;/strong&gt; felt amazing.&lt;/p&gt;

&lt;p&gt;It meant even more because this was our first hackathon.&lt;/p&gt;

&lt;p&gt;We knew the demo hadn't been perfect, but we'd put in the effort, worked together, and tried to solve a problem that mattered.&lt;/p&gt;

&lt;p&gt;That recognition reminded me that one imperfect presentation doesn't tell the whole story of the work behind a project.&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%2Fcawlni2287ow4suqcpfl.jpg" 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%2Fcawlni2287ow4suqcpfl.jpg" alt=" " width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;A few things stayed with me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Start with the problem.&lt;/strong&gt; The most useful part of our discussion was deciding which problem was worth solving, not which technology sounded exciting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prepare enough to move quickly.&lt;/strong&gt; Testing the Gemini API the night before gave me a small head start, even though we didn't know the final challenge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Design for real conditions.&lt;/strong&gt; In disaster response, connectivity may be unreliable and time matters. That changes how you think about saving, relaying, and prioritising information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep the scope practical.&lt;/strong&gt; A focused mobile app and a clear demonstration can communicate an idea better than a long list of features.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build with people who bring ideas.&lt;/strong&gt; Osama's direction and the team's discussions helped us turn a broad challenge into a project we could explain and demonstrate.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'm grateful to Google DeepMind, Kaggle, the organisers, and everyone who made the event possible. I'm especially grateful to Osama, Huzefa, and Imran for being part of this experience.&lt;/p&gt;

&lt;p&gt;This was my first physical hackathon, but hopefully not my last.&lt;/p&gt;

&lt;p&gt;I want to keep building software products that solve real-world problems, and KMesh was a meaningful step in that direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  Explore KMesh
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.kaggle.com/competitions/google-deep-mind-hyderabad-hackathon" rel="noopener noreferrer"&gt;Google DeepMind Hyderabad Hackathon on Kaggle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.kaggle.com/competitions/google-deep-mind-hyderabad-hackathon/writeups/kmesh-local-ai-over-mesh-network-for-disatser-man#3528671" rel="noopener noreferrer"&gt;KMesh project write-up&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.kaggle.com/competitions/google-deep-mind-hyderabad-hackathon/writeups?query=kmesh" rel="noopener noreferrer"&gt;Kaggle write-ups and winner announcements&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>hackathon</category>
      <category>ai</category>
      <category>android</category>
      <category>gemma</category>
    </item>
    <item>
      <title>10 Inspiring Software Engineer Portfolios (Including Mine!)</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Thu, 21 Aug 2025 18:47:46 +0000</pubDate>
      <link>https://dev.to/haquedot/10-inspiring-software-engineer-portfolios-including-mine-33h6</link>
      <guid>https://dev.to/haquedot/10-inspiring-software-engineer-portfolios-including-mine-33h6</guid>
      <description>&lt;p&gt;As developers, we spend so much time building products for others that we often forget to build something for ourselves — a &lt;strong&gt;personal portfolio&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A portfolio isn’t just a website.&lt;br&gt;
It’s your &lt;strong&gt;digital identity&lt;/strong&gt;, your &lt;strong&gt;resume&lt;/strong&gt;, and your &lt;strong&gt;playground&lt;/strong&gt; for experimenting with code.&lt;/p&gt;

&lt;p&gt;I recently built my own portfolio → &lt;a href="https://merajulhaque.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;merajulhaque.com&lt;/strong&gt;&lt;/a&gt; 🎉&lt;br&gt;
While working on it, I explored some truly inspiring software engineer portfolios. Here’s my list of &lt;strong&gt;10 best portfolio websites&lt;/strong&gt; you should definitely check out 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 1. &lt;a href="https://merajulhaque.com/" rel="noopener noreferrer"&gt;merajulhaque.com&lt;/a&gt; — Merajul Haque
&lt;/h2&gt;

&lt;p&gt;A clean, modern portfolio (mine!) showcasing frontend projects built with &lt;strong&gt;React.js, Next.js, and Tailwind CSS&lt;/strong&gt;. It’s responsive, minimal, and focuses on real-world work rather than flashy effects.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. &lt;a href="https://brittanychiang.com/" rel="noopener noreferrer"&gt;Brittany Chiang&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Probably the most shared developer portfolio out there. Sleek design, smooth animations, and an overall professional aesthetic that sets a standard.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. &lt;a href="https://cassidoo.co/" rel="noopener noreferrer"&gt;Cassidy Williams&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Cassidy’s portfolio is both fun and professional. It reflects her personality while showcasing talks, work, and projects in an engaging way.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. &lt;a href="https://lynnandtonic.com/" rel="noopener noreferrer"&gt;Lynn Fisher&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;An incredibly creative and playful portfolio. Lynn redesigns her website every year, making it a living experiment in web design and development.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. &lt;a href="https://ryanfitzgerald.ca/" rel="noopener noreferrer"&gt;Ryan Fitzgerald&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Minimalist and practical. Ryan integrates his GitHub projects seamlessly, making it a great portfolio for open-source contributors.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. &lt;a href="https://tobiasahlin.com/" rel="noopener noreferrer"&gt;Tobias Ahlin&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ex-Spotify &amp;amp; Minecraft designer/developer. Tobias demonstrates how &lt;strong&gt;design and engineering&lt;/strong&gt; can blend perfectly in a portfolio.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. &lt;a href="https://www.joshwcomeau.com/" rel="noopener noreferrer"&gt;Josh Comeau&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Interactive, playful, and packed with animations. Josh’s site is also a knowledge hub with interactive blog posts — highly inspirational.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. &lt;a href="https://manjunathbhat.com/" rel="noopener noreferrer"&gt;Manjunath Bhat&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A modern portfolio with a focus on &lt;strong&gt;full-stack projects&lt;/strong&gt; and &lt;strong&gt;developer blogs&lt;/strong&gt;. Simple, functional, and well-structured.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. &lt;a href="https://www.swyx.io/" rel="noopener noreferrer"&gt;Shawn Wang (Swyx)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A portfolio that goes beyond projects. Swyx balances &lt;strong&gt;technical work, writing, and developer advocacy&lt;/strong&gt;, making it ideal for devs who write and speak as much as they code.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. &lt;a href="https://www.adhamdannaway.com/" rel="noopener noreferrer"&gt;Adham Dannaway&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The legendary &lt;strong&gt;split-screen design&lt;/strong&gt;: half designer, half developer. A true classic and a reminder that you can be both.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Key Takeaways for Your Own Portfolio
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keep it clean&lt;/strong&gt; → Don’t overwhelm with too much text or effects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show personality&lt;/strong&gt; → Add a touch of &lt;em&gt;you&lt;/em&gt;, not just code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Highlight projects&lt;/strong&gt; → Real-world apps and contributions &amp;gt; buzzwords.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Experiment&lt;/strong&gt; → Try animations, dark mode, or unique layouts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stay updated&lt;/strong&gt; → Outdated portfolios give the wrong impression.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;👉 These portfolios inspired me to continuously improve my own site &lt;a href="https://haque.tech/" rel="noopener noreferrer"&gt;&lt;strong&gt;haque.tech&lt;/strong&gt;&lt;/a&gt;.&lt;br&gt;
Now I’d love to see yours — &lt;strong&gt;drop your portfolio link in the comments&lt;/strong&gt; and let’s get inspired together! 🚀&lt;/p&gt;




&lt;p&gt;&lt;code&gt;#portfolio&lt;/code&gt; &lt;code&gt;#softwareengineer&lt;/code&gt; &lt;code&gt;#frontend&lt;/code&gt; &lt;code&gt;#react&lt;/code&gt; &lt;code&gt;#nextjs&lt;/code&gt; &lt;code&gt;#tailwindcss&lt;/code&gt; &lt;code&gt;#webdev&lt;/code&gt; &lt;code&gt;#career&lt;/code&gt;&lt;/p&gt;




</description>
      <category>portfolio</category>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>ai</category>
    </item>
    <item>
      <title>Role-Based Authentication in Node.js with Express.js and MongoDB</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Sat, 15 Mar 2025 19:14:34 +0000</pubDate>
      <link>https://dev.to/haquedot/role-based-authentication-in-nodejs-with-expressjs-and-mongodb-33mb</link>
      <guid>https://dev.to/haquedot/role-based-authentication-in-nodejs-with-expressjs-and-mongodb-33mb</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Role-Based Authentication (RBA) is a method to control access based on user roles (e.g., Admin, User, Manager). This tutorial will guide you through implementing RBA in a Node.js application using Express.js and MongoDB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we start, ensure you have the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js installed on your system&lt;/li&gt;
&lt;li&gt;MongoDB set up and running&lt;/li&gt;
&lt;li&gt;Basic knowledge of Express.js and JWT (JSON Web Tokens)&lt;/li&gt;
&lt;li&gt;A tool like Postman or cURL for API testing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Steps to Implement Role-Based Authentication&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Initialize the Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, create a new project folder and initialize a Node.js project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir role-based-auth
cd role-based-auth
npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates a &lt;code&gt;package.json&lt;/code&gt; file for managing dependencies.&lt;/p&gt;

&lt;p&gt;Now, install the required packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install express mongoose bcryptjs jsonwebtoken dotenv cors express-rate-limit https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;express&lt;/code&gt;: Web framework for Node.js&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mongoose&lt;/code&gt;: ODM (Object Data Modeling) library for MongoDB&lt;/p&gt;

&lt;p&gt;&lt;code&gt;bcryptjs&lt;/code&gt;: For hashing passwords securely&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jsonwebtoken&lt;/code&gt;: To generate and verify authentication tokens&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dotenv&lt;/code&gt;: For managing environment variables&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cors&lt;/code&gt;: To enable Cross-Origin Resource Sharing&lt;/p&gt;

&lt;p&gt;&lt;code&gt;express-rate-limit&lt;/code&gt;: To prevent API abuse&lt;/p&gt;

&lt;p&gt;&lt;code&gt;https&lt;/code&gt;: For secure HTTPS implementation&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Set Up the Server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;server.js&lt;/code&gt; and configure the Express server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require('dotenv').config();
const express = require('express');
const mongoose = require('mongoose');
const fs = require('fs');
const https = require('https');
const rateLimit = require('express-rate-limit');
const authRoutes = require('./routes/authRoutes');
const protectedRoutes = require('./routes/protectedRoutes');

const app = express();
app.use(express.json());
app.use('/api/auth', authRoutes);
app.use('/api/protected', protectedRoutes);

// Rate Limiting
const limiter = rateLimit({
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 100, // Limit each IP to 100 requests per window
  message: 'Too many requests, please try again later.'
});
app.use(limiter);

mongoose.connect(process.env.MONGO_URI, {
  useNewUrlParser: true,
  useUnifiedTopology: true,
}).then(() =&amp;gt; console.log("MongoDB Connected"))
  .catch(err =&amp;gt; console.error(err));

const httpsOptions = {
  key: fs.readFileSync('./key.pem'),
  cert: fs.readFileSync('./cert.pem')
};

https.createServer(httpsOptions, app).listen(5000, () =&amp;gt; console.log('Server running on port 5000 (HTTPS)'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Implement Refresh Tokens&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modify &lt;code&gt;routes/authRoutes.js&lt;/code&gt; to include refresh tokens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const jwt = require('jsonwebtoken');
const refreshTokens = [];

// Generate Access Token
const generateAccessToken = (user) =&amp;gt; {
  return jwt.sign({ id: user._id, role: user.role }, process.env.JWT_SECRET, { expiresIn: '15m' });
};

// Generate Refresh Token
const generateRefreshToken = (user) =&amp;gt; {
  const refreshToken = jwt.sign({ id: user._id }, process.env.REFRESH_SECRET);
  refreshTokens.push(refreshToken);
  return refreshToken;
};

// Refresh Token Route
router.post('/refresh', (req, res) =&amp;gt; {
  const { token } = req.body;
  if (!token || !refreshTokens.includes(token)) {
    return res.status(403).json({ message: 'Access denied' });
  }
  jwt.verify(token, process.env.REFRESH_SECRET, (err, user) =&amp;gt; {
    if (err) return res.status(403).json({ message: 'Invalid refresh token' });
    const accessToken = generateAccessToken(user);
    res.json({ accessToken });
  });
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Implement Role Management&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modify &lt;code&gt;routes/authRoutes.js&lt;/code&gt; to allow admin to change user roles:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { authenticate, authorize } = require('../middleware/authMiddleware');

// Change User Role (Admin Only)
router.put('/change-role/:id', authenticate, authorize(['admin']), async (req, res) =&amp;gt; {
  try {
    const { role } = req.body;
    const user = await User.findByIdAndUpdate(req.params.id, { role }, { new: true });
    res.json({ message: 'User role updated', user });
  } catch (err) {
    res.status(500).json({ error: 'Server error' });
  }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Secure the API with HTTPS &amp;amp; Rate Limiting&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTPS: Uses SSL/TLS encryption&lt;/li&gt;
&lt;li&gt;Rate Limiting: Limits requests per IP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. Test the API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Start the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use Postman or cURL to test:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register a user: POST /api/auth/register&lt;/li&gt;
&lt;li&gt;Login to receive a token: POST /api/auth/login&lt;/li&gt;
&lt;li&gt;Get a new access token: POST /api/auth/refresh&lt;/li&gt;
&lt;li&gt;Change user role (Admin only): PUT /api/auth/change-role/:id&lt;/li&gt;
&lt;li&gt;Access protected routes:&lt;/li&gt;
&lt;li&gt;GET /api/protected/admin (Admin only)&lt;/li&gt;
&lt;li&gt;GET /api/protected/user (User and Admin)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You have successfully implemented Role-Based Authentication in Node.js Express with MongoDB.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;br&gt;
✔ Refresh tokens for session management&lt;br&gt;
✔ Dynamic role management&lt;br&gt;
✔ API security with HTTPS &amp;amp; rate limiting&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>java</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Day 6: Handling Events in React</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Sat, 07 Sep 2024 18:08:55 +0000</pubDate>
      <link>https://dev.to/haquedot/day-6-handling-events-in-react-1fik</link>
      <guid>https://dev.to/haquedot/day-6-handling-events-in-react-1fik</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to Day 6 of our "30 Days of ReactJS" series! Today, we’re diving into Handling Events in React. Understanding event handling is crucial for creating interactive and user-friendly applications.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Event Handling?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Event handling in React allows you to respond to user actions such as clicks, form submissions, or keyboard inputs. In React, events are handled in a way that is similar to how you would handle them in plain HTML/JavaScript, but with some key differences that fit within React’s declarative model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Event Handling Basics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React, event handlers are passed as props to React elements. Unlike plain HTML, React event handlers use camelCase syntax instead of lowercase. For example, &lt;code&gt;onClick&lt;/code&gt; instead of &lt;code&gt;onclick&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Basic Button Click Handler&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

function ClickButton() {
  const handleClick = () =&amp;gt; {
    alert('Button was clicked!');
  };

  return (
    &amp;lt;button onClick={handleClick}&amp;gt;
      Click Me
    &amp;lt;/button&amp;gt;
  );
}

export default ClickButton;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;handleClick&lt;/code&gt; function is executed when the button is clicked, displaying an alert.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: ATM Machine&lt;br&gt;
Imagine an ATM machine where you enter your PIN and select an amount to withdraw. Each button press (like entering a digit or selecting the withdrawal amount) triggers an event. In React, you handle these interactions using event handlers.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event Objects&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React event handlers receive an event object as an argument. This object contains information about the event, such as the target element and the type of event.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Handling Input Change&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useState } from 'react';

function InputForm() {
  const [value, setValue] = useState('');

  const handleChange = (event) =&amp;gt; {
    setValue(event.target.value);
  };

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;input type="text" value={value} onChange={handleChange} /&amp;gt;
      &amp;lt;p&amp;gt;You typed: {value}&amp;lt;/p&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default InputForm;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the handleChange function updates the state with the input value, allowing you to see what is typed in real-time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Binding Event Handlers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In class components, you often need to bind event handlers to the component instance. This is not necessary in functional components with hooks, as functions are automatically bound.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: Binding in Class Components&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class MyComponent extends React.Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }

  handleClick() {
    console.log('Button clicked');
  }

  render() {
    return (
      &amp;lt;button onClick={this.handleClick}&amp;gt;
        Click Me
      &amp;lt;/button&amp;gt;
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Binding ensures that &lt;code&gt;this&lt;/code&gt; refers to the component instance inside the event handler.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Event Handling with Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With Vite as your development tool, handling events remains straightforward. Vite’s fast refresh helps you see changes immediately, making it easier to test and debug your event handlers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrapping Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Handling events is a fundamental aspect of React that allows your application to respond to user interactions. By attaching event handlers to elements, you can make your app dynamic and interactive.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tomorrow, we’ll build upon this by exploring Building Your First ReactJS App, where you’ll see how event handling integrates into a complete application.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>eventhandling</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Day 5: State and Lifecycle Methods - ReactJS</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Sun, 01 Sep 2024 18:04:44 +0000</pubDate>
      <link>https://dev.to/haquedot/day-5-state-and-lifecycle-methods-reactjs-432n</link>
      <guid>https://dev.to/haquedot/day-5-state-and-lifecycle-methods-reactjs-432n</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to Day 5 of the "30 Days of ReactJS" challenge! Today, we’re going to explore two fundamental concepts in React: State and Lifecycle Methods. Understanding these will empower you to create dynamic, interactive applications.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is State?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State&lt;/strong&gt; in React refers to a built-in object that holds information that may change over the lifetime of a component. Unlike props, which are read-only and passed down from a parent component, state is local to the component and can be modified internally.&lt;/p&gt;

&lt;p&gt;Think of state like a chalkboard. You can write and erase information on it as needed, allowing your component to adapt to changes, such as user input or data fetching.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: A Counter Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's create a simple counter component that increases its count when a button is clicked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { useState } from 'react';

function Counter() {
  const [count, setCount] = useState(0);

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;You clicked {count} times&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={() =&amp;gt; setCount(count + 1)}&amp;gt;
        Click me
      &amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;useState&lt;/code&gt; is a React hook that allows you to add state to a functional component. The &lt;code&gt;count&lt;/code&gt; variable holds the current state, and &lt;code&gt;setCount&lt;/code&gt; is the function to update it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Are Lifecycle Methods?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lifecycle methods&lt;/strong&gt; are special methods in React class components that allow you to run code at specific points in a component's lifecycle. This lifecycle includes mounting (adding to the DOM), updating (re-rendering), and unmounting (removal from the DOM).&lt;/p&gt;

&lt;p&gt;Although class components are becoming less common with the introduction of React hooks, understanding lifecycle methods is still important, especially when working with older codebases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: &lt;code&gt;componentDidMount&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A common lifecycle method is &lt;code&gt;componentDidMount&lt;/code&gt;, which runs after the component is first rendered. It's often used for initializing data, such as fetching data from an API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class DataFetcher extends React.Component {
  state = { data: null };

  componentDidMount() {
    fetch('https://api.example.com/data')
      .then(response =&amp;gt; response.json())
      .then(data =&amp;gt; this.setState({ data }));
  }

  render() {
    return (
      &amp;lt;div&amp;gt;
        {this.state.data ? (
          &amp;lt;p&amp;gt;Data: {this.state.data}&amp;lt;/p&amp;gt;
        ) : (
          &amp;lt;p&amp;gt;Loading...&amp;lt;/p&amp;gt;
        )}
      &amp;lt;/div&amp;gt;
    );
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, &lt;code&gt;componentDidMount&lt;/code&gt; fetches data as soon as the component is added to the DOM, and the state is updated with the fetched data.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: A Restaurant Order&lt;br&gt;
Imagine placing an order at a restaurant (component mounting). The kitchen starts preparing your food after you place the order (componentDidMount). As the food is being prepared (updating), you might get status updates. Finally, the food is served and you finish your meal (component unmounting).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;State and Lifecycle with Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since we’re using Vite for our development environment, setting up state and lifecycle methods is seamless. Vite’s fast development server ensures that your state changes and lifecycle methods are reflected almost instantly during development.&lt;/p&gt;

&lt;p&gt;Here’s how you can structure your project to include state and lifecycle methods:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Initialize State:&lt;/strong&gt; Use &lt;code&gt;useState&lt;/code&gt; in your functional components to manage dynamic data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Class Components for Lifecycle:&lt;/strong&gt; If you’re using class components, implement lifecycle methods like &lt;code&gt;componentDidMount&lt;/code&gt; and &lt;code&gt;componentWillUnmount&lt;/code&gt; to manage side effects.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Wrapping Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;State and lifecycle methods are crucial for creating dynamic, responsive React applications. State allows your components to be interactive, while lifecycle methods give you control over how and when your components interact with the DOM.&lt;/p&gt;

&lt;p&gt;Tomorrow, we’ll explore Handling Events in React, which will further enhance the interactivity of your applications.&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>statemanagement</category>
    </item>
    <item>
      <title>Day 4: Components and Props - ReactJS</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Sat, 31 Aug 2024 15:13:11 +0000</pubDate>
      <link>https://dev.to/haquedot/day-4-components-and-props-reactjs-5e8f</link>
      <guid>https://dev.to/haquedot/day-4-components-and-props-reactjs-5e8f</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to Day 4 of the "30 Days of ReactJS" challenge! Today, we’re going to explore &lt;strong&gt;Components and Props&lt;/strong&gt;—the building blocks of any React application. Understanding these concepts will allow you to break down your UI into reusable, independent pieces.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Are Components?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Components in React are like the ingredients in a recipe. Just as you combine different ingredients to create a dish, you combine components to build a React application. A component is a JavaScript function or class that optionally accepts inputs (known as props) and returns a React element that describes what should appear on the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;There are two main types of components in React:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functional Components:&lt;/strong&gt; These are JavaScript functions that return JSX. They’re simpler and easier to read.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class Components:&lt;/strong&gt; These are ES6 classes that extend from React.Component. They have more features like state and lifecycle methods but are less common in modern React development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example: A Button Component&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s create a simple button component:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Button() {
  return (
    &amp;lt;button&amp;gt;Click me!&amp;lt;/button&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This Button component is a functional component that returns a button element with the text "Click me!".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Components Matter&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Components allow you to break down your UI into smaller, manageable pieces. This makes your code more organized and easier to maintain. Imagine trying to cook a complex dish without breaking it down into steps. It would be chaotic! Similarly, building a UI without components can become overwhelming.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Lego Blocks&lt;br&gt;
Think of components like Lego blocks. Each block (component) is a piece of your application, and you can combine them to create something larger. Just like Lego blocks, components can be reused in different parts of your application.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Are Props?&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Props&lt;/strong&gt; (short for "properties") are the way you pass data from one component to another. They are similar to function arguments and can be used to customize a component.&lt;/p&gt;

&lt;p&gt;For example, let’s say we want to create a &lt;code&gt;Button&lt;/code&gt; component that can display different text based on the props it receives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Button(props) {
  return (
    &amp;lt;button&amp;gt;{props.label}&amp;lt;/button&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, when you use the &lt;code&gt;Button&lt;/code&gt; component, you can pass in a &lt;code&gt;label&lt;/code&gt; prop to customize its text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function App() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;Button label="Submit" /&amp;gt;
      &amp;lt;Button label="Cancel" /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the &lt;code&gt;Button&lt;/code&gt; component is used twice, but with different labels: "Submit" and "Cancel".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Importance of Props&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Props make your components more flexible and reusable. Instead of hardcoding values inside your components, you can pass in dynamic data through props, allowing you to use the same component in different contexts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up Components and Props with Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since we’re using Vite for our development environment, setting up components and props is straightforward. If you’ve been following along, your Vite project is already configured. You can start creating components in separate files and import them into your main application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s how you can structure your project:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a New Component:&lt;/strong&gt; Create a new file, Button.jsx, in your src folder and define your Button component there.&lt;br&gt;
&lt;strong&gt;2. Use the Component in Your App:&lt;/strong&gt; In your App.jsx file, import the Button component and use it with different props.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Putting It All Together&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Components and props are at the heart of React’s component-based architecture. By breaking down your UI into smaller components and passing data between them using props, you can build scalable and maintainable applications.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tomorrow, we’ll dive into State and Lifecycle Methods, which will allow your components to manage dynamic data and respond to changes over time.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/haquedot/day-5-state-and-lifecycle-methods-reactjs-432n"&gt;Day 5: State and Lifecycle Methods&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Day 3: Understanding JSX and Rendering Elements - ReactJS</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Fri, 30 Aug 2024 06:44:41 +0000</pubDate>
      <link>https://dev.to/haquedot/day-3-understanding-jsx-and-rendering-elements-reactjs-pf9</link>
      <guid>https://dev.to/haquedot/day-3-understanding-jsx-and-rendering-elements-reactjs-pf9</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to Day 3 of the "30 Days of ReactJS" challenge! Today, we’ll dive into one of the core concepts of React: JSX. By the end of this post, you’ll have a solid understanding of JSX and how React uses it to render elements on the web page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is JSX?&lt;/strong&gt;&lt;br&gt;
JSX stands for JavaScript XML. It’s a syntax extension for JavaScript that allows you to write HTML-like code within your JavaScript files. JSX makes it easier to create and visualize the UI components directly in your code, blending the logic and structure of your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How JSX Works&lt;/strong&gt;&lt;br&gt;
When you write JSX, you’re writing a mix of HTML and JavaScript. React takes this and transforms it into standard JavaScript objects that represent your UI.&lt;/p&gt;

&lt;p&gt;Here’s a basic example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = &amp;lt;h1&amp;gt;Hello, world!&amp;lt;/h1&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line of code creates a React element that represents an &lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; tag with the text “Hello, world!”.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSX is Not HTML&lt;/strong&gt;&lt;br&gt;
Even though JSX looks a lot like HTML, it’s important to remember that it’s not exactly the same. JSX is a syntactic sugar that React uses to create elements.&lt;/p&gt;

&lt;p&gt;For example, in HTML, attributes like &lt;code&gt;class&lt;/code&gt; are used to apply CSS classes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1 class="header"&amp;gt;Hello, world!&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But in JSX, you need to use className instead of class, because &lt;code&gt;class&lt;/code&gt; is a reserved keyword in &lt;code&gt;JavaScript&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const element = &amp;lt;h1 className="header"&amp;gt;Hello, world!&amp;lt;/h1&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Embedding Expressions in JSX&lt;/strong&gt;&lt;br&gt;
One of the powerful features of JSX is that you can embed JavaScript expressions directly within it. This allows you to dynamically generate content based on your app’s logic.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = 'Meraj';
const element = &amp;lt;h1&amp;gt;Hello, {name}!&amp;lt;/h1&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;{name}&lt;/code&gt; is a JavaScript expression that will be evaluated and replaced with the value of the &lt;code&gt;name&lt;/code&gt; variable, rendering as “Hello, Meraj!” on the screen.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rendering Elements in React&lt;/strong&gt;&lt;br&gt;
In React, rendering elements is the process of displaying content on the page. React elements are the building blocks of your app’s UI.&lt;/p&gt;

&lt;p&gt;To render an element, you use the &lt;code&gt;ReactDOM.render()&lt;/code&gt; method. This method takes two arguments:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The React element you want to render.&lt;/li&gt;
&lt;li&gt;The DOM element where you want to render it.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Here’s how you would render the "Hello, world!" example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';
import ReactDOM from 'react-dom/client';

const element = &amp;lt;h1&amp;gt;Hello, world!&amp;lt;/h1&amp;gt;;
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(element);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code tells React to render the &lt;code&gt;element&lt;/code&gt; inside the HTML element with the &lt;code&gt;id&lt;/code&gt; of &lt;code&gt;root&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Power of React's Virtual DOM&lt;/strong&gt;&lt;br&gt;
React uses a virtual DOM to efficiently manage changes to the UI. When you update an element, React compares the new version with the previous one and only updates the parts of the actual DOM that have changed. This approach makes React fast and efficient.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: A Shopping List&lt;br&gt;
Think of a shopping list on a whiteboard. If you need to change one item, you don’t erase the entire list and rewrite it. You just update the specific item that changed. React’s virtual DOM works similarly, updating only the parts that need to be changed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use JSX?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Readable Code:&lt;/strong&gt; JSX allows you to write your components in a way that’s easy to read and understand. You can see the structure of your UI directly in your code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Less Code:&lt;/strong&gt; With JSX, you can write less code compared to using React.createElement() to create elements manually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration with JavaScript:&lt;/strong&gt; Since JSX is a syntactic extension of JavaScript, you can embed logic directly within your UI code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Setting Up JSX with Vite&lt;/strong&gt;&lt;br&gt;
Since we’re using Vite for development, the good news is that Vite comes pre-configured to support JSX out of the box. This means you can start writing JSX immediately without any additional setup.&lt;/p&gt;

&lt;p&gt;If you’ve followed the steps from Day 2, your Vite project is already set up. You can start creating components with JSX and see them rendered instantly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
JSX is a powerful tool that bridges the gap between HTML and JavaScript, making it easier to build dynamic and interactive UIs with React. Understanding how JSX works and how React uses it to render elements will set a strong foundation for your React development journey.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tomorrow, we’ll dive into Components and Props—the core building blocks of any React application.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/haquedot/day-4-components-and-props-reactjs-5e8f"&gt;Day 4: Components and Props&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>jsx</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Day 2: Setting Up Your Development Environment - ReactJS</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Thu, 29 Aug 2024 06:34:11 +0000</pubDate>
      <link>https://dev.to/haquedot/day-2-setting-up-your-development-environment-1l0e</link>
      <guid>https://dev.to/haquedot/day-2-setting-up-your-development-environment-1l0e</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to Day 2 of the "30 Days of ReactJS" challenge! Today, we'll set up your development environment to start building React applications. The tools we choose today will make your development process smoother and more efficient.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Setting Up the Right Environment Matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before diving into code, it's essential to have a properly configured environment. Imagine you're about to bake a cake. Before you start mixing ingredients, you'd want to ensure you have all the right tools: a mixing bowl, a whisk, an oven preheated to the right temperature, etc. Similarly, in web development, setting up the right tools from the beginning will save you time and headaches later.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Vite?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For our development environment, we'll use Vite. Vite (pronounced "veet") is a fast and modern build tool that offers an excellent development experience for ReactJS. It’s known for its speed and simplicity, making it perfect for both beginners and seasoned developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Guide to Setting Up Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s go through the steps to set up your ReactJS development environment using Vite.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install Node.js and npm&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, ensure that you have Node.js installed on your computer. Node.js is a JavaScript runtime that allows you to run JavaScript code outside of a browser. Along with Node.js, you'll also get npm (Node Package Manager), which we'll use to manage our project dependencies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check if Node.js is installed:&lt;/strong&gt; Open your terminal (Command Prompt, PowerShell, or Terminal on macOS/Linux) and type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Node.js is installed, you’ll see the version number. If not, you can download it from &lt;a href="https://nodejs.org/en" rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check npm version:&lt;/strong&gt; To check if npm is installed, type:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Create a New React Project with Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once Node.js and npm are ready, we can create a new React project using Vite. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1: Open your terminal:&lt;/strong&gt; Navigate to the directory where you want to create your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 2: Run the following command:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 3: Choose your project name:&lt;/strong&gt; After running the command, you’ll be prompted to enter your project’s name. For example, you can name it &lt;code&gt;my-react-app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 4: Select your framework:&lt;/strong&gt; Vite will ask you to select a framework. Choose &lt;code&gt;React&lt;/code&gt; from the list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 5: Select the variant:&lt;/strong&gt; When prompted to select a variant, choose &lt;code&gt;JavaScript&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Step 6: Navigate to your project directory:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd my-react-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Step 7: Install dependencies:&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Run Your React Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that the project is set up, let’s run it to ensure everything works correctly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 1: Start the development server:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Step 2: Open your browser: After running the command, you’ll see an output like this:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VITE v3.0.0  ready in 150 ms

Local:   http://localhost:3000/
Network: http://192.168.1.100:3000/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Step 3: Visit the URL: Open &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt; in your browser. You should see the default Vite React template page.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Setting Up Your Workspace&lt;br&gt;
Think of this process like setting up a new workspace in your office. You've got your desk (Node.js), your tools (npm), and your project files (React app). Now, you’re ready to start working!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What’s Next?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that your development environment is set up, you're ready to start building with React! Tomorrow, we’ll dive into &lt;strong&gt;JSX&lt;/strong&gt; and how React renders elements on the page.&lt;/p&gt;

&lt;p&gt;Remember, setting up the environment is just the beginning. With a strong foundation, you can now focus on writing clean, efficient code as we progress through the challenge.&lt;/p&gt;

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

&lt;p&gt;Getting your environment right from the start ensures a smooth development experience. With Vite, you’ll benefit from faster builds and instant feedback as you code, making your ReactJS learning journey more enjoyable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/haquedot/day-3-understanding-jsx-and-rendering-elements-reactjs-pf9"&gt;Day 3: Understanding JSX and Rendering Elements&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Day 1: Introduction to ReactJS</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Wed, 28 Aug 2024 01:37:53 +0000</pubDate>
      <link>https://dev.to/haquedot/day-1-introduction-to-reactjs-3a07</link>
      <guid>https://dev.to/haquedot/day-1-introduction-to-reactjs-3a07</guid>
      <description>&lt;p&gt;Welcome to Day 1 of the "30 Days of ReactJS" challenge! Today, we'll begin our journey by understanding what ReactJS is, why it has become one of the most popular libraries in web development, and how it can help you build dynamic, modern web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is ReactJS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ReactJS, commonly known as React, is an open-source JavaScript library developed by Facebook. It was initially released in 2013 and has since become a go-to tool for building user interfaces (UIs), particularly single-page applications (SPAs). Unlike traditional JavaScript libraries, React focuses on creating components—reusable pieces of code that define parts of the user interface.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Building with LEGO Blocks&lt;br&gt;
Imagine you're building a complex LEGO structure. Instead of working with a single giant piece, you use smaller, individual blocks that can be combined in various ways. React works similarly. Instead of creating an entire web page as one large entity, React allows you to build it piece by piece using components. Each component is like a LEGO block that can be reused and combined to create complex UIs efficiently.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use ReactJS?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ReactJS offers several advantages that make it an essential tool for modern web development:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component-Based Architecture:&lt;/strong&gt; React allows you to break down your UI into smaller, reusable components. This modular approach makes your code more organized, easier to manage, and more scalable.&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%2Fstgo0m5b6cxcd801jj80.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%2Fstgo0m5b6cxcd801jj80.png" alt=" " width="700" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Think of an e-commerce website. You can create a ProductCard component that displays a product’s image, name, and price. This component can be reused throughout the site wherever you need to show a product.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Virtual DOM:&lt;/strong&gt; React uses a virtual DOM to optimize updates and rendering. Instead of updating the entire page whenever something changes, React updates only the parts that need to change, making the app faster and more efficient.&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%2F599yzxngbnli7gsyk5kf.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%2F599yzxngbnli7gsyk5kf.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Consider how your social media feed updates. When you like a post, only that specific post's like count updates instead of reloading the entire page. This is similar to how React's virtual DOM efficiently manages updates.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Declarative UI:&lt;/strong&gt; React lets you describe what the UI should look like based on the application's state, and it takes care of the rest. This approach is easier to reason about and leads to more predictable code.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: Think of writing a recipe. Instead of describing each step in detail (imperative), you just list the ingredients and instructions (declarative). React works similarly by letting you declare what you want your UI to look like, and it handles the underlying steps.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Strong Community and Ecosystem:&lt;/strong&gt; React has a vast and active community, which means you can find countless tutorials, libraries, tools, and resources to help you solve problems and build your projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real-Life Example:&lt;/strong&gt; Consider learning a new language in a city where everyone speaks it. The more people using it, the easier it is to find help, resources, and opportunities to practice. React’s community provides a similar environment for developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where is ReactJS Used?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ReactJS is used by some of the biggest names in tech, including Facebook, Instagram, Airbnb, Netflix, and Uber. These companies rely on React to build fast, interactive, and scalable web applications that serve millions of users daily.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Real-Life Example: React in Action&lt;br&gt;
Take Facebook as an example. Every time you interact with a post—whether you're liking, sharing, or commenting—React is working behind the scenes to ensure that these interactions are quick and that the UI updates efficiently without reloading the entire page.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up for the Challenge&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Throughout this 30-day challenge, you'll get hands-on experience with ReactJS. By the end of the series, you'll have built several projects and gained a deep understanding of how React works.&lt;/p&gt;

&lt;p&gt;For tomorrow, make sure to have a basic understanding of JavaScript and be ready to set up your development environment. We'll dive into setting up React on your local machine and getting your first React app up and running.&lt;/p&gt;

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

&lt;p&gt;ReactJS is more than just a tool—it's a paradigm shift in how we think about building user interfaces. Whether you're creating a small personal project or working on a large-scale application, React provides the tools and patterns needed to build efficient, maintainable, and scalable UIs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Stay tuned for Day 2, where we’ll set up your development environment and start coding with ReactJS!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/haquedot/day-2-setting-up-your-development-environment-1l0e"&gt;Day 2: Setting Up Your Development Environment&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>learnreact</category>
    </item>
    <item>
      <title>Overview: 30 Days of ReactJS in 2024</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Wed, 28 Aug 2024 01:03:37 +0000</pubDate>
      <link>https://dev.to/haquedot/overview-30-days-of-reactjs-in-2024-5g75</link>
      <guid>https://dev.to/haquedot/overview-30-days-of-reactjs-in-2024-5g75</guid>
      <description>&lt;p&gt;&lt;em&gt;Welcome to "30 Days of ReactJS," your comprehensive journey into mastering ReactJS in 2024! Whether you're a beginner looking to break into web development or an experienced developer aiming to sharpen your skills, this 30-day challenge will guide you through the core concepts and advanced techniques of ReactJS, one of the most popular JavaScript libraries for building dynamic user interfaces.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why ReactJS in 2024?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;ReactJS remains a dominant force in the web development world due to its flexibility, component-based architecture, and strong community support. With new updates and features being released regularly, staying current with ReactJS in 2024 is crucial for any developer looking to create modern, efficient, and scalable web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to Expect&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over the next 30 days, we'll explore a wide range of topics, from the basics to advanced concepts, ensuring you gain a solid understanding of ReactJS and its ecosystem. Each day will feature a focused post with clear explanations, code examples, and practical projects to help you apply what you've learned. Here's a glimpse of what we'll cover:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 1: Getting Started with ReactJS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="https://dev.to/haquedot/day-1-introduction-to-reactjs-3a07"&gt;Day 1: Introduction to ReactJS&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/haquedot/day-2-setting-up-your-development-environment-1l0e"&gt;Day 2: Setting Up Your Development Environment&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/haquedot/day-3-understanding-jsx-and-rendering-elements-reactjs-pf9"&gt;Day 3: Understanding JSX and Rendering Elements&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/haquedot/day-4-components-and-props-reactjs-5e8f"&gt;Day 4: Components and Props&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev.to/haquedot/day-5-state-and-lifecycle-methods-reactjs-432n"&gt;Day 5: State and Lifecycle Methods&lt;/a&gt;&lt;br&gt;
Day 6: Handling Events in React&lt;br&gt;
Day 7: Building Your First ReactJS App&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 2: Diving Deeper into ReactJS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Day 8: Managing State with Hooks&lt;br&gt;
Day 9: Effect Hook and Data Fetching&lt;br&gt;
Day 10: Conditional Rendering&lt;br&gt;
Day 11: Lists and Keys in React&lt;br&gt;
Day 12: Forms and Controlled Components&lt;br&gt;
Day 13: Lifting State Up&lt;br&gt;
Day 14: Composition vs Inheritance&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 3: React Ecosystem and Advanced Concepts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Day 15: React Router: Navigation Made Easy&lt;br&gt;
Day 16: Context API for Global State Management&lt;br&gt;
Day 17: Optimizing Performance with React.memo&lt;br&gt;
Day 18: Code Splitting with React.lazy and Suspense&lt;br&gt;
Day 19: Error Boundaries for Robust Applications&lt;br&gt;
Day 20: Testing React Applications with Jest and React Testing Library&lt;br&gt;
Day 21: Animations in React with Framer Motion&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Week 4: Building Real-World Applications&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Day 22: State Management with Redux&lt;br&gt;
Day 23: Integrating APIs with Axios&lt;br&gt;
Day 24: Authentication in React Apps&lt;br&gt;
Day 25: Building a Real-Time Chat App with Socket.io&lt;br&gt;
Day 26: Deploying React Apps to Vercel and GitHub Pages&lt;br&gt;
Day 27: Next.js: The React Framework for Production&lt;br&gt;
Day 28: Tailwind CSS with React: Beautiful UI Quickly&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Day 29: SEO and React: Best Practices&lt;br&gt;
Day 30: Final Project: Building and Deploying a Full-Stack App&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Participate&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each day, a new post will go live on dev.to, and you'll have the opportunity to follow along, ask questions, and share your progress with the community. To make the most of this challenge, I recommend setting aside time daily to read, code, and experiment with the examples provided.&lt;/p&gt;

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

&lt;p&gt;By the end of this 30-day challenge, you'll have a solid foundation in ReactJS, equipped to tackle real-world projects with confidence. This series is designed to be accessible yet challenging, pushing you to grow as a developer. So, are you ready to dive into ReactJS in 2024? Let's get started!&lt;/p&gt;

&lt;p&gt;Stay tuned for more, and don't forget to share your journey with the hashtag #30DaysOfReactJS2024 on social media. Happy coding!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/haquedot/day-1-introduction-to-reactjs-3a07"&gt;Day 1: Introduction to ReactJS&lt;/a&gt;&lt;/p&gt;

</description>
      <category>30daysofreactjs2024</category>
      <category>reactchallenge2024</category>
      <category>learnreactjs</category>
      <category>devtoreactjourney</category>
    </item>
    <item>
      <title>Essential Security Practices for Web Developers: Keep Your Code Safe and Sound</title>
      <dc:creator>Merajul Haque</dc:creator>
      <pubDate>Tue, 27 Aug 2024 14:06:16 +0000</pubDate>
      <link>https://dev.to/haquedot/essential-security-practices-for-web-developers-keep-your-code-safe-and-sound-2acf</link>
      <guid>https://dev.to/haquedot/essential-security-practices-for-web-developers-keep-your-code-safe-and-sound-2acf</guid>
      <description>&lt;p&gt;Security might not be the flashiest part of web development, but it’s one of the most critical. Neglecting security can turn your brilliant web app into a ticking time bomb, vulnerable to attacks that could compromise user data, damage your reputation, and cost you a lot of time and money. But fear not! With the right practices, you can build secure applications that users trust. Here’s how to do it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Validate Everything: Trust No Input&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Every piece of data your app handles is a potential threat. Whether it’s a user’s name, a file upload, or a form submission, validate it before it enters your system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sanitize inputs:&lt;/strong&gt; Remove or escape special characters.&lt;br&gt;
&lt;strong&gt;Use libraries:&lt;/strong&gt; Leverage libraries like validator.js to handle common validation tasks.&lt;br&gt;
&lt;strong&gt;Client-side &amp;amp; server-side validation:&lt;/strong&gt; Always validate on both ends. Client-side validation is convenient, but server-side validation is essential.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Prevent XSS (Cross-Site Scripting)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;XSS attacks occur when attackers inject malicious scripts into web pages viewed by others.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To prevent this:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escape user input:&lt;/strong&gt; Use templating engines that automatically escape output (e.g., Handlebars, EJS).&lt;br&gt;
&lt;strong&gt;Content Security Policy (CSP):&lt;/strong&gt; Implement CSP headers to restrict the sources from which scripts can be loaded.&lt;br&gt;
&lt;strong&gt;Sanitize HTML:&lt;/strong&gt; If your app allows users to submit HTML (e.g., in a rich text editor), make sure to sanitize it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Keep Your Dependencies in Check&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Most modern apps rely on third-party libraries. However, those dependencies can introduce vulnerabilities.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Audit regularly:&lt;/strong&gt; Tools like npm audit and Snyk can help you identify vulnerabilities in your dependencies.&lt;br&gt;
&lt;strong&gt;Update promptly:&lt;/strong&gt; Keep your dependencies up to date. Vulnerabilities are often fixed in newer versions.&lt;br&gt;
&lt;strong&gt;Limit dependencies:&lt;/strong&gt; Only include the libraries you really need. Fewer dependencies mean fewer potential risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Secure Authentication &amp;amp; Authorization&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Your authentication system is your first line of defense.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use HTTPS:&lt;/strong&gt; Encrypt all data transmitted between the client and server.&lt;br&gt;
&lt;strong&gt;Hash passwords:&lt;/strong&gt; Never store passwords in plain text. Use strong hashing algorithms like bcrypt.&lt;br&gt;
&lt;strong&gt;Implement Multi-Factor Authentication (MFA):&lt;/strong&gt; Add an extra layer of security to your login process.&lt;br&gt;
&lt;strong&gt;Limit login attempts:&lt;/strong&gt; Prevent brute-force attacks by limiting the number of failed login attempts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Protect Sensitive Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sensitive data needs extra care.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Encrypt data at rest:&lt;/strong&gt; Use strong encryption for any sensitive data stored in your database.&lt;br&gt;
&lt;strong&gt;Use environment variables:&lt;/strong&gt; Keep API keys, database credentials, and other sensitive information out of your codebase. Use environment variables instead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Avoid Common Security Pitfalls&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Sometimes, small mistakes can lead to big vulnerabilities.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSRF protection:&lt;/strong&gt; Cross-Site Request Forgery (CSRF) can be mitigated with tokens that verify the authenticity of requests.&lt;br&gt;
Disable unnecessary features: If your web server has features you’re not using, disable them to reduce the attack surface.&lt;br&gt;
&lt;strong&gt;Error messages:&lt;/strong&gt; Be careful not to expose sensitive information in your error messages. Instead, log the details internally and show generic error messages to users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Monitor &amp;amp; Respond&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security is an ongoing process, not a one-time task.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Log activity:&lt;/strong&gt; Keep detailed logs of all user and system activities.&lt;br&gt;
Set up alerts: Use tools like Sentry or LogRocket to detect and alert you to unusual behavior.&lt;br&gt;
&lt;strong&gt;Regularly review and patch:&lt;/strong&gt; Schedule regular security reviews and patch vulnerabilities promptly.&lt;/p&gt;

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

&lt;p&gt;Security doesn’t have to be overwhelming. By adopting these practices, you can create a safer web for everyone—users, developers, and businesses alike. Remember, the cost of ignoring security is far greater than the effort required to implement it. Stay vigilant, keep learning, and build secure web applications that users can rely on!&lt;/p&gt;

&lt;p&gt;What’s your favorite security tip or tool? Share it in the comments below!&lt;/p&gt;

</description>
      <category>websecurity</category>
      <category>webdev</category>
      <category>cybersecurity</category>
      <category>devtips</category>
    </item>
  </channel>
</rss>
