<?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: JerryWu</title>
    <description>The latest articles on DEV Community by JerryWu (@jerrywu1998).</description>
    <link>https://dev.to/jerrywu1998</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%2F1108726%2F3d6e6599-10ce-41ac-a030-15538e781511.png</url>
      <title>DEV Community: JerryWu</title>
      <link>https://dev.to/jerrywu1998</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jerrywu1998"/>
    <language>en</language>
    <item>
      <title>Integrating Google Login System in React</title>
      <dc:creator>JerryWu</dc:creator>
      <pubDate>Tue, 08 Aug 2023 13:00:52 +0000</pubDate>
      <link>https://dev.to/jerrywu1998/integrating-google-login-system-in-react-cek</link>
      <guid>https://dev.to/jerrywu1998/integrating-google-login-system-in-react-cek</guid>
      <description>&lt;p&gt;Integrating third-party authentication systems, like Google's OAuth, into a React app can streamline the user registration and login process. In this guide, we'll walk through the steps to implement Google Login in a React application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
A React application set up. &lt;/li&gt;
&lt;li&gt;
A Google Developers Console account.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step-by-Step Guide:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Setting Up Google OAuth2.0:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to the Google Developers Console.&lt;/li&gt;
&lt;li&gt;Create a new project.&lt;/li&gt;
&lt;li&gt;Navigate to "Credentials" and click on "Create Credentials" -&amp;gt; "OAuth 2.0 Client ID".&lt;/li&gt;
&lt;li&gt;Choose "Web application". You'll be prompted to set up your OAuth 2.0 credentials. Make sure you specify the correct redirect URIs.&lt;/li&gt;
&lt;li&gt;Once done, note down the Client ID.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Setting Up the React App:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Installing Necessary Packages:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @react-oauth/google axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Implementing Google Login:
&lt;/h3&gt;

&lt;p&gt;Follow the React code example provided earlier in our discussion, which demonstrates how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use the useGoogleLogin hook for Google authentication.&lt;/li&gt;
&lt;li&gt;Save the user's authentication status in localStorage to - persist their login state even after a page refresh.&lt;/li&gt;
&lt;li&gt;Fetch the user's profile using their access token.&lt;/li&gt;
&lt;li&gt;Provide a logout functionality using googleLogout.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security Considerations:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;While the clientId is public and is used in the frontend, ensure you never expose any sensitive information like the secret key.&lt;/li&gt;
&lt;li&gt;In a production app, consider handling authentication and session management on the server-side, passing only necessary non-sensitive data to the client.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;Implementing Google Login in a React application enhances the user experience by offering a quick and familiar way to sign in. This guide provides a straightforward method to achieve this. Always ensure you handle user data with care, respect privacy, and maintain the security of your applications.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Guide to Using colorama and pygame in Python CLI</title>
      <dc:creator>JerryWu</dc:creator>
      <pubDate>Tue, 25 Jul 2023 13:47:21 +0000</pubDate>
      <link>https://dev.to/jerrywu1998/a-guide-to-using-colorama-and-pygame-in-python-cli-1n6e</link>
      <guid>https://dev.to/jerrywu1998/a-guide-to-using-colorama-and-pygame-in-python-cli-1n6e</guid>
      <description>&lt;ol&gt;
&lt;li&gt;colorama&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Colorama is a Python library used to add colors to terminal text. It simplifies the use of ANSI color codes to colorize console output and works seamlessly on Windows, macOS, and Linux.&lt;/p&gt;

&lt;p&gt;To install colorama, you can use pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install colorama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple use of colorama is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from colorama import Fore, Back, Style

print(Fore.RED + 'This is red text')
print(Back.GREEN + 'This is text with a green background')
print(Style.RESET_ALL)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;pygame&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Pygame is a set of Python modules designed for creating video games. It includes computer graphics and sound libraries.&lt;/p&gt;

&lt;p&gt;To install pygame, you can use pip:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pygame
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A simple use of pygame for playing sound effects is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pygame

# Initialize pygame mixer
pygame.mixer.init()

# Load and play a sound
sound = pygame.mixer.Sound('path/to/your/sound/file')
sound.play()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will load a sound file from the provided path and play it. Note that pygame supports different types of sound files like .wav, .ogg, .mp3, etc.&lt;/p&gt;

&lt;p&gt;Remember to call pygame.mixer.init() before using the mixer, as this function will initialize the mixer module for Sound loading and playback.&lt;/p&gt;

&lt;p&gt;In conclusion, colorama is a simple yet powerful tool for adding color to your Python applications, transforming plain console output into a vibrant, visually engaging display. On the other hand, pygame is an incredibly potent library, capable of handling graphics, sound, and much more. Its utility in adding sound effects and music, as demonstrated in this guide, is just a small glimpse into its extensive capabilities.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to React Bootstrap</title>
      <dc:creator>JerryWu</dc:creator>
      <pubDate>Mon, 03 Jul 2023 14:36:30 +0000</pubDate>
      <link>https://dev.to/jerrywu1998/an-introduction-to-react-bootstrap-3lm5</link>
      <guid>https://dev.to/jerrywu1998/an-introduction-to-react-bootstrap-3lm5</guid>
      <description>&lt;p&gt;As we set out to build our React applications, one common challenge we face is choosing a UI library. While there are numerous libraries available to help us create beautiful, responsive user interfaces, few offer the extensive set of components and styles as React Bootstrap does.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is React Bootstrap?
&lt;/h2&gt;

&lt;p&gt;React Bootstrap is a powerful library that merges Bootstrap, a widely-used CSS framework, with React, a JavaScript library renowned for building impressive user interfaces. React Bootstrap essentially reimplements Bootstrap's components as React components, replacing the jQuery and JavaScript that Bootstrap typically relies on with state and props in React.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Use React Bootstrap?
&lt;/h2&gt;

&lt;p&gt;React Bootstrap has several key advantages:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Easier integration: Because React Bootstrap components are written in React, it simplifies the incorporation of Bootstrap in your React projects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React-centric: It allows developers to use Bootstrap in a 'React way', meaning you can manipulate the UI using state and props, which aligns better with the React philosophy.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Modularity: React Bootstrap allows you to import only the components you need, rather than the whole of Bootstrap, leading to leaner, more efficient code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Interoperability: You can use it alongside other UI libraries or with a custom-made UI, providing flexibility in design and implementation.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Getting Started with React Bootstrap
&lt;/h2&gt;

&lt;p&gt;To install React Bootstrap:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-bootstrap bootstrap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Import the Bootstrap CSS into your application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'bootstrap/dist/css/bootstrap.min.css';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, you can import and use Bootstrap components in your React app:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Button from 'react-bootstrap/Button';

// Your component
function MyComponent() {
  return (
    &amp;lt;Button variant="primary"&amp;gt;Primary Button&amp;lt;/Button&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;React Bootstrap is a fantastic tool that allows us to leverage the power of Bootstrap while maintaining the React-centric approach. By offering a wide range of customizable components, it enables developers to create user-friendly and appealing UIs efficiently. React Bootstrap is truly a booster for your React projects. Happy coding!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fetch Data from Public API and Deploying React to Github</title>
      <dc:creator>JerryWu</dc:creator>
      <pubDate>Tue, 27 Jun 2023 16:17:09 +0000</pubDate>
      <link>https://dev.to/jerrywu1998/fetch-data-from-public-api-and-deploying-react-to-github-34o3</link>
      <guid>https://dev.to/jerrywu1998/fetch-data-from-public-api-and-deploying-react-to-github-34o3</guid>
      <description>&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In modern web development, fetching data from public APIs and deploying React applications to platforms like GitHub have become common practices. In this article, we will explore two important aspects: fetching data from a public API using Axios and deploying a React application to GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Axios:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installing Axios&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fetching Data with Axios&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import axios from 'axios';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the component, you can use Axios to make a GET request to the desired public API. For example, let's fetch a data from the public API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
  const fetchData = async () =&amp;gt; {
    try {
      const response = await axios.get('https://example-api');
      console.log(response.data);
    } catch (error) {
      console.error('Error fetching data:', error);
    }
  };

  fetchData();
}, []);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In JavaScript, the async keyword is used to define asynchronous functions, and the try-catch block is used to handle potential errors. In the provided code, async is used to define the fetchData function, which makes an asynchronous Axios GET request. The try block contains the code that may throw an error, and if an error occurs, it is caught in the catch block, where we can handle it appropriately. These keywords enable more robust error handling and asynchronous operations in JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploying React to Github&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install gh-pages as a dev dependency via npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install gh-pages --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the package.json file, add a homepage property that follows this structure: http://{github-username}.github.io/{repo-name}&lt;br&gt;
example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "name": "my-personal-website",
  "version": "0.1.0",
  "private": true,
  "homepage": "http://JerryWu1998.github.io/my-personal-website",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the package.json file, add the following commands to the scripts property:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"predeploy" : "npm run build",
"deploy" : "gh-pages -d build",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, commit our changes and push the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git add .
git commit -m "message"
git push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy our React application by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Pros and Cons of REACT</title>
      <dc:creator>JerryWu</dc:creator>
      <pubDate>Mon, 26 Jun 2023 17:15:11 +0000</pubDate>
      <link>https://dev.to/jerrywu1998/pros-and-cons-of-react-532f</link>
      <guid>https://dev.to/jerrywu1998/pros-and-cons-of-react-532f</guid>
      <description>&lt;p&gt;React, a widely used JavaScript library for building user interfaces, is highly regarded for its efficiency, reusability, and flexibility. Let's explore the advantages and disadvantages of developing a React app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages of React:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Component-based architecture: React employs a modular approach, breaking down the user interface into reusable components. This facilitates better code organization, simplified maintenance, and accelerated development. Developers can create self-contained components with their own logic and styling, facilitating the construction of intricate user interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual DOM: React employs a virtual DOM, which is a lightweight representation of the actual DOM. This allows React to efficiently update and render only the necessary components when changes occur, resulting in enhanced performance and faster user interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reusability and scalability: React promotes code reusability, enabling developers to create component libraries that can be shared across multiple projects. This reusability saves development time and effort, while also facilitating scalability as applications can be easily extended and modified.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One-way data flow: React adheres to a unidirectional data flow, where data flows from parent components to child components. This simplifies understanding of how data changes propagate through the application, making debugging easier and reducing unexpected side effects.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Strong community and ecosystem: React boasts a large and active community, providing access to a wealth of resources, tutorials, and libraries. This enables developers to quickly find solutions to problems and stay updated with best practices, fostering a supportive environment.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Disadvantages of React:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Complexity: React has a steep learning curve for developers new to component-based architecture and virtual DOM. JSX, combining JavaScript and HTML, can be complex for those unfamiliar with it. The official documentation may be challenging for beginners, lacking clarity and ease of navigation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Boilerplate code: React projects often require the setup of additional tools and build configurations. This initial setup process can be time-consuming and may involve writing boilerplate code. Nonetheless, tools like Create React App have been developed to streamline this process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Performance concerns: While React's virtual DOM provides performance benefits, complex React applications with numerous components and frequent updates may encounter performance issues. Careful optimization and performance tuning may be necessary in such cases to ensure optimal performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In conclusion, React is a powerful JavaScript library for building user interfaces, known for its component-based architecture, virtual DOM, and code reusability. It offers scalability and efficiency. However, developers should consider the learning curve, JSX complexity, and performance when using React. With the right knowledge, React can be a valuable tool for high-quality web applications.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
