<?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 Ayushi Sharma on Medium]]></title>
        <description><![CDATA[Stories by Ayushi Sharma on Medium]]></description>
        <link>https://medium.com/@jssayushisharma98?source=rss-872c0b1e4c3f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g7fGTKh2xyUeiPJr8qav2g.jpeg</url>
            <title>Stories by Ayushi Sharma on Medium</title>
            <link>https://medium.com/@jssayushisharma98?source=rss-872c0b1e4c3f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:38:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jssayushisharma98/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[      : - …]]></title>
            <link>https://medium.com/@jssayushisharma98/-7b81989226b2?source=rss-872c0b1e4c3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b81989226b2</guid>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[full-stack-developer]]></category>
            <dc:creator><![CDATA[Ayushi Sharma]]></dc:creator>
            <pubDate>Sat, 15 Jun 2024 10:28:50 GMT</pubDate>
            <atom:updated>2024-06-15T10:30:33.954Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>𝐁𝐮𝐢𝐥𝐝 𝐚 𝐌𝐄𝐑𝐍 𝐒𝐭𝐚𝐜𝐤 𝐀𝐩𝐩 𝐅𝐫𝐨𝐦 𝐒𝐜𝐫𝐚𝐭𝐜𝐡: 𝐅𝐮𝐥𝐥-𝐒𝐭𝐚𝐜𝐤 𝐃𝐞𝐯 𝐑𝐨𝐚𝐝𝐦𝐚𝐩</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFZsLBWrDjaSJTMB0HK7pQ.png" /></figure><p>Thinking of becoming a full-stack developer? The MERN stack (MongoDB, Express.js, React, and Node.js) is a popular choice for building efficient and scalable web applications due to its Javascript-centric approach and vast community support.</p><p>This post outlines a step-by-step guide to get you started, from building the user interface with React to setting up the backend with Node.js and MongoDB. Whether you’re a beginner with some web development knowledge or an aspiring full-stack developer, this roadmap will equip you with the foundational skills to build your own MERN applications.</p><p>𝐅𝐫𝐨𝐧𝐭𝐞𝐧𝐝 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐦𝐞𝐧𝐭 (Client-side):-</p><p>𝐅𝐫𝐚𝐦𝐞𝐰𝐨𝐫𝐤 𝐚𝐧𝐝 𝐋𝐚𝐧𝐠𝐮𝐚𝐠𝐞 𝐰𝐢𝐭𝐡 𝐑𝐞𝐚𝐜𝐭: Use React to build dynamic user interfaces.<br> 𝐂𝐨𝐦𝐩𝐨𝐧𝐞𝐧𝐭 𝐀𝐫𝐜𝐡𝐢𝐭𝐞𝐜𝐭𝐮𝐫𝐞 &amp; 𝐔𝐈 𝐃𝐞𝐬𝐢𝐠𝐧: Collaborate with designers and use component libraries like Material-UI to create a polished and consistent user interface.<br> 𝐑𝐨𝐮𝐭𝐢𝐧𝐠 𝐰𝐢𝐭𝐡 𝐑𝐞𝐚𝐜𝐭 𝐑𝐨𝐮𝐭𝐞𝐫: Implement client-side routing using React Router to navigate between different pages in your application.<br> 𝐒𝐭𝐚𝐭𝐞 𝐌𝐚𝐧𝐚𝐠𝐞𝐦𝐞𝐧𝐭: Decide on the state management approach for your application. You can use React’s built-in state management or opt for libraries like Redux or React Context API.<br> 𝐑𝐞𝐬𝐩𝐨𝐧𝐬𝐢𝐯𝐞 𝐃𝐞𝐬𝐢𝐠𝐧: Make your application responsive using CSS media queries.<br> 𝐓𝐞𝐬𝐭𝐢𝐧𝐠 𝐚𝐧𝐝 𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞: Write unit tests using testing frameworks like Jest.</p><p>𝐁𝐚𝐜𝐤𝐞𝐧𝐝 𝐃𝐞𝐯𝐞𝐥𝐨𝐩𝐦𝐞𝐧𝐭 (𝐒𝐞𝐫𝐯𝐞𝐫-𝐬𝐢𝐝𝐞):-</p><p>𝐒𝐞𝐭𝐮𝐩 𝐍𝐨𝐝𝐞.𝐣𝐬 𝐏𝐫𝐨𝐣𝐞𝐜𝐭: Initialize a new Node.js project using npm or yarn.<br> 𝐄𝐱𝐩𝐫𝐞𝐬𝐬.𝐣𝐬 𝐒𝐞𝐭𝐮𝐩: Install Express.js to handle HTTP requests.<br> 𝐃𝐚𝐭𝐚𝐛𝐚𝐬𝐞 𝐈𝐧𝐭𝐞𝐠𝐫𝐚𝐭𝐢𝐨𝐧: Use Mongoose to connect to MongoDB and perform CRUD operations.<br> 𝐀𝐏𝐈 𝐄𝐧𝐝𝐩𝐨𝐢𝐧𝐭𝐬: Define routes and create API endpoints to handle various client requests. Implement CRUD operations for interacting with the database.<br> 𝐀𝐏𝐈 𝐓𝐞𝐬𝐭𝐢𝐧𝐠: Test API endpoints using tools like Postman.<br> 𝐌𝐢𝐝𝐝𝐥𝐞𝐰𝐚𝐫𝐞: Use middleware functions in Express.js for tasks such as authentication, request parsing, error handling, etc.<br> 𝐀𝐮𝐭𝐡𝐞𝐧𝐭𝐢𝐜𝐚𝐭𝐢𝐨𝐧 𝐚𝐧𝐝 𝐀𝐮𝐭𝐡𝐨𝐫𝐢𝐳𝐚𝐭𝐢𝐨𝐧: Implement user authentication and authorization mechanisms to secure your backend APIs.<br> <strong>Validation: </strong>Use libraries like express-validator to validate incoming requests, ensuring data consistency and security.</p><p>𝐄𝐫𝐫𝐨𝐫 𝐇𝐚𝐧𝐝𝐥𝐢𝐧𝐠: Set up error handling middleware to catch and handle errors that occur during request processing.<br> 𝐋𝐨𝐠𝐠𝐢𝐧𝐠 𝐚𝐧𝐝 𝐌𝐨𝐧𝐢𝐭𝐨𝐫𝐢𝐧𝐠: Implement logging to track server-side activities and monitor the performance of your backend application.</p><p>By following these steps, you’ll establish a solid foundation in MERN stack development, mastering the interaction between frontend and backend technologies. Stay tuned for my next post, where I’ll dive into API integration, explaining how to connect your frontend with your backend for seamless data flow and communication.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b81989226b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is React Routing?]]></title>
            <link>https://medium.com/@jssayushisharma98/what-is-react-routing-2540198540db?source=rss-872c0b1e4c3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2540198540db</guid>
            <category><![CDATA[react-route]]></category>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[react-routing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ayushi Sharma]]></dc:creator>
            <pubDate>Sun, 30 Jul 2023 12:47:00 GMT</pubDate>
            <atom:updated>2023-07-30T12:50:38.516Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHZH-Dgt-M0dLktC69CNSg.jpeg" /></figure><p>Routing in React enables the creation of single-page applications (SPAs) where content is dynamically loaded and updated without requiring a full page refresh. Instead of traditional server-side routing, React Routing manages routing on the client-side, providing a faster and more responsive user experience.</p><p><strong>Getting Started with React Routing:-</strong></p><p>To use React Routing, you need to install React Router, a widely-used routing library for React applications. You can install it using npm or yarn:</p><p><strong>npm install react-router-dom</strong></p><p>In your React application, wrap the main component with the <strong>&lt;BrowserRouter&gt;</strong> component provided by React Router to enable routing:</p><pre>import React from &#39;react&#39;;<br>import { BrowserRouter as Router, Route, Switch } from &#39;react-router-dom&#39;;<br><br>const App = () =&gt; {<br>  return (<br>    &lt;Router&gt;<br>      &lt;Switch&gt;<br>        {/* Define your routes here */}<br>        &lt;Route exact path=&quot;/&quot; component={Home} /&gt;<br>        &lt;Route path=&quot;/about&quot; component={About} /&gt;<br>        &lt;Route path=&quot;/contact&quot; component={Contact} /&gt;<br>        &lt;Route component={NotFound} /&gt;<br>      &lt;/Switch&gt;<br>    &lt;/Router&gt;<br>  );<br>};<br><br>export default App;</pre><p>Routes are defined using the &lt;Route&gt; component. In the example above, we have defined three routes — one for the home page (“/”), one for the about page (“/about”), and one for the contact page (“/contact”). The exact prop in the home route ensures that it only matches the exact URL path.</p><p><strong>Handling 404 — Page Not Found</strong></p><p>The last route in the switch is a catch-all route for any path that doesn’t match the defined routes. It acts as a 404 Not Found page and ensures that users get directed to a relevant page if they enter an incorrect URL.</p><p><strong>Navigating between Routes:-</strong></p><p>React Router provides a &lt;Link&gt; component that allows you to create links to different routes within your application. When a user clicks on a link, the URL changes, and the corresponding component is rendered without a full page refresh.</p><pre>import React from &#39;react&#39;;<br>import { Link } from &#39;react-router-dom&#39;;<br><br>const NavBar = () =&gt; {<br>  return (<br>    &lt;nav&gt;<br>      &lt;ul&gt;<br>        &lt;li&gt;<br>          &lt;Link to=&quot;/&quot;&gt;Home&lt;/Link&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;<br>          &lt;Link to=&quot;/about&quot;&gt;About&lt;/Link&gt;<br>        &lt;/li&gt;<br>        &lt;li&gt;<br>          &lt;Link to=&quot;/contact&quot;&gt;Contact&lt;/Link&gt;<br>        &lt;/li&gt;<br>      &lt;/ul&gt;<br>    &lt;/nav&gt;<br>  );<br>};<br><br>export default NavBar;</pre><p><strong>Nested Routes:-</strong></p><p>React Router allows you to nest routes within each other, which is useful for creating complex user interfaces with multiple levels of navigation.</p><pre>import React from &#39;react&#39;;<br>import { Route } from &#39;react-router-dom&#39;;<br><br>const App = () =&gt; {<br>  return (<br>    &lt;Router&gt;<br>      &lt;Switch&gt;<br>        &lt;Route exact path=&quot;/&quot; component={Home} /&gt;<br>        &lt;Route path=&quot;/about&quot; component={About} /&gt;<br>        &lt;Route path=&quot;/contact&quot; component={Contact} /&gt;<br>        &lt;Route path=&quot;/products&quot; component={Products}&gt;<br>          {/* Nested Routes */}<br>          &lt;Route path=&quot;/products/:id&quot; component={ProductDetails} /&gt;<br>        &lt;/Route&gt;<br>        &lt;Route component={NotFound} /&gt;<br>      &lt;/Switch&gt;<br>    &lt;/Router&gt;<br>  );<br>};<br><br>export default App;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2540198540db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-time Communication with Socket.IO in React and Node.js]]></title>
            <link>https://medium.com/@jssayushisharma98/real-time-communication-with-socket-io-in-react-and-node-js-bf1d387da23e?source=rss-872c0b1e4c3f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf1d387da23e</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ayushi Sharma]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 10:26:27 GMT</pubDate>
            <atom:updated>2023-07-23T10:33:31.570Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*GmaL2EkKwaf9gDp1DEQUnQ.jpeg" /></figure><p>Socket.IO is a JavaScript library that provides a simple yet powerful way to enable real-time, event-driven communication between clients and servers. It uses WebSocket, a protocol that allows full-duplex communication channels over a single TCP connection, ensuring low latency and minimal overhead.<br>Before diving into the implementation, ensure you have the following installed on your system:</p><ol><li>Node.js and npm (Node Package Manager)</li><li>A code editor (such as Visual Studio Code)</li><li>Basic knowledge of React and Node.js</li></ol><p>Let’s start by creating a new project step by step and setting up the server and client sides.</p><p>Step 1: Create a new directory for the project and initialize Node.js.</p><pre>mkdir socket-io-react-nodejs<br>cd socket-io-react-nodejs<br>npm init -y</pre><p>Step 2: Install necessary dependencies.</p><pre># For the server side<br>npm install express socket.io<br><br># For the client side<br>npx create-react-app client<br>cd client<br>npm install socket.io-client</pre><p>Setting up the Server: Now, let’s create a simple Node.js server with Express and Socket.IO.</p><pre>// server.js<br>const express = require(&#39;express&#39;);<br>const http = require(&#39;http&#39;);<br>const socketIO = require(&#39;socket.io&#39;);<br><br>const app = express();<br>const server = http.createServer(app);<br>const io = socketIO(server);<br><br>const port = process.env.PORT || 5000;<br><br>io.on(&#39;connection&#39;, (socket) =&gt; {<br>  console.log(&#39;A client connected.&#39;);<br><br>  socket.on(&#39;disconnect&#39;, () =&gt; {<br>    console.log(&#39;A client disconnected.&#39;);<br>  });<br>});<br><br>server.listen(port, () =&gt; {<br>  console.log(`Server is running on port ${port}`);<br>});</pre><p>This sets up a basic server using Express and Socket.IO. The server listens for client connections and disconnections.</p><p>Implementing the Client (React): Now, let’s build a simple React component that connects to the Socket.IO server.</p><p>In the App.js file inside the client/src directory, add the following code:</p><pre>// App.js<br>import React, { useEffect } from &#39;react&#39;;<br>import io from &#39;socket.io-client&#39;;<br><br>const socket = io(&#39;http://localhost:5000&#39;);<br><br>function App() {<br>  useEffect(() =&gt; {<br>    socket.on(&#39;connect&#39;, () =&gt; {<br>      console.log(&#39;Connected to server.&#39;);<br>    });<br><br>    socket.on(&#39;disconnect&#39;, () =&gt; {<br>      console.log(&#39;Disconnected from server.&#39;);<br>    });<br><br>    // Clean up the socket connection when the component unmounts<br>    return () =&gt; {<br>      socket.disconnect();<br>    };<br>  }, []);<br><br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;h1&gt;Real-time Communication with Socket.IO&lt;/h1&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>export default App;</pre><p>In this code, we import socket.io-client and connect to our server running on http://localhost:5000. We also set up event listeners for &#39;connect&#39; and &#39;disconnect&#39; events, allowing us to see when the client successfully connects and disconnects from the server.</p><p>Running the Application:</p><pre>#Command for starting the server<br>node server.js<br><br>#Command for starting the client<br>npm start</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf1d387da23e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>