<?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 Sumanta  on Medium]]></title>
        <description><![CDATA[Stories by Sumanta  on Medium]]></description>
        <link>https://medium.com/@mohantasumanta601?source=rss-689b673e7567------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hym8IcRnwggdEqt3sw0uDA.png</url>
            <title>Stories by Sumanta  on Medium</title>
            <link>https://medium.com/@mohantasumanta601?source=rss-689b673e7567------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:17:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohantasumanta601/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[Backend Development]]></title>
            <link>https://medium.com/@mohantasumanta601/backend-development-9dc311daeb49?source=rss-689b673e7567------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dc311daeb49</guid>
            <category><![CDATA[api]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Sumanta ]]></dc:creator>
            <pubDate>Tue, 23 Jun 2026 16:52:45 GMT</pubDate>
            <atom:updated>2026-06-24T05:59:44.664Z</atom:updated>
            <content:encoded><![CDATA[<p>ever wondered how you can write the complete backend from scratch.Let’s Learn it. I’m going to use node.js in this project.So let’s get started.</p><pre>npm init # for initializing the project<br>package-name: backend-development # you gonna give a name <br>version: 1.0.0 # you can write or you can simply accept the default one<br>description: a backend simulating how crud works # description you can write whatever you want to tell about your project<br>entry point: (index.js) # by default it is index.js, think of it your main file which gonna be hero of the project<br>test command: # just simply press enter to accept by default config<br>git repository: # again we haven&#39;t initialized with git , so simply press enter to accept default config<br>keywords: api, node.js, express, crud<br>author: &lt;your-name&gt;<br>license: (ISC) # default one<br>type: (commonjs) # notice that default ones are inside the ()<br># It tells that we are using commonjs type , you can choose &quot;module&quot; type also<br># commonjs --&gt; uses &quot;require&quot; keyword<br># module ---&gt; uses &quot;import&quot; keyword<br></pre><p>Now you’ll have a package.json file.You can look at the config by opening that file.As we’ve mentioned our main file will be index.js file so let’s create it and put</p><pre>console.log(&quot;backend is fun to do&quot;);</pre><p>Run index.js file</p><pre>node index.js<br># backend is fun to do<br></pre><p>any changes from now on can’t be reflect on the terminal, cause that node process has done it’s work and it is now dead. So to keep watching the file you can solve it in 2 way.</p><ul><li>node --watch index.js this will keep looking , all the changes which are going to be made in the index.js file and will keep on reflecting on it.</li><li>Other one is , you can install nodemon for your development by simply running npm i --save-dev nodemon@latest . This will install <strong>nodemon</strong> in development section and will not in production section.</li></ul><p>Inside package.json file , we are going to change one change which is we are going to use “module” type rather than “commonjs”. So change it to module .</p><pre>{<br>&quot;type&quot;: &quot;module&quot;<br>}</pre><p>We are making backend Service but we need a server to serve it. So let’s make it a server first. To make a server we are going to need popular package called express.</p><pre>npm i --save express@latest</pre><h3>index.js</h3><pre>import express from &quot;express&quot;;<br><br>const PORT = 3000;<br><br>const app = express(); // create express instance<br><br>app.get(&quot;/&quot;, ( req,res ) =&gt; { <br>  res.send(&quot;Welcome to backend developement&quot;);<br>} );<br><br>app.listen(PORT, ()=&gt;{<br>  console.log(`server is running on http://localhost:${PORT}`);<br>});</pre><h3>package.json</h3><pre>// inside script add<br>{<br>  &quot;scripts&quot;: {<br>      &quot;dev&quot;: &quot;nodemon index.js&quot;,<br>  }<br>}</pre><p>It will tell that every time we run npm run dev it will run nodemon index.js and it will be easier in future. Now run npm run dev command and open your browser and hit http://localhost:3000 you will see</p><figure><img alt="getting result on url after entering it in url of the browser." src="https://cdn-images-1.medium.com/max/850/1*5nhO-7qD7Ms88xER76owTA.png" /></figure><h3>Code Format By using Prettier</h3><p>Well think of it you and your team working on a project and your colleague have some custom configs for code formatting and your’s have pretty different style. It will lead to a problem for code reviewer who is going to review it. So not to make more pain , we are going to follow a code-format for it. To do that we are going to install prettier which is going to format our code base.</p><pre>npm install --save-dev prettier@latest<br><br>npx prettier . --write # it changes your code format based on the prettier rule<br><br>npx prettier . --check # it checks the format of your code based on the prettier rules</pre><p>Now create 2 files.<br>.prettierrc : all of our code formatting will go over here.</p><pre>{<br>    &quot;trailingComma&quot;: &quot;es5&quot;,<br>    &quot;tabWidth&quot;: 4,<br>    &quot;semi&quot;: true,<br>    &quot;singleQuote&quot;: true<br>}<br><br>// put inside the .prettierrc file</pre><p>.prettierignore : it is used when you don’t want to check code format for few specific files/folders content.</p><pre>node_modules/<br>.env<br><br># put it inside the .prettierignore</pre><figure><img alt="prettier telling 2 files content hasn’t formatted yet. To do that run prettier . — write command" src="https://cdn-images-1.medium.com/max/1024/1*dJ4yx79oyPQ7VG9fT6I_Aw.png" /></figure><p>You got the idea when you run npx prettier . --check . It told you that to run npx prettier . --write to format other files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dc311daeb49" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use props in react]]></title>
            <link>https://medium.com/@mohantasumanta601/how-to-use-props-in-react-79ec0db6a321?source=rss-689b673e7567------2</link>
            <guid isPermaLink="false">https://medium.com/p/79ec0db6a321</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-props]]></category>
            <dc:creator><![CDATA[Sumanta ]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 15:53:45 GMT</pubDate>
            <atom:updated>2026-06-16T15:53:45.121Z</atom:updated>
            <content:encoded><![CDATA[<p>Well creating component and attaching them is really fun , but don’t you think those components are little bit dumb like they can’t even change a little value by their own.In that case not to worry about it, <strong>props</strong> is there in react, it is like a changing value which you can assign to your components.Let’s see usual way to pass value and better/industrialize way of passing value .</p><figure><img alt="props image in react" src="https://cdn-images-1.medium.com/max/500/1*Hy4bvPKMDYLcRO3iYZQaIg.jpeg" /></figure><p>Think of it props are your <strong>properties</strong> which you are passing to your component so that it can change your component based on your need.</p><p>Usual way to work with component</p><pre>// App.jsx<br><br>import React from &quot;react&quot;;<br><br>import Card from &quot;./components/Card&quot;;<br>// inside &quot;./components&quot; directory, there exist a file called &quot;Card.jsx&quot; and we&#39;ve imported that<br><br>function App(){<br>  &lt;Card <br>    username=&quot;sumanta&quot; // this is going/passing as &quot;props.username&quot;<br>    role=&quot;backend developer&quot; // this is going/passing as &quot;props.role&quot;<br>  /&gt; // using that Card component over here<br>}<br><br>export default App;<br><br>// ./components/Card.jsx<br><br>import React from &quot;react&quot;;<br><br>export default function Card(props){<br>  return (<br>    &lt;p&gt; User Name : { props.username }&lt;/p&gt;<br> // think of it , we&#39;re extracting key called &quot;username&quot; from &quot;props&quot; object<br>    &lt;p&gt; Role : { props.role } &lt;/p&gt;<br><br>// OR you could assign default value to them also<br><br>    &lt;p&gt; User Name : {props.username || &quot;User1&quot; }&lt;/p&gt;<br>    &lt;p&gt; Role : { props.role || &quot;role not assigned yet&quot; } &lt;/p&gt;<br> );<br>}</pre><p>Let’s see how to pass your props in a better way. These above code was ok, but it is not standard way to code and if someone wants to change default value to be something else then developer has to come into the code and have to search deep inside where props value has been extracted. Let’s see how we can make it better.</p><pre>// ./components/Card.jsx<br><br>import React from &quot;react&quot;;<br><br>// we&#39;ve extracted whatever the keys that we gonna need in the future<br>// in this way we don&#39;t have to do &quot; { props.username } &quot;<br>// we can assign default value over here and this is better way to approach<br>export default function Card({ username=&quot;user1&quot;, role=&quot;not assigned yet&quot; }){<br>  <br>  return (<br>    &lt;p&gt; User Name : { username } &lt;/p&gt;<br>    &lt;p&gt; role : { role } &lt;/p&gt;<br>  );<br>}<br><br>// Now if developer has to change the default value , he/she can change in the function&#39;s props <br>// function Card ( {username = &quot;Ichigo&quot;, role = &quot;backend developer&quot; } )<br>// and you are good to go to use it anywhere</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79ec0db6a321" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics of useState in React.]]></title>
            <link>https://medium.com/@mohantasumanta601/basics-of-usestate-in-react-298f5c0c69b1?source=rss-689b673e7567------2</link>
            <guid isPermaLink="false">https://medium.com/p/298f5c0c69b1</guid>
            <category><![CDATA[react-hook-usestate]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Sumanta ]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 06:56:59 GMT</pubDate>
            <atom:updated>2026-06-16T07:08:01.385Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog i’m going to explain you, how you can use <strong>useState</strong> effieciently.</p><figure><img alt="image of useState Code in react." src="https://cdn-images-1.medium.com/max/1024/0*Fu1ODqywHTUPTZ8A" /><figcaption>Photo by <a href="https://unsplash.com/@flowforfrank?utm_source=medium&amp;utm_medium=referral">Ferenc Almasi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Imagine you want to hold a state of your project in react, that’s where react’s useState comes in hand.First let’s see how it is done in <a href="https://en.wikipedia.org/wiki/JavaScript"><strong>js</strong></a>, then we will look how it is done in <a href="https://en.wikipedia.org/wiki/JavaScript_XML"><strong>jsx</strong></a><strong>.</strong></p><pre>let counter = 10; // initial value when someone will try to get value of counter<br><br>function add(){<br>  counter = counter + 1; // increasing counter value by 1<br>}<br> <br>function del(){<br>  counter = counter - 1; // decrease counter value by 1<br>}<br><br>console.log(counter); // it will give initial value which is 10<br><br>add(); // oldCounterValue + 1 = 10 + 1 = 11<br>add(); // oldCounterValue + 1 = 11 + 1 = 12<br>add(); // oldCounterValue + 1 = 12 + 1 = 13<br><br>del(); // oldCounterValue - 1 = 13 - 1 = 12</pre><p>You can see the value is changing as we are expected. But in jsx, it is different. Let’s see</p><pre>import {useState} from &quot;react&quot;;<br><br>functon App (){<br>  const [counter, setCounter] = useState(10);<br>}</pre><p>let me explain before further moving.</p><p>We’ve imported {useState} from “react” library and after that we’ve used it.There would be 2 parameter which we are extracting from “useState” , one is “counter” which is normal variable/container and another is “setCounter” which is a function which will help us to change the state of the variable. Now you might be thinking why we can’t do something like</p><pre>function Add(){<br>  counter = counter + 1;<br>}</pre><p>Well it will change the value of the variable but it won’t reflect. and we are using react to show the values which have been changed that’s the primary reason why we are using react. That’s why when we want to update value we do</p><pre>import {useState} from &quot;react&quot;;<br><br>function App(){<br>  const [ counter, setCounter ] = useState(10);<br><br>console.log(counter); // default value assigned to 10<br>// how to change the state<br>function Add(){<br>  // remember that we&#39;ve to use &quot;setCounter&quot; which is the function which we&#39;ve extracted from &quot;useState&quot;<br>    useState(counter + 1); <br>// Now you&#39;r value will reflect on the screen<br> }<br>function Rem(){<br>  useState(counter - 1);<br>}<br><br>return (<br>&lt;&gt;<br>  &lt;button onClick={Add}&gt;add&lt;/button&gt;<br>  &lt;h1&gt; Current Value is {counter} &lt;/h1&gt;<br>  &lt;button onClick={Rem}&gt;del&lt;/button&gt;<br>&lt;/&gt;<br>);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=298f5c0c69b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>