<?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: Dhyanesh Siddhartha</title>
    <description>The latest articles on DEV Community by Dhyanesh Siddhartha (@dhyaneshsiddhartha15).</description>
    <link>https://dev.to/dhyaneshsiddhartha15</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1424646%2F0ad88af3-cc3f-481a-9b71-efa0bb4acf44.jpeg</url>
      <title>DEV Community: Dhyanesh Siddhartha</title>
      <link>https://dev.to/dhyaneshsiddhartha15</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhyaneshsiddhartha15"/>
    <language>en</language>
    <item>
      <title>10 Best Websites for practicing Data Structures and Algorithms (DSA):</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Thu, 02 May 2024 04:50:04 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/10-best-websites-for-practicing-data-structures-and-algorithms-dsa-3n39</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/10-best-websites-for-practicing-data-structures-and-algorithms-dsa-3n39</guid>
      <description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;LeetCode&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; LeetCode offers a vast array of problems categorized by difficulty level and topic, with the ability to run your code against multiple test cases. It's great for improving coding skills and preparing for interviews.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://leetcode.com/"&gt;LeetCode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;HackerRank&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; HackerRank provides a wide range of DSA problems along with contests and challenges to improve coding skills. It's popular for its practical coding challenges and interview preparation resources.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.hackerrank.com/domains/tutorials/10-days-of-javascript"&gt;HackerRank&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CodeSignal&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; CodeSignal offers a platform for DSA practice, as well as interview preparation with real-world questions. It's known for its comprehensive approach to coding assessments and skill improvement.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codesignal.com/"&gt;CodeSignal&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;GeeksforGeeks&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; GeeksforGeeks is known for its vast collection of DSA tutorials and articles. It also offers a practice section with a wide range of problems for hands-on practice. It's a comprehensive resource for learning and practicing DSA.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/"&gt;GeeksforGeeks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;CodeChef&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; CodeChef provides monthly coding contests along with a practice section for DSA and competitive programming. It's popular for its challenging contests and strong community of competitive programmers.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.codechef.com/"&gt;CodeChef&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;TopCoder&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; TopCoder offers algorithmic challenges and contests for practicing DSA. It's known for its challenging problems and competitive environment, making it a great platform for experienced programmers.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.topcoder.com/"&gt;TopCoder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Project Euler&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; Project Euler focuses on mathematical and computational problems that require the use of DSA concepts. It's popular among math enthusiasts and programmers looking for intellectually stimulating challenges.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://projecteuler.net/"&gt;Project Euler&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Interviewbit&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; Interviewbit provides a curated set of DSA problems specifically tailored for interview preparation. It's a great resource for job seekers looking to ace technical interviews.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.interviewbit.com/"&gt;Interviewbit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Spoj (Sphere Online Judge)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; Spoj offers a collection of algorithmic problems to solve online, with a focus on competitive programming. It's popular among competitive programmers for its extensive problem archive and challenging problems.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.spoj.com/"&gt;Spoj&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;AtCoder&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Why to Use:&lt;/strong&gt; AtCoder is a platform for practicing competitive programming with regular contests and a large problem archive. It's popular for its well-organized contests and high-quality problems.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://atcoder.jp/"&gt;AtCoder&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>dsa</category>
      <category>learning</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>How to add LOGIN with Google in your WEBAPPS using Passport</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Sat, 20 Apr 2024 10:18:09 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/how-to-add-login-with-google-in-your-webapps-using-passport-36i1</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/how-to-add-login-with-google-in-your-webapps-using-passport-36i1</guid>
      <description>&lt;p&gt;&lt;strong&gt;_To add Google login to your web application using Passport.js, you'll need to follow these general steps:&lt;br&gt;
_&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set up a Google Developer Console project:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the Google Developer Console (&lt;a href="https://console.developers.google.com/"&gt;https://console.developers.google.com/&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Create a new project.&lt;/li&gt;
&lt;li&gt;Navigate to "OAuth consent screen" under "OAuth 2.0 Client IDs" and configure your OAuth consent screen with the necessary details.&lt;/li&gt;
&lt;li&gt;Go to "Credentials" and create a new OAuth 2.0 Client ID. Select "Web application" as the application type.&lt;/li&gt;
&lt;li&gt;Add the authorized redirect URI for your application (e.g., &lt;a href="http://localhost:3000/auth/google/callback"&gt;http://localhost:3000/auth/google/callback&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install Passport and Passport Google OAuth Strategy:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm &lt;span class="nb"&gt;install &lt;/span&gt;passport passport-google-oauth20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Configure Passport in your application:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Initialize Passport and set up the Google OAuth 2.0 Strategy in your server file (e.g., &lt;code&gt;app.js&lt;/code&gt; or &lt;code&gt;server.js&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Use your Google Client ID and Client Secret obtained from the Google Developer Console.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;passport&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;passport&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;GoogleStrategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;passport-google-oauth20&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;Strategy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

   &lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GoogleStrategy&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;clientID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;GOOGLE_CLIENT_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;clientSecret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;GOOGLE_CLIENT_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;callbackURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/google/callback&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
   &lt;span class="p"&gt;},&lt;/span&gt;
   &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;accessToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;refreshToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="c1"&gt;// Save user profile to your database or retrieve an existing user&lt;/span&gt;
       &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;profile&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}));&lt;/span&gt;

   &lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;serializeUser&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deserializeUser&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;user&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set up routes for authentication:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Define routes for handling Google authentication and callback.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/google&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authenticate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;scope&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;profile&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}));&lt;/span&gt;

   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/auth/google/callback&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;authenticate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;google&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;failureRedirect&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
       &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
           &lt;span class="c1"&gt;// Successful authentication, redirect home.&lt;/span&gt;
           &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Protect your routes:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Use Passport's &lt;code&gt;authenticate&lt;/code&gt; method to protect routes that require authentication.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;ensureAuthenticated&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&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;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isAuthenticated&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;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="p"&gt;}&lt;/span&gt;
       &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/profile&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ensureAuthenticated&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&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;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;profile&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;user&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Configure sessions (optional):&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If you want to use sessions to persist authentication state, configure Express session middleware and Passport session middleware.
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;session&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
       &lt;span class="na"&gt;secret&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;your_secret_key&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;resave&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="na"&gt;saveUninitialized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
   &lt;span class="p"&gt;}));&lt;/span&gt;

   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;passport&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;session&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Add a "Login with Google" button to your frontend:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a button that redirects the user to &lt;code&gt;/auth/google&lt;/code&gt; to initiate the OAuth flow.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Run your application:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start your server and test the Google login functionality.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>devops</category>
      <category>frontend</category>
    </item>
    <item>
      <title>How to Contribute to Open-Source Projects – Git &amp; GitHub Workflow for Beginner s</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Thu, 18 Apr 2024 15:40:24 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/how-to-contribute-to-open-source-projects-git-github-workflow-for-beginner-s-2pi6</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/how-to-contribute-to-open-source-projects-git-github-workflow-for-beginner-s-2pi6</guid>
      <description>&lt;p&gt;Contributing to open-source projects can be a rewarding way to learn, collaborate, and give back to the community. Here's a basic workflow using Git and GitHub for beginners:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Set Up Git and GitHub
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install Git: Download and install Git from &lt;a href="https://git-scm.com/"&gt;git-scm.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Create a GitHub account: Go to &lt;a href="https://github.com/"&gt;github.com&lt;/a&gt; and sign up for an account.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 2: Configure Git
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Set your username: Open Git Bash (Windows) or Terminal (macOS/Linux) and set your username using &lt;code&gt;git config --global user.name "Your Name"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set your email address: Set your email address using &lt;code&gt;git config --global user.email "youremail@example.com"&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 3: Fork a Repository
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Find a project you want to contribute to on GitHub.&lt;/li&gt;
&lt;li&gt;Click on the "Fork" button in the top right corner of the repository's page to create a copy (fork) of the repository to your GitHub account.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 4: Clone the Repository
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Clone your forked repository to your local machine using &lt;code&gt;git clone https://github.com/your-username/repository.git&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the cloned repository using &lt;code&gt;cd repository&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 5: Set Up Remote
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Add the original repository as a remote named "upstream" using &lt;code&gt;git remote add upstream https://github.com/original-owner/repository.git&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 6: Create a Branch
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create a new branch for your work using &lt;code&gt;git checkout -b your-branch-name&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Make your changes to the code in your branch.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 7: Commit Changes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Stage your changes using &lt;code&gt;git add .&lt;/code&gt; (for all changes) or &lt;code&gt;git add filename&lt;/code&gt; (for specific files).&lt;/li&gt;
&lt;li&gt;Commit your changes using &lt;code&gt;git commit -m "Your commit message"&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 8: Push Changes
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Push your branch to your fork on GitHub using &lt;code&gt;git push origin your-branch-name&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 9: Create a Pull Request (PR)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Go to your fork on GitHub and you should see a prompt to create a PR for your recently pushed branch.&lt;/li&gt;
&lt;li&gt;Click on "Compare &amp;amp; pull request" to open a new PR.&lt;/li&gt;
&lt;li&gt;Provide a title and description for your PR, and click on "Create pull request".&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 10: Review and Merge
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Wait for the project maintainers to review your PR. They may ask for changes or provide feedback.&lt;/li&gt;
&lt;li&gt;Once your PR is approved, it will be merged into the original repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Step 11: Sync Your Fork (Optional)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;To keep your fork up to date with the original repository, fetch the changes from the upstream repository using &lt;code&gt;git fetch upstream&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Merge the changes into your local branch using &lt;code&gt;git merge upstream/main&lt;/code&gt; (assuming the main branch is used) or &lt;code&gt;git rebase upstream/main&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Push the merged changes to your fork using &lt;code&gt;git push origin main&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's a basic workflow for contributing to open-source projects using Git and GitHub. Remember to always follow the project's contribution guidelines and be respectful of the community.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>coding</category>
      <category>github</category>
    </item>
    <item>
      <title>JAVASCRIPT TUTORIAL FOR BEGINNERS</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Wed, 17 Apr 2024 17:47:05 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/javascript-tutorial-for-beginners-4bja</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/javascript-tutorial-for-beginners-4bja</guid>
      <description>&lt;p&gt;🚀 &lt;strong&gt;Level Up Your JavaScript Skills!&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;p&gt;Hey Dev community! If you're looking to master JavaScript, I highly recommend checking out this incredible tutorial series: &lt;a href="https://www.codehelp.in/tutorial/javascript/java-script-a-beginner-s-guide-to-programming-magic-1"&gt;"JavaScript: A Beginner's Guide to Programming Magic"&lt;/a&gt;. It's packed with clear explanations and hands-on examples that make learning JavaScript a breeze. Whether you're just starting or want to deepen your understanding, this tutorial is a gem! 💎✨ #JavaScript #LearnToCode #ProgrammingMagic #DevCommunity&lt;/p&gt;




</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>devops</category>
      <category>career</category>
    </item>
    <item>
      <title>Block Cipher Design Principles</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Wed, 17 Apr 2024 16:56:40 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/block-cipher-design-principles-1dk7</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/block-cipher-design-principles-1dk7</guid>
      <description>&lt;p&gt;Key Size: The key size should be large enough to prevent brute-force attacks. A larger key size means that there are more possible keys, making it harder for an attacker to guess the correct one. A key size of 128 bits is considered to be secure for most applications.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>security</category>
      <category>github</category>
      <category>startup</category>
    </item>
    <item>
      <title>TAN STACK QUERY(REACT JS)</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Wed, 17 Apr 2024 15:55:58 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/tan-stack-queryreact-js-4h84</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/tan-stack-queryreact-js-4h84</guid>
      <description>&lt;p&gt;Tanstack Query is a powerful data fetching and caching library for React applications. It simplifies the process of fetching, caching, and updating data from your API, providing a seamless experience for developers. &lt;/p&gt;

&lt;p&gt;You should consider using Tanstack Query in your project because it offers several benefits, such as:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Declarative Data Fetching&lt;/strong&gt;: Tanstack Query allows you to declare your data dependencies in a declarative way, making your code more readable and maintainable.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automatic Caching&lt;/strong&gt;: It automatically caches the fetched data, reducing the number of unnecessary network requests and improving the performance of your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimistic Updates&lt;/strong&gt;: Tanstack Query supports optimistic updates, allowing you to update your UI immediately and then sync the changes with the server in the background.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Server-Side Rendering&lt;/strong&gt;: It provides support for server-side rendering, ensuring that your application performs well and provides a good user experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Overall, Tanstack Query can significantly simplify the data fetching and management process in your React project, making it a valuable addition to your toolkit.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
    <item>
      <title>Qualities of Bad Code</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Wed, 17 Apr 2024 08:00:40 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/qualities-of-bad-code-5760</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/qualities-of-bad-code-5760</guid>
      <description>&lt;ol&gt;
&lt;li&gt;Excessive use of  If-else in the code 
2.Cyclomatic Complexity 
3.Avoid Type checking (Instance Of)
4.Downcasting &lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Node js AsyncHandler</title>
      <dc:creator>Dhyanesh Siddhartha</dc:creator>
      <pubDate>Sun, 14 Apr 2024 19:13:33 +0000</pubDate>
      <link>https://dev.to/dhyaneshsiddhartha15/node-js-asynchandler-o8f</link>
      <guid>https://dev.to/dhyaneshsiddhartha15/node-js-asynchandler-o8f</guid>
      <description>&lt;p&gt;Tired of writing try and catch block in your routes and controllers while Backend Development??Here ,,*&lt;strong&gt;&lt;em&gt;In a Node.js project, the async-handler package is often used to handle asynchronous operations in routes or controllers. It's particularly useful for handling asynchronous functions in Express.js middleware and route handlers&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
