<?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: Antoine</title>
    <description>The latest articles on DEV Community by Antoine (@atduong).</description>
    <link>https://dev.to/atduong</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%2F824848%2F4ee9be4b-1f44-4c13-bb35-5c2e12565a46.png</url>
      <title>DEV Community: Antoine</title>
      <link>https://dev.to/atduong</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/atduong"/>
    <language>en</language>
    <item>
      <title>TinyHow2: GitHub Page hosting for React (with custom domain)</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Fri, 06 May 2022 15:15:32 +0000</pubDate>
      <link>https://dev.to/atduong/tinyhow2-github-page-hosting-for-react-with-custom-domain-53io</link>
      <guid>https://dev.to/atduong/tinyhow2-github-page-hosting-for-react-with-custom-domain-53io</guid>
      <description>&lt;h2&gt;The requirements:&lt;/h2&gt;

&lt;p&gt;This short instruction is written under the following assumptions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You have already familiarized yourself with GitHub workflow, &lt;a href="https://www.freecodecamp.org/news/what-exactly-is-node-js-ae36e97449f5/"&gt;Node.js&lt;/a&gt;, and &lt;a href="https://nodejs.org/en/knowledge/getting-started/npm/what-is-npm/"&gt;Npm&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Your app is neatly stored on a GitHub repository that you own.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can work the console/ terminal window.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You're in TLDR mode and you don't have time for lengthy technical instruction.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If that's not you, please refer to this &lt;a href="https://github.com/gitname/react-gh-pages"&gt;detailed instruction&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;The setting:&lt;/h2&gt;

&lt;p&gt;a) You have just made your last commit to the dev-branch of your first React (JS) app on GitHub.&lt;/p&gt;

&lt;p&gt;b) You are itching to deploy it using &lt;a href="https://docs.github.com/en/pages/getting-started-with-github-pages/about-github-pages"&gt;GitHub Page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;c) You have already grabbed a custom domain with a neat name. It's being hosted by GoDaddy, Bluehost, Namecheap or a similar (domain) hosting service.&lt;/p&gt;

&lt;h2&gt;The approach:&lt;/h2&gt;

&lt;p&gt;1) Open the console/ terminal window, make sure that you're inside the folder which contains your React project and run:&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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Notes: Open &lt;code&gt;package.json&lt;/code&gt; and make sure that you have the following dependency installed for everything mentioned herein to work properly:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "devDependencies": {
    "gh-pages": "^3.2.3"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2) &lt;br&gt;
2a) Open &lt;code&gt;package.json&lt;/code&gt;, add &lt;code&gt;homepage&lt;/code&gt; above your project name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  "homepage": "https://www.your-custom-domain-name.whatever",
  "name": "your-react-project-name",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2b) Add a CNAME file in the public folder with a single entry of &lt;code&gt;www.your-custom-domain-name.whatever&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hAOTYm8w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2qlgq4wbvwi09h8qaeo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hAOTYm8w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v2qlgq4wbvwi09h8qaeo.png" alt="CNAME file" width="187" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Scroll down to the &lt;code&gt;script&lt;/code&gt; section of &lt;code&gt;package.json&lt;/code&gt; and make sure to add the following:&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",
  "start": "react-scripts start",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4) Configure your custom domain from the side of &lt;a href="https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site"&gt;your hosting service&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Simply locate &lt;code&gt;Advanced DNS&lt;/code&gt; tab/option on your domain hosting dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create the following A records:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   185.199.108.153
   185.199.109.153
   185.199.110.153
   185.199.111.153
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a CNAME record with: &lt;code&gt;Host: www&lt;/code&gt; and &lt;code&gt;Value: your-github-username.github.io&lt;/code&gt;. Then save everything.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Notes: These changes can take a while to be applied.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;5) Open the console/ terminal window again and run:&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;



&lt;p&gt;6) Get on github.com and navigate to the repository to be deployed from, locate the &lt;code&gt;Settings&lt;/code&gt; tab and click on &lt;code&gt;Pages&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;7) Select &lt;code&gt;Branch: gh-pages&lt;/code&gt; as the source.&lt;/p&gt;

&lt;p&gt;8) Make sure that your custom domain pass the DNS check and don't forget to check &lt;code&gt;Enforce HTTPS&lt;/code&gt; afterward. If everything goes well, you should see:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L4ztuuOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3acbwqi2wasqbfmtp73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L4ztuuOA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3acbwqi2wasqbfmtp73.png" alt="Successfully hosting React App on custom domain using GitHub Page" width="880" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;BannerPic by &lt;a href="https://unsplash.com/photos/mJLIzYB8brw?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditShareLink"&gt;Martin Katler&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>2022</category>
      <category>react</category>
      <category>github</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Learning to swim again.</title>
      <dc:creator>Antoine</dc:creator>
      <pubDate>Wed, 09 Mar 2022 09:29:05 +0000</pubDate>
      <link>https://dev.to/atduong/learning-to-swim-again-57e0</link>
      <guid>https://dev.to/atduong/learning-to-swim-again-57e0</guid>
      <description>&lt;p&gt;&lt;em&gt;“Choose a safe spot where your feet can touch the sand and move as I showed you”&lt;/em&gt;, said my father to six-year-old me when we first went to the beach. It was just around 5:30 AM, and my father had already done a couple of warm-up laps along the shoreline. It took me a while to shake myself awake and trod down the gently sloped dune, shivering with each step as I waded into the chilly emerald water. Before my mind could conjure up more unpleasant thoughts, I quickly dunked my head under the water and started paddling with my feet and arms while my father remained nearby to offer assistance and words of encouragement. After a month of daily practice, my disliking of sea swimming gradually disappeared while I enjoyed every second at &lt;a href="https://vinpearl.com/vi/kinh-nghiem-du-lich-bai-bien-bac-my-an-thien-duong-bien-da-nang"&gt;the beach&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a-fQVrLu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72znqkuxyw61636q842v.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a-fQVrLu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72znqkuxyw61636q842v.jpg" alt="0500AM in the tropical summer" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Earlier this year, I have pushed aside any notion of hesitation to take the plunge into a career in professional Web Development. I have spent a considerable amount of time online for both work and entertainment without fully understanding the inner working of websites and databases. I often marveled at the websites and applications which were so well-designed to make my life easier. Over time, I became more curious about how to build such products. I chose the boot camp route because it is well-suited for my propensity to learn through hands-on approaches.&lt;/p&gt;

&lt;p&gt;From my perspective, the learning curve is not much different from learning to swim. Boot camp projects are the “safe spots” where my “feet can touch the sand”. I can code in a constructive environment with supportive teachers (and classmates) never seem out of reach. There is still the occasional fleeting moment of panic when something didn’t work the way it’s supposed to or when my mind goes blank in the face of a complex problem.&lt;/p&gt;

&lt;p&gt;Daily practicing can make all the difference. I learn to enjoy the workflow, I am in tune with the software development culture, I appreciate the prospect of working from home, and most of all, I am glad to be in a career with so much room for innovation. As someone who loves to solve practical problems and building things, I am slowly building my skills and filling my GitHub repositories with cool/ quirky projects.&lt;/p&gt;

&lt;p&gt;My biggest motivation has always been my family, especially my spouse who sacrifices three months of her time to take care of our children so I can fully immerse myself in the accelerated learning path. She understands my love for technical problems and technology. Without her help, I could not have pursued a career in Web Development and explored my interests in Web3.&lt;/p&gt;

&lt;p&gt;This is the first online blog that I have ever written as someone who often prefers to think and build. I am glad if anyone finds it helpful.&lt;/p&gt;

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