<?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>Forem: Navdeep Singh</title>
    <description>The latest articles on Forem by Navdeep Singh (@navdeepsingh).</description>
    <link>https://forem.com/navdeepsingh</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%2F78267%2F3cd4329c-8d72-4a68-b3c3-a7a87dbb9599.jpg</url>
      <title>Forem: Navdeep Singh</title>
      <link>https://forem.com/navdeepsingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/navdeepsingh"/>
    <language>en</language>
    <item>
      <title>React Calculator Component</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Sun, 28 Feb 2021 13:18:01 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/react-calculator-component-2dhi</link>
      <guid>https://forem.com/navdeepsingh/react-calculator-component-2dhi</guid>
      <description>&lt;p&gt;Need help to review this code, written by me. &lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/react-calculator-wgerv"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>help</category>
      <category>react</category>
      <category>usereducer</category>
    </item>
    <item>
      <title>Published Isolated, Reusable - React Component 🎉🎉 </title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Fri, 20 Nov 2020 11:17:41 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/published-isolated-reusable-react-component-54m0</link>
      <guid>https://forem.com/navdeepsingh/published-isolated-reusable-react-component-54m0</guid>
      <description>&lt;p&gt;Happy to announce that I published my first Isolated &amp;amp; Reusable React Component on Bit.dev platform 🎉🎉🎉🎉.&lt;/p&gt;

&lt;p&gt;Here is the link &lt;a href="https://bit.dev/navdeepsingh/react-components/ui/day-night-switcher"&gt;DayNightSwitcher&lt;/a&gt;.&lt;br&gt;
Description: The accessible day-night theme switcher react component.&lt;/p&gt;

&lt;p&gt;Already implemented on my newly developed website which crafted using Tech Stack: Gatsby &amp;amp; Netlify CMS &lt;a href="https://navdeepsingh.in/"&gt;https://navdeepsingh.in/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the screencast. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lBfRoZMQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bqivtn1vacnqhxyv7v9m.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lBfRoZMQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bqivtn1vacnqhxyv7v9m.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope it will serve the purpose. The benefit of the loosely coupled component is that we can do testing easily and also state management can be done with a personal choice like ContextAPI, Redux, MobX, etc.&lt;/p&gt;

&lt;p&gt;Looking for your comments!!&lt;/p&gt;

</description>
      <category>react</category>
      <category>typescript</category>
      <category>javascript</category>
      <category>a11y</category>
    </item>
    <item>
      <title>A11y Workshop Activities - Solution</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Mon, 27 Jul 2020 10:24:14 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/a11y-workshop-activities-solution-2e8</link>
      <guid>https://forem.com/navdeepsingh/a11y-workshop-activities-solution-2e8</guid>
      <description>&lt;p&gt;All the solution for the recently hosted A11y Workshop are deployed at this link&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://workshop-a11y-solution.vercel.app/"&gt;https://workshop-a11y-solution.vercel.app/&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are a total of 8 activities, go on each one by one, and use just a keyboard instead of a mouse, All activities are accessible using Keyboard and Screen-readers.&lt;/p&gt;

&lt;p&gt;Hope you will like it &amp;amp; remember accessibility is for everybody.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>workshop</category>
    </item>
    <item>
      <title>Hosting Workshop at dream platform</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Thu, 23 Jul 2020 08:25:37 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/hosting-workshop-at-dream-platform-4e7n</link>
      <guid>https://forem.com/navdeepsingh/hosting-workshop-at-dream-platform-4e7n</guid>
      <description>&lt;p&gt;I am super excited to host a workshop based on web accessibility on my dream platform CodeNewbie in collaboration with DEV.to &lt;/p&gt;

&lt;p&gt;Timing: &lt;strong&gt;24th July: 1:00 pm UTC&lt;/strong&gt;&lt;br&gt;
Venue: &lt;em&gt;Zoom Link (will be shared by organizers)&lt;/em&gt;&lt;br&gt;
Duration: &lt;strong&gt;2-3 hours&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gonna give hands-on experience on basics of web accessibility aka a11y (a-total 11 chars-y) and my participants will walk away understanding accessibility guidelines, tools, and testing.&lt;/p&gt;

&lt;p&gt;Understand what is ARIA-* in your html5 code and what is its use and many more. Our focus in the workshop is to make web site operable i.e it can be used by assistive technologies like screen-readers and make it keyboard accessible.&lt;/p&gt;

&lt;p&gt;Hola!! &lt;/p&gt;

&lt;p&gt;Many many things at the workshop. See you there.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>performance</category>
      <category>workshop</category>
    </item>
    <item>
      <title>Question: Gatsby + Wordpress Deployment</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Fri, 24 Apr 2020 11:52:44 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/gatsby-wordpress-production-deployment-2fjb</link>
      <guid>https://forem.com/navdeepsingh/gatsby-wordpress-production-deployment-2fjb</guid>
      <description>&lt;p&gt;For Gatsby + Wordpress website &lt;em&gt;production&lt;/em&gt; deployment, I have a question. Suppose I deployed Gatsby website on Netlify (Fastest to use) and Wordpress website on AWS EC2. &lt;/p&gt;

&lt;p&gt;In production, API must be from a secure source, like from HTTPS. Either it gives warning error.&lt;/p&gt;

&lt;p&gt;So my question is: Domain is being set up at Netlify as front end. For Wordpress API, how to install valid SSL Certificate on EC2 without DNS.&lt;/p&gt;

</description>
      <category>help</category>
      <category>gatsby</category>
      <category>aws</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Working CSS + JS Calculator</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Tue, 04 Feb 2020 06:14:37 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/working-css-js-calculator-4h5i</link>
      <guid>https://forem.com/navdeepsingh/working-css-js-calculator-4h5i</guid>
      <description>&lt;p&gt;Love to experiments with CSS and Javascript. Created my Mac style calculator in CSS3 using Flexbox and Grid. Calculations are executed by Javascript. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/navdeepsingh/embed/GxmBMX?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Hope you liked it.&lt;/p&gt;

</description>
      <category>css3</category>
      <category>html</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Reactjs with Laravel or Lumen or Express</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Fri, 15 Nov 2019 05:38:39 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/reactjs-with-laravel-or-lumen-or-express-5d2j</link>
      <guid>https://forem.com/navdeepsingh/reactjs-with-laravel-or-lumen-or-express-5d2j</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3j2suudadbe48bmc6dp7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3j2suudadbe48bmc6dp7.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love today’s world web technologies and thanks to various cloud platforms that allow developers to deploy their application to test and showcase, we can use any combination as per our need. Recently, I got the chance to get hands on experience in using Reactjs Library in setting up SPA and Full Stack Applications. I used Reactjs in different combinations. Hope it will give an overview to newbies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reactjs and Lumen Application&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Reactjs and Laravel Application&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Reactjs and Express Application&lt;/strong&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Reactjs and Lumen Application
&lt;/h1&gt;

&lt;p&gt;Demo: &lt;a href="https://master.d30av2lsib94wx.amplifyapp.com/" rel="noopener noreferrer"&gt;https://master.d30av2lsib94wx.amplifyapp.com/&lt;/a&gt;&lt;br&gt;
Email: &lt;a href="mailto:admin@falcon-agency.com"&gt;admin@falcon-agency.com&lt;/a&gt;&lt;br&gt;
Password: test123&lt;/p&gt;

&lt;p&gt;For this I used separate folders to differentiate between front end and back end (api calls). Front end is developed using Reactjs and can be deployed in AWS Amplify ( I recommend ), or you have other options like Heroku, Netlify, Zeit and can deploy in EC2 instance of AWS. It’s truly depends on personal choice and available resources.&lt;/p&gt;

&lt;p&gt;I love the option of Auto-deploy of application on Cloud, It auto push and deploy your changes when you git push your changes on linked git repository.&lt;/p&gt;

&lt;p&gt;Backend application developed is basically to get API calls (REST), yet not tried GraphQL but will try it soon and its developed in slim and light php framework Lumen which is mini version of Laravel. I liked it as it provides php artisan to create containers, models, views, service providers and many many things using CLI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This combination is best when you want separate codebase and deployment for frontend and backend.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Reactjs and Laravel Application
&lt;/h1&gt;

&lt;p&gt;Demo: NA to share&lt;/p&gt;

&lt;p&gt;This is the official project. In this case I used Laravel 5.8 as full fledged code base, by default Laravel use Blade as templating engine. But with some tweaks and alteration in code we can use Reactjs as template engine. You can use Vuejs too, as Laravel officially support Vuejs. Again it’s up-to your personal choice.&lt;/p&gt;

&lt;p&gt;I used Admin Panel login authorization and created CMS using Laravel and for Routing Reactjs routes used separate route.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This combination is best when you are fan 🤩 of Laravel and want to use Reactjs as front end.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Reactjs and Express Application
&lt;/h1&gt;

&lt;p&gt;Demo: &lt;a href="http://falcon-digital.co/future-of-travel" rel="noopener noreferrer"&gt;http://falcon-digital.co/future-of-travel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This website I created for my company’s new venture which is static website but need form validation and submission to mailchimp. Again I want to use Reactjs, so to handle server side stuff rather to use php I used Nodejs.&lt;/p&gt;

&lt;p&gt;Before :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create HTML pages for static pages.&lt;/li&gt;
&lt;li&gt;Create php page for server side render or handling.&lt;/li&gt;
&lt;li&gt;Use jQuery to handle client side form submission.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Pages in Reactjs&lt;/li&gt;
&lt;li&gt;As Reactjs installed over nodejs, so nodejs is being used to handle server side stuff.&lt;/li&gt;
&lt;li&gt;Reactjs to handle form submission itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;This combination is best when you have small application which need server intervention too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Detail Setup Explained: &lt;a href="https://dev.to/navdeepsingh/basic-ern-stack-application-setup-3gdp"&gt;https://dev.to/navdeepsingh/basic-ern-stack-application-setup-3gdp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>lumen</category>
      <category>laravel</category>
      <category>react</category>
      <category>express</category>
    </item>
    <item>
      <title>Steps to Launch new AWS EC2 Instance </title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Fri, 15 Nov 2019 05:37:30 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/steps-to-launch-new-aws-ec2-instance-3dg9</link>
      <guid>https://forem.com/navdeepsingh/steps-to-launch-new-aws-ec2-instance-3dg9</guid>
      <description>&lt;p&gt;Pre-setup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select Ubuntu server.&lt;/li&gt;
&lt;li&gt;Create new key pair to connect with instance securely.&lt;/li&gt;
&lt;li&gt;After instance setup, connect with your instance

&lt;ol&gt;
&lt;li&gt;Open an SSH client.&lt;/li&gt;
&lt;li&gt;Locate your private key file (keyname.pem). The wizard automatically detects the key you used to launch the instance.&lt;/li&gt;
&lt;li&gt;Your key must not be publicly viewable for SSH to work. Use this command if needed:
&lt;code&gt;chmod 400 brand-nation.pem&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Connect to your instance using its Public DNS:
ec2-12-345-678-91.compute-1.amazonaws.com&lt;/li&gt;
&lt;li&gt;Example: ssh -i "keyname.pem" &lt;a href="mailto:ubuntu@ec2-12-345-678-91.compute-1.amazonaws.com"&gt;ubuntu@ec2-12-345-678-91.compute-1.amazonaws.com&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;


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

&lt;p&gt;Setup:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;sudo apt-get update&lt;/li&gt;
&lt;li&gt;sudo apt-get dist-upgrade&lt;/li&gt;
&lt;li&gt;sudo apt-get install apache2&lt;/li&gt;
&lt;li&gt;sudo apt-get install mysql-server&lt;/li&gt;
&lt;li&gt;sudo mysql_secure_installation utility&lt;/li&gt;
&lt;li&gt;sudo apt-get install php libapache2-mod-php&lt;/li&gt;
&lt;li&gt;sudo adduser ubuntu www-data&lt;/li&gt;
&lt;li&gt;sudo chown -R www-data:www-data /var/www/html&lt;/li&gt;
&lt;li&gt;sudo chmod -R g+rw /var/www/html&lt;/li&gt;
&lt;li&gt;sudo mysql -u root -p&lt;/li&gt;
&lt;li&gt;sudo a2enmod rewrite&lt;/li&gt;
&lt;li&gt;sudo service apache2 restart&lt;/li&gt;
&lt;li&gt;sudo nano /etc/apache2/sites-available/000-default.conf
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#Below “DocumentRoot /var/www/html” add the following lines:
&amp;lt;Directory “/var/www/html”&amp;gt;
AllowOverride All
&amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Common Issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Assign security group to instance, so TCP, HTTP works&lt;/li&gt;
&lt;li&gt;Listing Directory Failed: Connect FTP via SFTP&lt;/li&gt;
&lt;li&gt;MYSQL permission issues (&lt;a href="https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/"&gt;https://support.rackspace.com/how-to/installing-mysql-server-on-ubuntu/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Mysql extension is missing in php7 installation. Ubuntu 16.04 (sudo apt-get install php-mysql)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Start server and test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo service httpd start
sudo service mysqld start
chkconfig --list httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>server</category>
      <category>aws</category>
      <category>ec2</category>
    </item>
    <item>
      <title>Basic ERN Stack Application Setup</title>
      <dc:creator>Navdeep Singh</dc:creator>
      <pubDate>Fri, 15 Nov 2019 05:37:01 +0000</pubDate>
      <link>https://forem.com/navdeepsingh/basic-ern-stack-application-setup-3gdp</link>
      <guid>https://forem.com/navdeepsingh/basic-ern-stack-application-setup-3gdp</guid>
      <description>&lt;p&gt;ERN Stack Application is without (M)Mongo, as I haven't database need in this app. This is very interesting setup for a front end developer who mostly crafted websites in HTML5, CSS3 and Vanilla Javascript or jQuery and deployed websites via FTP on Apache Server.&lt;/p&gt;

&lt;p&gt;Here I used Express for handling server requests. Reactjs to develop front end using Components, Hooks, JSX, State Management i.e No need to use jquery to handle client side and server side tasks. And base layer is Nodejs (V8 Chrome Engine) is being used to make possible to execute javascript code on command line. &lt;/p&gt;

&lt;h4&gt;
  
  
  1. First start with React ready to go npm module &lt;code&gt;create-react-app&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-react-app ern-app
cd ern-app
npm install
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Start developing for front end after this command
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Install Express server
&lt;/h4&gt;



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

&lt;/div&gt;



&lt;h4&gt;
  
  
  4. Setup Express server
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const dotenv = require('dotenv');
const cors = require("cors");
const app = express();
const bodyParser = require("body-parser");
const path = require('path');
const axios = require('axios');
dotenv.config();

//Here we are configuring express to use body-parser as middle-ware.
app.use(bodyParser.urlencoded({
  extended: true
}));
app.use(bodyParser.json());

// Static Routes
app.get('/', function (req, res) {
  res.sendFile(path.join(__dirname, 'build', 'home.html'));
});

// React Routes
app.use(express.static(path.join(__dirname, 'build')));
app.get('*', function (req, res, next) {
  res.sendFile(path.join(__dirname, 'build', 'index.html'));
});

const port = process.env.SERVER_PORT || 8080;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  5. Start Express Server
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  6. Production
&lt;/h4&gt;

&lt;p&gt;Setup nodemon or my favorite one pm2 on server using this command &lt;code&gt;npm install pm2 -g&lt;/code&gt; followed by &lt;code&gt;pm2 start server.js&lt;/code&gt; And after check status of server by &lt;code&gt;pm2 show server&lt;/code&gt;&lt;br&gt;
Preview: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3p91iwr6v34yar8mrk9x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3p91iwr6v34yar8mrk9x.png" alt="PM2 Preview"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Always run React build command on server to get optimised version of 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;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to contact if you need any help regarding this setup 🤗&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>express</category>
      <category>react</category>
      <category>node</category>
    </item>
  </channel>
</rss>
