<?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"><channel><title><![CDATA[Yogesh Yadav's Blog]]></title><description><![CDATA[I'm Yogesh Yadav, a self-taught Full Stack Developer 🚀 from India. Building things that make a difference. Documenting my journey and learning on this blog.]]></description><link>https://blog.yogeshdecodes.com</link><generator>RSS for Node</generator><lastBuildDate>Sat, 12 Sep 2026 20:16:03 GMT</lastBuildDate><atom:link href="https://blog.yogeshdecodes.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[VoiceNotes- Speech to Text Online Notepad]]></title><description><![CDATA[In this post, I'll be going to demonstrate how you can built speech to text single page application using web browser speech recognition API. It has many use case like Voice Web Search, Speech Translation and many more.
TLDR;
VoiceNotes is dictation ...]]></description><link>https://blog.yogeshdecodes.com/voicenotes-speech-to-text-online-notepad</link><guid isPermaLink="true">https://blog.yogeshdecodes.com/voicenotes-speech-to-text-online-notepad</guid><category><![CDATA[Amplify Hashnode]]></category><category><![CDATA[AWS]]></category><category><![CDATA[React]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[APIs]]></category><dc:creator><![CDATA[Yogesh Yadav]]></dc:creator><pubDate>Mon, 01 Mar 2021 09:39:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1614577935566/rhPIjUCEe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this post, I'll be going to demonstrate how you can built speech to text single page application using web browser speech recognition API. It has many use case like Voice Web Search, Speech Translation and many more.</p>
<h2 id="tldr">TLDR;</h2>
<p>VoiceNotes is dictation app for transcribing your speech to text in real time.<br />
Here is the demo link 👉 <a target="_blank" href="https://dev.d3pfrhmntkwg6h.amplifyapp.com/">dev.d3pfrhmntkwg6h.amplifyapp.com</a><br />
Here is the repository 👉 <a target="_blank" href="https://github.com/yogeshjournal/voicenotes">GitHub Repo</a>.</p>
<h4 id="features">Features</h4>
<ul>
<li><p>Single-Page Application using ReactJS.</p>
</li>
<li><p>create buffer text before writing to actual editor</p>
</li>
<li><p>Copy text editor content to clipboard.</p>
</li>
<li><p>download text editor content as .txt file</p>
</li>
</ul>
<h4 id="screenshot">Screenshot</h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1614586291963/jlAVW7Amz.jpeg" alt="a22.JPG" /></p>
<h2 id="table-of-content">Table of Content</h2>
<ul>
<li><strong><a class="post-section-overview" href="#setup-speech-recognition-api-inside-react">Setup speech recognition API inside React</a></strong><ul>
<li><strong><a class="post-section-overview" href="#setting-up-a-new-react-app">Setting up a new React app</a></strong></li>
<li><strong><a class="post-section-overview" href="#initialize-speechrecognition-constructor-in-web-browser">Initialize SpeechRecognition() constructor in Web Browser</a></strong></li>
<li><strong><a class="post-section-overview" href="#configure-mic-onoff-and-listening-functionality">Configure mic on/off and listening functionality</a></strong></li>
</ul>
</li>
<li><strong><a class="post-section-overview" href="#deploy-to-aws-amplify">Deploy to AWS Amplify</a></strong><ul>
<li><strong><a class="post-section-overview" href="#install-the-cli-globally-with-npm">Install the CLI globally with NPM</a></strong></li>
<li><strong><a class="post-section-overview" href="#setup-amplify-for-your-reactjs-project">Setup Amplify for your React.js project</a></strong></li>
<li><strong><a class="post-section-overview" href="#hosting-a-reactjs-site-with-aws">Hosting a React.js site with AWS</a></strong></li>
</ul>
</li>
<li><strong><a class="post-section-overview" href="#challenges">Challenges</a></strong></li>
<li><strong><a class="post-section-overview" href="#final-thoughts">Final Thoughts</a></strong></li>
</ul>
<h3 id="setup-speech-recognition-api-inside-react">Setup speech recognition API inside React</h3>
<h4 id="setting-up-a-new-react-app">Setting up a new React app</h4>
<pre><code>npx <span class="hljs-keyword">create</span>-react-app voicenotes 
cd voicenotes
</code></pre><p>Once you've run the above you'll have a boilerplate React.js site ready to go on <a target="_blank" href="http://localhost:3000">localhost:3000</a> You can refer to the <a target="_blank" href="https://create-react-app.dev/docs/getting-started">official docs</a> for a better understanding of React.js as it's out-of-scope for this blog. </p>
<h4 id="initialize-speechrecognition-constructor-in-web-browser">Initialize SpeechRecognition() constructor in Web Browser</h4>
<p>The SpeechRecognition use <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API">Web Speech API</a> under the hood to control recognition service and also handles the <a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognitionEvent"><code>SpeechRecognitionEvent</code></a> sent from the recognition service.</p>
<pre><code><span class="hljs-keyword">const</span> SpeechRecognition =
  <span class="hljs-built_in">window</span>.SpeechRecognition || <span class="hljs-built_in">window</span>.webkitSpeechRecognition;
<span class="hljs-keyword">const</span> mic = <span class="hljs-keyword">new</span> SpeechRecognition();

mic.continuous = <span class="hljs-keyword">true</span>;
mic.interimResults = <span class="hljs-keyword">true</span>;
mic.lang = <span class="hljs-string">'en-US'</span>;
</code></pre><p>We have enabled property<code>mic.continuous=true</code> so that the microphone keeps on listening to the input from the user and give results for each recognition. Also we have enabled property <code>mic.interimResults=true</code>  to give results that are not yet final and are still processing.</p>
<blockquote>
<p>Note — SpeechRecognition API is mostly only compatible with Chrome and Edge browsers. To see the cross browser compatibility, you can view the list from <a target="_blank" href="https://caniuse.com/#search=SpeechRecognition">caniuse#search=SpeechRecognition</a></p>
</blockquote>
<h4 id="configure-mic-onoff-and-listening-functionality">Configure mic on/off and listening functionality</h4>
<p>We are using two methods <code>mic.start()</code> and <code>mic.stop()</code> along with four properties <code>mic.onstart</code>, <code>mic.onend</code>, <code>mic.onresult</code>, <code>mic.onerror</code> to implement listening functionality.</p>
<pre><code>const handleListen = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
    <span class="hljs-keyword">if</span> (isListening) {
      mic.start();
      mic.onend = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'continue..'</span>);
        mic.start();
      };
    } <span class="hljs-keyword">else</span> {
      mic.stop();
      mic.onend = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
        <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Stopped Mic on Click'</span>);
      };
    }
    mic.onstart = <span class="hljs-function"><span class="hljs-params">()</span> =&gt;</span> {
      <span class="hljs-built_in">console</span>.log(<span class="hljs-string">'Mics on'</span>);
    };

    mic.onresult = <span class="hljs-function"><span class="hljs-params">(event)</span> =&gt;</span> {
      const transcript = <span class="hljs-built_in">Array</span>.<span class="hljs-keyword">from</span>(event.results)
        .map(<span class="hljs-function"><span class="hljs-params">(result)</span> =&gt;</span> result[<span class="hljs-number">0</span>])
        .map(<span class="hljs-function"><span class="hljs-params">(result)</span> =&gt;</span> result.transcript)
        .join(<span class="hljs-string">''</span>);
      <span class="hljs-built_in">console</span>.log(transcript);
      setNote(transcript);
      mic.onerror = <span class="hljs-function"><span class="hljs-params">(event)</span> =&gt;</span> {
        <span class="hljs-built_in">console</span>.log(event.error);
      };
    };
  };
</code></pre><h3 id="deploy-to-aws-amplify">Deploy to AWS Amplify</h3>
<p>Amplify is unified toolchain to create, integrate, and manage the AWS cloud services for your app. Before deploy, we have to setup and configure AWS amplify. Setting up the AWS Amplify using cli command is quick and easy! Make sure you're inside the root of your project folder before running any of the following commands.</p>
<h4 id="install-the-cli-globally-with-npm">Install the CLI globally with NPM</h4>
<pre><code><span class="hljs-built_in">npm</span> install -g @aws-amplify/cli
</code></pre><p>If you want to dig deeper, you can always refer to <a target="_blank" href="https://docs.amplify.aws/cli/start/install#install-the-amplify-cli">documentation</a> by Amplify team.</p>
<h4 id="setup-amplify-for-your-reactjs-project">Setup Amplify for your React.js project</h4>
<p>Run <code>amplify configure</code> to set up the Amplify CLI to authenticate with your AWS Account which will ask your accessKey and password for secure login.</p>
<pre><code><span class="hljs-attribute">amplify</span> configure
</code></pre><p>After that, run <code>amplify init</code> which will create a new amplify folder in the root of your project. Amplify uses this folder to store about back-end code and serverless Lambda functions.</p>
<pre><code>amplify <span class="hljs-keyword">init</span>
</code></pre><h4 id="hosting-a-reactjs-site-with-aws">Hosting a React.js site with AWS</h4>
<p>Manual hosting of static build to AWS is piece of cake using just one command.</p>
<pre><code><span class="hljs-attribute">amplify</span> publish
</code></pre><p>If you want to setup custom domain, access control or see your build status, you can view by using <code>amplify console</code> command.</p>
<pre><code>amplify <span class="hljs-built_in">console</span>
</code></pre><h3 id="challenges">Challenges</h3>
<ul>
<li>Implementing download button<pre><code><span class="hljs-keyword">const</span> download = () =&gt; {
  <span class="hljs-keyword">var</span> l = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">'a'</span>);
  l.href =
    <span class="hljs-string">'data:text/plain;charset=UTF-8,'</span> +
    <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'textarea1'</span>).value;
  l.setAttribute(<span class="hljs-string">'download'</span>, <span class="hljs-string">'voicenotes.txt'</span>);
  l.click();
};
</code></pre></li>
<li>Implementing Copy to clipboard button<pre><code><span class="hljs-keyword">const</span> copy = () =&gt; {
  <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'textarea1'</span>).select();
  <span class="hljs-built_in">document</span>.execCommand(<span class="hljs-string">'copy'</span>);
  <span class="hljs-keyword">var</span> message = <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'message'</span>);
};
</code></pre></li>
</ul>
<h3 id="final-thoughts">Final Thoughts</h3>
<p>AWS interface had been intimidating to me because it has so many features, but <a target="_blank" href="https://hashnode.com/n/amplifyhashnode">#amplifyhashnode</a> give me change to play around with it. In future, I want to implement rich text editor support using React Quill library for the same.</p>
<p>I hope you find this blog useful and learnt something new.</p>
<hr />
<p>Feel free to ask in the comments or mentions me on my <a target="_blank" href="https://twitter.com/yogesh_io">Twitter.</a><br />
<strong>⚡ Happy Coding!</strong></p>
]]></content:encoded></item><item><title><![CDATA[ConfCube - Virtual Tech Event's
Social Network 🔥]]></title><description><![CDATA[Hi 👋, I'm Yogesh Yadav. I'm a self-taught full-stack developer. Before this project, I was only following tutorials on the web and never made an end-to-end real-world project on my own. I decided to choose #vercelhashnode as a great opportunity to c...]]></description><link>https://blog.yogeshdecodes.com/confcube-virtual-tech-events-social-network</link><guid isPermaLink="true">https://blog.yogeshdecodes.com/confcube-virtual-tech-events-social-network</guid><category><![CDATA[Vercel Hashnode Hackathon]]></category><category><![CDATA[React]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Gatsby]]></category><dc:creator><![CDATA[Yogesh Yadav]]></dc:creator><pubDate>Sun, 07 Feb 2021 19:30:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1612602700946/0uQYyNfeH.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hi 👋, I'm <strong>Yogesh Yadav</strong>. I'm a self-taught full-stack developer. Before this project, I was only following tutorials on the web and never made an end-to-end real-world project on my own. I decided to choose <a target="_blank" href="https://hashnode.com/n/vercelhashnode">#vercelhashnode</a> as a great opportunity to come out of my comfort zone and build something useful for the tech community.</p>
<h2 id="tldr">TL;DR</h2>
<p>ConfCube is networking app for tech events/ conferences/ webinar/ seminar/ meetup/ summit. <br />
Here is the site link 👉  <a target="_blank" href="http://confcube.vercel.app">ConCube Live.</a> <br />
Here is the repository 👉 <a target="_blank" href="https://github.com/yogeshjournal/confcube-app">GitHub Repo.</a></p>
<h2 id="inspiration">💡 Inspiration</h2>
<p>When I started my programming journey last year, everybody advised me to attend tech events for exposure and meeting new people. </p>
<p>Let's be honest – conferences can be intimidating for introverts when you have to talk to a stranger and you don't know anything upfront about that person. </p>
<p>Another issue I faced is I wanted to find a UI/UX developer for collaboration, but unfortunately in the crowd of 1000s of people, you can only network with few people.</p>
<p>After covid, most of the tech events are happening virtually and there is no room for networking with each other like we used to do before.</p>
<p>I always thought there should be some platform where I can see the interests and skill set of attendees, so it's easy to interact with each other without being awkward.
But Sadly, there is no platform available and therefore I decided to build one.</p>
<h2 id="video-demo">🎥 Video Demo</h2>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.youtube.com/watch?v=ReyhemL-MDs&amp;feature=youtu.be">https://www.youtube.com/watch?v=ReyhemL-MDs&amp;feature=youtu.be</a></div>
<h2 id="design-process">🎨 Design process</h2>
<p>Here's my design process I took for ConfCube. </p>
<p>First, I start with <a target="_blank" href="https://excalidraw.com">Excalidraw</a> for brainstorming and to quickly generate low-fidelity mockups.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612700266164/fdCMRl-06.jpeg" alt="exacli.JPG" /></p>
<p>Then, I transition to high-fidelity design with <a target="_blank" href="https://www.figma.com">Figma</a>.</p>
<p>I'm not a great designer, but I have an eye for great design and always aim for simplicity and minimalistic.</p>
<p>Other than that mobile-first approach also helps me to make a fully responsive design from the very start.</p>
<h2 id="development">🏗️ Development</h2>
<p>As I'm building a hybrid web app that consists of static pages (i.e landing page) and dynamic pages (i.e profile page), I have three options to choose from  </p>
<ul>
<li>Create-react-app </li>
<li>Gatsby</li>
<li>Nextjs</li>
</ul>
<p>I was already familiar with <code>Gatsby</code> and <code>create-react-app</code> and didn't want to learn a new framework from scratch, so I left with these two. 
Choosing between these two is an easy task.😉</p>
<table>
<thead>
<tr>
<td></td><td>Gatsby</td><td>Create-react-app</td></tr>
</thead>
<tbody>
<tr>
<td>Webpack support</td><td>✅</td><td>✅</td></tr>
<tr>
<td>Hot reloading</td><td>✅</td><td>✅</td></tr>
<tr>
<td>Client-side route</td><td>✅</td><td>✅</td></tr>
<tr>
<td>Static rendering</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Code splitting</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Seo friendly</td><td>✅</td><td>❌</td></tr>
<tr>
<td>Plugin support</td><td>✅</td><td>❌</td></tr>
</tbody>
</table>
<p>The next challenge was choosing the right backend. First, I played with <a target="_blank" href="https://hasura.io">Hasura</a> but then decided to make this whole app serverless, so chose <code>firebase</code>. </p>
<h3 id="my-complete-tech-stack">My Complete Tech Stack</h3>
<table>
<thead>
<tr>
<td>Tech</td><td>Use case</td></tr>
</thead>
<tbody>
<tr>
<td><a target="_blank" href="https://chakra-ui.com/">ChakraUI</a></td><td>Clean and minimal UI</td></tr>
<tr>
<td>Gatsby</td><td>fast static page on front-end</td></tr>
<tr>
<td>Firebase auth</td><td>sign in with Google or GitHub</td></tr>
<tr>
<td>Firestore</td><td>document-based real-time database</td></tr>
<tr>
<td>Vercel</td><td>for hosting</td></tr>
<tr>
<td>Contentful</td><td>CMS for conference page</td></tr>
</tbody>
</table>
<p>For a list of upcoming tech conferences, I extract data from an open-source project. Shout out to <a target="_blank" href="https://github.com/tech-conferences/confs.tech">tech-conferences</a> repo for maintaining a beautiful list.</p>
<h3 id="screenshot-of-static-page">ScreenShot of Static page</h3>
<ul>
<li>Homepage</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612724745978/x6bF3sCdt.png" alt="screely-1612724570542.png" /></p>
<ul>
<li>Conference list page</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612724773876/Ex8gOpEFf.png" alt="screely-1612724603574.png" /></p>
<h3 id="screenshot-of-dynamic-page-client-side-page">ScreenShot of Dynamic Page/ Client Side Page</h3>
<ul>
<li>Profile page</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612724863014/O6xMnemtN.png" alt="screely-1612724630540.png" /></p>
<ul>
<li>Conference detail page
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1612724872100/lvm-kyWJB.png" alt="screely-1612724656935.png" /></li>
</ul>
<h2 id="challenges">🚧 Challenges</h2>
<table>
<thead>
<tr>
<td>Challenge</td><td>Solution</td></tr>
</thead>
<tbody>
<tr>
<td>Server-side build error</td><td>by ignoring firebase module during build time</td></tr>
</tbody>
</table>
<p>This particular bug took me two days to solve. Since it was my first time building a dynamic app with gatsby and I never encounter this during the static build. Below code is I used inside <code>gatsby-node.js</code> to solve this problem.</p>
<pre><code><span class="hljs-built_in">exports</span>.onCreateWebpackConfig = <span class="hljs-function">(<span class="hljs-params">{ stage, loaders, actions }</span>) =&gt;</span> {
  <span class="hljs-keyword">if</span> (stage === <span class="hljs-string">"build-html"</span>) {
    actions.setWebpackConfig({
      <span class="hljs-keyword">module</span>: {
        rules: [
          {
            test: <span class="hljs-regexp">/firebase/</span>,
            use: loaders.null(),
          },
        ],
      },
    })
  }
}
</code></pre><table>
<thead>
<tr>
<td>Challenge</td><td>Solution</td></tr>
</thead>
<tbody>
<tr>
<td>404 on Refresh page</td><td>by checking if window defined</td></tr>
</tbody>
</table>
<p>It is frustrating when everything works great in localhost but fails in production. I found many times errors are solved by just checking if the <code>window</code> is defined or not. It's like a magic pill to avoid all your SSR errors in gatsby. Below is the code in case if you stuck someday.</p>
<pre><code><span class="hljs-keyword">const</span> browser = <span class="hljs-keyword">typeof</span> <span class="hljs-built_in">window</span> !== <span class="hljs-string">'undefined'</span> &amp;&amp; <span class="hljs-built_in">window</span>;
browser &amp;&amp; (errorcode)
</code></pre><h2 id="future-scope">🔮 Future Scope</h2>
<p>There will be always room for improvement. I have some plans to implement and make it more useful to the developer community. You can expect the following features in the upcoming days.</p>
<ul>
<li>User can change profile photo</li>
<li>On platform chat option</li>
<li>dark/light theme option</li>
<li>write SEO for each page</li>
<li>Integration test for robustness</li>
<li>Documentation guide </li>
</ul>
<h2 id="contributing">🤝 Contributing</h2>
<p>The project is fully open-source so you could add an issue, a pull request on Github.
Create a new pull request if you want to list your event on the conference page.</p>
<h2 id="wrapping-up">Wrapping up</h2>
<p>First of all thanks to <strong>hashnode</strong>  for conducting <a target="_blank" href="https://hashnode.com/n/vercelhashnode">Vercel Hashnode Hackathon</a>. This hackathon forced me to do stuff that I thought out of my league once upon a time like reading the documentation. Overall it's a huge learning experience for me.</p>
<p> I feel programming gives you the superpower to manifest anything into reality. 
This is my first blog and the first hackathon so please give your review on how can I improve in the future. Looking forward to your words.</p>
<hr />
<p>Feel free to ask in the comments or mentions me on my <a target="_blank" href="https://twitter.com/yogesh_io">Twitter.</a></p>
<blockquote>
<p><strong>I would like to see your profile inside ConfCube! ❤️</strong></p>
</blockquote>
<p><strong>⚡ Happy learning!</strong></p>
]]></content:encoded></item></channel></rss>