<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Satya Pendem on Medium]]></title>
        <description><![CDATA[Stories by Satya Pendem on Medium]]></description>
        <link>https://medium.com/@satyapendem.dev?source=rss-44ea508f3442------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*JGAn5RDeE09XkNYKFpdYrg.jpeg</url>
            <title>Stories by Satya Pendem on Medium</title>
            <link>https://medium.com/@satyapendem.dev?source=rss-44ea508f3442------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 19:09:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@satyapendem.dev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Fully Local AI Coding Assistant with Ollama and VS Code]]></title>
            <link>https://medium.com/@satyapendem.dev/building-a-fully-local-ai-coding-assistant-with-ollama-and-vs-code-fbc3e0389f62?source=rss-44ea508f3442------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbc3e0389f62</guid>
            <category><![CDATA[vscode-extension]]></category>
            <category><![CDATA[ai-coding]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Satya Pendem]]></dc:creator>
            <pubDate>Sat, 16 May 2026 19:21:41 GMT</pubDate>
            <atom:updated>2026-05-16T19:21:41.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PP9UOCERwImZgDz2pOrJVg.png" /></figure><p><em>Run powerful coding models directly on your machine — without sending your code to the cloud.</em></p><p>Artificial Intelligence has fundamentally changed software development. From autocomplete to debugging to architecture design, AI copilots are becoming part of every developer workflow.</p><p>But there’s a growing problem:</p><ul><li><strong>Privacy concerns</strong></li><li><strong>API costs</strong></li><li><strong>Rate limits</strong></li><li><strong>Internet dependency</strong></li><li><strong>Vendor lock-in</strong></li></ul><p>For many developers, especially those working on internal tools, client projects, or experimental systems, sending source code to external APIs is not always acceptable.</p><p>The good news is that modern open-source language models are now capable enough to run locally on consumer hardware.</p><p>In this article, we’ll build a fully local AI coding assistant using:</p><ul><li><strong>Ollama</strong></li><li><strong>VS Code</strong></li><li><strong>Continue extension</strong></li><li><strong>Open-source coding models like Qwen and Gemma</strong></li></ul><p>By the end, you’ll have an offline coding assistant running entirely on your own machine.</p><p><strong>Why Local AI Matters</strong></p><p>Running models locally gives developers several advantages:</p><h3>1. Privacy</h3><p>Your code never leaves your computer.</p><p>This is critical for:</p><ul><li>Enterprise development</li><li>Proprietary codebases</li><li>Security-sensitive projects</li><li>Offline environments</li></ul><h3>2. No API Costs</h3><p>Cloud coding assistants become expensive over time.</p><p>Local models:</p><ul><li>Have zero per-request cost</li><li>No token accounting</li><li>No usage caps</li></ul><p>You pay once in hardware resources.</p><h3>3. Lower Latency</h3><p>Local inference can feel surprisingly fast, especially for:</p><ul><li>Autocomplete</li><li>Small edits</li><li>Refactoring</li><li>Quick debugging</li></ul><p>No network roundtrip required.</p><h3>4. Offline Development</h3><p>You can continue working:</p><ul><li>On flights</li><li>In restricted networks</li><li>During outages</li><li>Without internet access</li></ul><h3>Step 1: Install Ollama</h3><p>Ollama makes local LLMs incredibly simple.</p><p>Install it from:<br>https://ollama.com</p><p>After installation, verify:</p><pre>ollama --version</pre><p>Start the Ollama server:</p><pre>ollama serve</pre><p>Ollama exposes a local API at:</p><pre>http://localhost:11434</pre><h3>Step 2: Download a Coding Model</h3><p>There are many local models available, but for coding tasks, these are excellent starting points:</p><ol><li>qwen2.5-coder (Coding + autocomplete)</li><li>deepseek-coder (Strong reasoning)</li><li>llama3.1 (General assistant)</li><li>gemma4 (Lightweight chat/editing) → My personal favourite❤️</li></ol><p><strong>Recommended Starter Model</strong></p><pre>ollama pull qwen2.5-coder:7b</pre><p>If your machine has limited RAM:</p><pre>ollama pull qwen2.5-coder:1.5b</pre><p>You can see installed models with:</p><pre>ollama list</pre><h3>Step 3: Install Continue Extension</h3><p>In VS Code:</p><ol><li>Open Extensions</li><li>Search for Continue</li><li>Install the extension</li></ol><p>Or visit:<br>https://continue.dev</p><h3>Step 4: Configure Continue</h3><p>Open your Continue config:</p><pre>~/.continue/config.yaml</pre><p>Add your local models:</p><pre>name: Local Config<br>version: 1.0.0<br>schema: v1<br><br>models:<br>  - name: Qwen Coder<br>    provider: ollama<br>    model: qwen2.5-coder:7b<br>    roles:<br>      - chat<br>      - edit<br>      - apply<br>      - autocomplete<br><br>  - name: Gemma 4<br>    provider: ollama<br>    model: gemma4:latest<br>    roles:<br>      - chat<br>      - edit<br></pre><p>Save the file and reload VS Code after that test your assistant.</p><h3>Choosing the Right Model</h3><p>Different models excel at different tasks.</p><h3>Qwen2.5-Coder</h3><p>Best overall local coding model right now for most developers.</p><p>Strengths:</p><ul><li>Autocomplete</li><li>Refactoring</li><li>Debugging</li><li>Code generation</li></ul><p>Recommended for:</p><ul><li>Daily development</li><li>VS Code integration</li></ul><h3>Gemma</h3><p>Smaller and lightweight.</p><p>Good for:</p><ul><li>General chat</li><li>Lightweight edits</li><li>Lower-end hardware</li></ul><p>Not as strong for complex code reasoning.</p><h3>DeepSeek-Coder</h3><p>Excellent reasoning capabilities.</p><p>Strong at:</p><ul><li>Algorithms</li><li>Multi-file logic</li><li>Complex debugging</li></ul><p>Requires more resources.</p><h3>Hardware Recommendations</h3><h3>Minimum</h3><ul><li>16 GB RAM</li><li>Modern CPU</li><li>SSD storage</li></ul><p>Works well with:</p><ul><li>1.5B to 7B models</li></ul><h3>Ideal</h3><ul><li>32 GB RAM</li><li>NVIDIA GPU</li><li>8–16 GB VRAM</li></ul><p>Enables:</p><ul><li>Larger models</li><li>Faster inference</li><li>Better responsiveness</li></ul><h3>Why This Setup Is Powerful</h3><p>The combination of:</p><ul><li>Ollama</li><li>Open-source models</li><li>VS Code integrations</li></ul><p>creates something genuinely transformative:</p><p>A private, offline, customizable AI development environment.</p><p>You control:</p><ul><li>The models</li><li>The data</li><li>The infrastructure</li><li>The workflow</li></ul><p>No subscriptions required.</p><h3>Final Thoughts</h3><p>Cloud AI tools are incredibly convenient, but local AI is rapidly becoming practical for everyday development.</p><p>For many developers, the sweet spot is now:</p><ul><li>Local autocomplete</li><li>Local debugging</li><li>Local editing</li><li>Optional cloud reasoning for difficult tasks</li></ul><p>As open-source models continue improving, fully local developer environments will become increasingly common.</p><p>And the best part?</p><p>You can start building one today with free tools and a laptop.</p><h3>Resources</h3><ul><li><a href="https://ollama.com/">Ollama</a></li><li><a href="https://continue.dev/">Continue Extension</a></li><li><a href="https://ollama.com/library">Ollama Model Library</a></li><li><a href="https://code.visualstudio.com/">Visual Studio Code</a></li></ul><p>Happy coding !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbc3e0389f62" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Stopped Fighting the DOM and Let the Browser Do the Highlighting..]]></title>
            <link>https://medium.com/@satyapendem.dev/how-i-stopped-fighting-the-dom-and-let-the-browser-do-the-highlighting-f9dbbde6e41b?source=rss-44ea508f3442------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9dbbde6e41b</guid>
            <category><![CDATA[mutationobserver]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Satya Pendem]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 17:07:36 GMT</pubDate>
            <atom:updated>2026-03-14T17:07:36.200Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OxYc6FmJ_yTh-1f4MsEY9w.png" /><figcaption>CSS Custom Highlight API</figcaption></figure><p>Modern web applications often need to dynamically highlight text inside complex and frequently changing DOM structures. Examples include search results, glossary tooltips, documentation explorers, and browser extensions. Traditional approaches typically rely on modifying the DOM by wrapping matched text with &lt;span&gt; elements, but this technique has several drawbacks:</p><ul><li>It mutates the DOM structure.</li><li>It can break existing layouts or event listeners.</li><li>It adds performance overhead when large sections of the DOM must be reprocessed.</li></ul><p>Two modern browser APIs <strong>MutationObserver</strong> and the <strong>CSS Highlight API </strong>provide a far cleaner and more efficient solution.</p><p>This article explains how these APIs work together to enable <strong>non-destructive, reactive text highlighting</strong>.</p><h3>The Problem with Traditional Highlighting</h3><p>The classic approach to highlighting text usually looks like this:</p><pre>const highlighted = text.replace(<br>  /keyword/gi,<br>  &#39;&lt;span class=&quot;highlight&quot;&gt;$&amp;&lt;/span&gt;&#39;<br>);<br>element.innerHTML = highlighted;</pre><p>While simple, this approach introduces several problems:</p><ol><li><strong>DOM mutation: </strong>Text nodes are replaced with HTML elements.</li><li><strong>Reprocessing costs: </strong>Every change requires rebuilding HTML.</li><li><strong>Event interference: </strong>Injected spans may break event propagation.</li><li><strong>Framework conflicts: </strong>Libraries like React, Angular, or Vue may overwrite these changes during re-renders.</li></ol><p>In modern applications where content changes frequently, we need something more robust.</p><h3>CSS Highlight API</h3><p>The <strong>CSS Highlight API</strong> allows developers to highlight arbitrary text ranges without modifying the DOM.</p><p>Instead of wrapping text with elements, it creates highlight ranges that the browser paints using CSS.</p><p>Example</p><pre>const range = new Range();<br>range.setStart(textNode, 5);<br>range.setEnd(textNode, 12);<br>const highlight = new Highlight(range);<br>CSS.highlights.set(&quot;search-highlight&quot;, highlight);</pre><p>Then style it using CSS:</p><pre>::highlight(search-highlight) {<br>  background: yellow;<br>  color: black;<br>}</pre><h3>Benefits</h3><ul><li>No DOM modification</li><li>Faster rendering</li><li>Cleaner integration with frameworks</li><li>Multiple independent highlight layers</li></ul><p>This makes it ideal for search results, annotations, and interactive documentation tools.</p><h3>Detecting DOM Changes with MutationObserver</h3><p>While the CSS Highlight API handles rendering highlights, we still need a way to react when the DOM changes.</p><p>This is where <strong>MutationObserver</strong> comes in.</p><p>MutationObserver watches the DOM and triggers callbacks whenever elements are added, removed, or modified.</p><p><strong>Example</strong></p><pre>const observer = new MutationObserver((mutations) =&gt; {<br>  mutations.forEach((mutation) =&gt; {<br>    if (mutation.type === &quot;childList&quot;) {<br>      applyHighlights();<br>    }<br>  });<br>});<br>observer.observe(document.body, {<br>  childList: true,<br>  subtree: true<br>});</pre><p>Now every time new content appears on the page, highlights can be reapplied automatically.</p><h3>Combining Both APIs</h3><p>The real power appears when both APIs are used together.</p><h3>Workflow</h3><ol><li>Scan text nodes for keywords.</li><li>Create Range objects for matches.</li><li>Add them to a Highlight object.</li><li>Register with CSS.highlights.</li><li>Use MutationObserver to re-run highlighting when the DOM changes.</li></ol><p><strong>Example Implementation</strong></p><pre>function highlightKeyword(keyword) {<br>  const ranges = [];<br>  const walker = document.createTreeWalker(<br>    document.body,<br>    NodeFilter.SHOW_TEXT<br>  );<br>  let node;<br>  while ((node = walker.nextNode())) {<br>    const index = node.textContent.toLowerCase().indexOf(keyword.toLowerCase());<br>    if (index !== -1) {<br>      const range = new Range();<br>      range.setStart(node, index);<br>      range.setEnd(node, index + keyword.length);<br>      ranges.push(range);<br>    }<br>  }<br>  const highlight = new Highlight(...ranges);<br>  CSS.highlights.set(&quot;keyword-highlight&quot;, highlight);<br>}</pre><h3>Auto-Rehighlight on DOM Updates</h3><p>To keep highlights updated when new content appears:</p><pre>const observer = new MutationObserver(() =&gt; {<br>  CSS.highlights.delete(&quot;keyword-highlight&quot;);<br>  highlightKeyword(&quot;data&quot;);<br>});<br>observer.observe(document.body, {<br>  childList: true,<br>  subtree: true<br>});</pre><p>This ensures highlights always stay synchronized with dynamic content.</p><h3>Performance Considerations</h3><p>When working with large DOM trees, consider the following optimizations.</p><h3>Limit observation scope</h3><p>Instead of observing the entire page:</p><pre>observer.observe(container, {<br>  childList: true,<br>  subtree: true<br>});</pre><h3>Debounce highlight updates</h3><pre>let timeout;<br>const observer = new MutationObserver(() =&gt; {<br>  clearTimeout(timeout);<br>  timeout = setTimeout(() =&gt; {<br>    highlightKeyword(&quot;data&quot;);<br>  }, 100);<br>});</pre><p>This prevents expensive reprocessing during rapid DOM updates.</p><h3>Browser Support</h3><p>Understanding browser compatibility is important when using these APIs.</p><h3>MutationObserver Support</h3><p>MutationObserver is <strong>widely supported across all modern browsers</strong>.</p><p>BrowserSupported SinceChrome26+Edge12+Firefox14+Safari6.1+Opera15+</p><p>Because of this wide support, MutationObserver can safely be used in most production web applications.</p><h3>CSS Highlight API Support</h3><p>The CSS Highlight API is <strong>newer</strong> and currently supported mainly in Chromium-based browsers.</p><p>BrowserSupportChrome105+Edge105+FirefoxPartial / Behind flagSafariLimited / Experimental</p><p>Due to its evolving support, you should <strong>feature-detect the API before using it</strong>.</p><h3>Feature Detection</h3><pre>if (CSS.highlights) {<br>  // Safe to use CSS Highlight API<br>}</pre><h3>Fallback Strategy for Unsupported Browsers</h3><p>If the CSS Highlight API is unavailable, you can fall back to the traditional &lt;span&gt; wrapping approach.</p><p>Example fallback:</p><pre>function highlightFallback(element, keyword) {<br>  element.innerHTML = element.innerHTML.replace(<br>    new RegExp(keyword, &quot;gi&quot;),<br>    `&lt;span class=&quot;highlight&quot;&gt;$&amp;&lt;/span&gt;`<br>  );<br>}</pre><p>This ensures your highlighting feature still works on older browsers.</p><h3>Real-World Use Cases</h3><p>Using MutationObserver + CSS Highlight API works well in several scenarios.</p><h3>Documentation Platforms</h3><p>Highlight glossary terms dynamically across large documentation pages.</p><h3>Browser Extensions</h3><p>Highlight keywords without altering the host page DOM.</p><h3>Search Interfaces</h3><p>Highlight search results in real time as users type.</p><h3>Data Exploration Tools</h3><p>Highlight metadata fields or semantic entities in large datasets.</p><h3>Conclusion</h3><p>Combining <strong>MutationObserver</strong> with the <strong>CSS Highlight API</strong> provides a powerful approach to dynamic text highlighting:</p><ul><li>No DOM mutation.</li><li>Better performance.</li><li>Cleaner integration with frameworks.</li><li>Automatically adapts to dynamic content.</li></ul><p>Although the CSS Highlight API is still gaining browser support, its advantages make it a strong candidate for modern web applications. By combining feature detection with fallback strategies, developers can safely adopt it today while maintaining compatibility with older browsers.</p><p>As dynamic interfaces continue to evolve, this pattern offers a scalable and maintainable way to implement <strong>high-performance text highlighting</strong> in modern web applications.</p><p>Happy Coding 🧑‍💻😄🧑‍💻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9dbbde6e41b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing React UI Performance with `useTransition` Hook]]></title>
            <link>https://medium.com/@satyapendem.dev/optimizing-react-ui-performance-with-usetransition-hook-309be0545739?source=rss-44ea508f3442------2</link>
            <guid isPermaLink="false">https://medium.com/p/309be0545739</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[hooks-in-react]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Satya Pendem]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 15:37:07 GMT</pubDate>
            <atom:updated>2025-03-24T15:37:07.105Z</atom:updated>
            <content:encoded><![CDATA[<p>While developing with React, you have probably run into scenarios where the UI gets frozen or delayed as a result of costly state updates. This tends to happen more often in cases such as filtering big lists, rendering heavy components, or processing intensive computations. React’s <strong>useTransition</strong> hook resolves such performance issues by suspending non-essential updates and maintaining the responsiveness of the UI.</p><p><strong>What is `useTransition`?</strong></p><p>`useTransition` is a built-in React hook that allows us to prioritize state updates, ensuring that the UI remains smooth while handling expensive operations in the background. It returns an `isPending` flag and a `startTransition` function:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*d0jy9NKk-i5pmKGOA3GlZw.png" /><figcaption>Hook</figcaption></figure><ul><li><strong>isPending</strong>: A boolean that indicates whether a transition is in progress.</li><li><strong>startTransition</strong>: A function used to wrap state updates that can be deferred.</li></ul><p><strong>Real-World Example: Filtering a Large List</strong></p><p>Let’s say we have a search input that filters through a list of thousands of items. Without `useTransition`, every keystroke triggers an immediate, expensive re-render, causing noticeable UI lag.</p><p><strong>🚨 Without useTransition (Laggy UI)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQMhcaYSksos7oRfQ5dCzg.png" /><figcaption>without hook</figcaption></figure><p>🔴 <strong>Issue</strong>: Typing in the input field becomes sluggish because both state updates happen synchronously.</p><p>✅ <strong>With useTransition (Smooth UI)</strong></p><p>We can improve performance by wrapping the expensive state update inside startTransition:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rtmMsyiMtYADiuZTgdYr2w.png" /><figcaption>with Hook</figcaption></figure><p><strong>🔥 Benefits of `useTransition`</strong></p><p>✅ <strong>Instant feedback: </strong>The search input updates immediately.</p><p>✅ <strong>Smooth UI:</strong> Expensive filtering happens in the background.</p><p><strong>✅ Better UX:</strong> A loading indicator (isPending) informs users when filtering is in progress.</p><p><strong>When to Use useTransition?</strong></p><p>🔹 Filtering or searching through large lists</p><p>🔹 Rendering complex components that take time to load.</p><p>🔹 Optimizing animations, graphs, and charts.</p><p>🔹 Deferring less important UI updates.</p><p>`useTransition` is a powerful tool for keeping your React apps smooth and responsive. It helps prioritize urgent updates (like user input) while deferring expensive operations in the background. If you have UI performance bottlenecks, consider using useTransition to optimize your app’s responsiveness! 🚀</p><p>`useTransition` was introduced in React 18, so make sure your project is running on <strong>React 18 or later</strong> to take advantage of this feature.</p><p>Have you used `useTransition` in your projects? Let me know your thoughts in the comments! 👇</p><p>Happy coding……☕👨‍💻☕</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=309be0545739" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up a backend server with Fastify and JWT Auth]]></title>
            <link>https://medium.com/@satyapendem.dev/setting-up-a-backend-server-with-fastify-and-jwt-auth-e39f32c635df?source=rss-44ea508f3442------2</link>
            <guid isPermaLink="false">https://medium.com/p/e39f32c635df</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[fastify]]></category>
            <dc:creator><![CDATA[Satya Pendem]]></dc:creator>
            <pubDate>Fri, 20 Dec 2019 06:35:38 GMT</pubDate>
            <atom:updated>2019-12-20T06:49:28.116Z</atom:updated>
            <content:encoded><![CDATA[<p>Fastify is one of the node servers like express. It provides huge support for plugins. To know more go through this link <a href="https://www.fastify.io/">https://www.fastify.io/</a>.</p><p>Let’s start the code…..</p><ol><li>Set up a basic node js project with package.json.</li><li>Install the following dependencies.<br>“ npm install — save fastify fastify-jwt”</li><li>create <strong>server.js</strong> file with the below code.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba51f6be80e2f6afc92cbbc3509334a2/href">https://medium.com/media/ba51f6be80e2f6afc92cbbc3509334a2/href</a></iframe><p>4. create folder router and inside that create <strong>router.js.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/721b5935bdb95c43349a13f285dddd6f/href">https://medium.com/media/721b5935bdb95c43349a13f285dddd6f/href</a></iframe><p>5. fastify provides a decorator to decorate our routes.</p><p>6. Inside the router folder create <strong>authRouter.js.</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5400439ab58f213407973a434ebc19df/href">https://medium.com/media/5400439ab58f213407973a434ebc19df/href</a></iframe><p>To decorate routes create a middleware folder and inside that create <strong>auth_middleware.js</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0fa0d10505746db2d166107422635bb7/href">https://medium.com/media/0fa0d10505746db2d166107422635bb7/href</a></iframe><p>Import the middleware and router in server.js as shown above.</p><p>Just start the <strong>server.js.</strong></p><p>Let’s test our code………..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2NSp-DwNe8O82QLLd63AzA.png" /></figure><p>When we trigger our API with { userId, email, username } it created an access token and returned in the response.</p><p>Let’s validate our auth rout(“/api/v1/validateAccessToken”) with Access token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dOs_HwoR703piWCXZ4uoRA.png" /></figure><p>We passed the access token as a “Bearer token” in Authorization headers.</p><p>Boom it got validated😀😀.</p><p>Thanks.</p><p>Github: <a href="https://github.com/satyapendem/fastify-backend">https://github.com/satyapendem/fastify-backend</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e39f32c635df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Injecting the react component into plain JS]]></title>
            <link>https://medium.com/@satyapendem.dev/injecting-the-react-component-into-plain-js-a8ee54694110?source=rss-44ea508f3442------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8ee54694110</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Satya Pendem]]></dc:creator>
            <pubDate>Wed, 12 Dec 2018 11:01:39 GMT</pubDate>
            <atom:updated>2018-12-12T11:06:53.104Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*5NMupujaIwkESSIPnN76Lw.png" /><figcaption>EmojiMart Picker</figcaption></figure><p>Nowadays the react became a popular library for front end. For some apps which are written in plain JS it is hard to use react in that apps until they rewrite the complete app. But, it is very hard part. Rewriting the app may take so much time. And for me I struck in the same problem I’m working in app which was completely written in JS. In my app I wanted to add the new <strong>EmojiPicker. </strong>I’m just surfing in internet for some emoji picker then I found one Picker(EmojiMart: <a href="https://github.com/missive/emoji-mart">https://github.com/missive/emoji-mart</a>) which will solve all my problems. I’m very happy and I wanted to use EmojiMart in my app😞. Badly my app was in JS and I can’t use react component. Then I started thinking🤔. Then I wrote one react class by importing the EmojiMart emoji picker.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a515cb7b662482f32f1cd9af2b8fe64b/href">https://medium.com/media/a515cb7b662482f32f1cd9af2b8fe64b/href</a></iframe><p>And I just transpile with my webpack then I got a<strong> bundle file. </strong>I linked the bundle file with my app. Here, you can link React and ReactDOM with CDN’s. Here, I’m just adding to the window. And with the help of react-dom I’m rendering my component.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/feae2e4a0ddfa0b5d08b779e66888dc8/href">https://medium.com/media/feae2e4a0ddfa0b5d08b779e66888dc8/href</a></iframe><p>I have a emoji icon in my app on click of the emoji icon I’m just triggering the above code which will show the emoji picker.</p><p>Here, I’m using <strong>twitter </strong>set and I have one global event handler in my app. And I’m using as my event handler <strong>app.handleEmojiClick </strong>which will take care of emoji clicks. I have 2 parameters to the <strong>app.handleEmojiClick </strong>one is <strong>Event </strong>and the second one is <strong>Emoji</strong> and I’m using the emoji for rendering purposes.</p><p>Thanks for reading 😀😀😀😀😀😀😀.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8ee54694110" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>