<?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: Akarsh Barar</title>
    <description>The latest articles on DEV Community by Akarsh Barar (@akarshbarar).</description>
    <link>https://dev.to/akarshbarar</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%2F483813%2Fe322224e-a06c-4ca0-80da-9685d7b722e6.jpeg</url>
      <title>DEV Community: Akarsh Barar</title>
      <link>https://dev.to/akarshbarar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akarshbarar"/>
    <language>en</language>
    <item>
      <title>5 Things I wish I knew earlier as a Software Developer</title>
      <dc:creator>Akarsh Barar</dc:creator>
      <pubDate>Tue, 14 Mar 2023 09:51:55 +0000</pubDate>
      <link>https://dev.to/akarshbarar/5-things-i-wish-i-knew-earlier-as-a-software-developer-134c</link>
      <guid>https://dev.to/akarshbarar/5-things-i-wish-i-knew-earlier-as-a-software-developer-134c</guid>
      <description>&lt;p&gt;I was an average student from starting of my schooling. In most of the exams, my rank was between 10 to 25 in a class of 50–60 students. But from starting I always had an interest in maths so math was my favorite subject. My interest in Software Development started growing the day I was introduced to Java(My first Programming Language) at that time I was in class 8th(Yes I am from the ICSE board). I was lucky to have a Computer at my home in those days (2007–2008). I installed BlueJ into my system and started coding the program that the teacher taught us in school. the first program was as usual "Hello World!", but that program dived me to learn more and explore more it took 2 years for me to fully fall in love with Programming an effect of which I gained 90+ marks in High School. After High School, I started teaching a Java tutor in a local Coaching Center in 2012 which gave me 2000 rupees per month at that time it was enough for me to fulfill my own needs. In 2013 I joined another Coaching where I got 5K per student for teaching Java for 2 months and there were approx 10 students who were interested in learning Java for their school or Self-learning. In that coaching, I got my first freelancing work for creating the Coaching website in which I was teaching at stating I hesitated because I have never created a website that takes data from user and stores it and shows it on the dashboard but still I took the project and convinced them to create the project in 3 months. At night I was reading on the internet about how to create a website and then I came across the programming language PHP I went through its syntax and it was similar to HTML with some syntactic sugar on it. Then I created the landing page for the client in Php and uploaded it to a free hosting platform in that landing page I just added a contact us form and saved that data in MySql this was the first time I used any database and interacted it with any programming language and I loved it. and the Client was impressed with the work I just copy pasted code from the internet but as a new developer, it was something I am proud of to date.&lt;/p&gt;

&lt;p&gt;Time passed by I learned Java Applet, JSP, Servlet, and many other technologies out of curiosity and today I am Senior Full Stack Developer here is the list I wish I knew earlier. I am writing it down out of my own experience after one year of team handling.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Try to Understand the Problem before diving into the solution&lt;/strong&gt;: If you start finding the solution without understanding the problem well you will end up wasting your time. I have personally faced this in my team where junior developer do they directly dive into solutions without thinking if this issue is from the code end, Server End, or Client End. Sometimes there is an issue at the client's end but we try to fix our code and that just wastes the time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Try to solve|Debug the problem on paper before writing your first code&lt;/strong&gt;: Let's say that you have a create a module that does some work and according to you it will take 2 hours. Try to create a blueprint of the module on paper let's say it took 1 hr now you have 1 hour just to convert that blueprint to code rather than using 2 hours to code and getting stuck in between the code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't be shy to ask for help&lt;/strong&gt;: I have seen this in new developers that if they are stuck in some issue they don't ask for help from their manager and Senior thinking it might have a bad impact on them but the case is just the opposite. Senior will definitely help you because  once he/she was at your place.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start writing Unit Test Cases for your code&lt;/strong&gt;: Testing is not only a job for testers you should also be able to test your code before handling the code to the tester as there might be a simple scenario that you might have missed and it will be coved in a unit test if you write one. Learn more about TDD and BDD.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Avoid Toxic Work Culture&lt;/strong&gt;: It's not a case of Software Development it applies to everything leave the place where you don't feel respected. You are not given credit for your work. You don't have a Work-Life balance. You can talk to your manager or HR in the company and if the situation still doesn't get better LEAVE.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are the 5 things that I wish I knew earlier.&lt;br&gt;
Do you agree with the points? Please Let me know.&lt;br&gt;
You can connect with me on LinkedIn:&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/akarshbarar/"&gt;https://www.linkedin.com/in/akarshbarar/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Two Factor Authentication using NodeJs</title>
      <dc:creator>Akarsh Barar</dc:creator>
      <pubDate>Thu, 12 Nov 2020 21:14:18 +0000</pubDate>
      <link>https://dev.to/akarshbarar/two-factor-authentication-using-nodejs-2k71</link>
      <guid>https://dev.to/akarshbarar/two-factor-authentication-using-nodejs-2k71</guid>
      <description>&lt;p&gt;If you have ever dealt with authentication in your application then you must have seen two factor authentication where you have to give a token or code that might be send to you by SMS or email. So lets build something like that and learn two factor authentication.&lt;br&gt;
Before learning two factor authentication lets understand pros and cons of 2FA(2 Factor Authentication)&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros of 2FA
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Provides Security to application.&lt;/li&gt;
&lt;li&gt;Easy to setup&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Cons of 2FA
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Involves sharing of Email or Phone number&lt;/li&gt;
&lt;li&gt;Prone to MIM attack&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Let's Get Started
&lt;/h1&gt;

&lt;p&gt;=&amp;gt; Create a node project &lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;=&amp;gt; Lets install some dependencies&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  __ npm install express node-json-db uuid speakeasy __
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;=&amp;gt; Create a simple Express app&lt;/p&gt;

&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffrw50wlm8xq9xplwvftv.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffrw50wlm8xq9xplwvftv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
=&amp;gt; Firstly create database here I am Node JSON database you can use any database that you want.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpqvm2ijo1ndc4vdpq2yx.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpqvm2ijo1ndc4vdpq2yx.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
=&amp;gt; Now register the user and create a temporary secret for him.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1skbrs3uuh8uugmzixxs.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1skbrs3uuh8uugmzixxs.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
=&amp;gt; When you will register the user you will get a secret key and token&lt;br&gt;
that will look like this in base32&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1yv09vhrmxk1163iobqo.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1yv09vhrmxk1163iobqo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
But you can also go with simple key and it will look like this&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftq3dlsshujps8pqmtv17.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftq3dlsshujps8pqmtv17.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
=&amp;gt; Now lets verify the user for that you need things one is the userId the user who is trying to login and one is the token this is token is generated in many ways you can use chrome extension that taken secret key from the register process and gives you a token or you can also use mobile apps I am using extension to generate token.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4twn2flvstrdl65owjw.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fg4twn2flvstrdl65owjw.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if it return verified true then you are good to go otherwise no.&lt;/p&gt;

&lt;p&gt;you can also go one step further to validate the token.&lt;/p&gt;

&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foyy37xhhxnruzfxgvrek.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Foyy37xhhxnruzfxgvrek.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;if it return validate true then you are good to go otherwise no.&lt;/p&gt;

&lt;p&gt;Github repo of above  is:&lt;/p&gt;

&lt;p&gt;[&lt;a href="https://github.com/akarshbarar/TwoFactorAuthentication" rel="noopener noreferrer"&gt;https://github.com/akarshbarar/TwoFactorAuthentication&lt;/a&gt;)&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://github.com/akarshbarar" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://www.instagram.com/mycodecave/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://twitter.com/CodeCave2" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;--------------------THANK YOU------------------------&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>authentication</category>
      <category>express</category>
    </item>
    <item>
      <title>World without NodeJS.</title>
      <dc:creator>Akarsh Barar</dc:creator>
      <pubDate>Mon, 02 Nov 2020 18:33:30 +0000</pubDate>
      <link>https://dev.to/akarshbarar/world-without-nodejs-58jh</link>
      <guid>https://dev.to/akarshbarar/world-without-nodejs-58jh</guid>
      <description>&lt;h1&gt;
  
  
  A Perfect World Without NodeJs Does Not exist
&lt;/h1&gt;

&lt;p&gt;If you are a web developer then you must have come across many technology that help us to create web-servers some of them are Jersey for Java, Spring Boot, Express, NodeJs etc. &lt;/p&gt;

&lt;p&gt;Node.js is actually not a framework or a library, but a runtime environment, based on Chrome’s V8 JavaScript engine.&lt;br&gt;
Using Node.js for backend, you automatically get all the pros of full stack JavaScript development, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;better efficiency and overall developer productivity&lt;/li&gt;
&lt;li&gt;code sharing and reuse&lt;/li&gt;
&lt;li&gt;speed and performance&lt;/li&gt;
&lt;li&gt;easy knowledge sharing within a team&lt;/li&gt;
&lt;li&gt;a huge number of free tools&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  So lets talk about why world is incomplete without Nodejs
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;No JavaScript alternate : Dino is coming in race as it is using Typescript but if you are a Javascript developer then you have to learn typescript first to work in it.&lt;/li&gt;
&lt;li&gt;Its simple Javascript: As we all know that current web works fully on Javascript and in order to integrate our front end with backend the compiler has to work hard that makes development and developer experience hard but if you are using Nodejs the frontend is also written in Javascript css and html and backend is also in javascript so the performance will be fast.&lt;/li&gt;
&lt;li&gt;Almost most of the framework from angular to react every framework and library supports node.&lt;/li&gt;
&lt;li&gt;Node has its own package manager NPM. NPM is so important building javascript based projects, and even with several alternatives (like webpack, yarn, etc) it is still by far the most used. A simple fact is that if npm does not work, most applications won’t build.&lt;/li&gt;
&lt;li&gt;NodeJs is managed by Linux Foundation so its free to use.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am not saying NodeJs is best or other technology are bad but for me NodeJs has changed the way to development for me.&lt;/p&gt;

&lt;p&gt;Comment Down your views on this.&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://github.com/akarshbarar"&gt;Github&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://www.instagram.com/mycodecave/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://twitter.com/CodeCave2"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;--------------------THANK YOU------------------------&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>serverless</category>
      <category>rendering</category>
    </item>
    <item>
      <title>Why React Is So Popular?</title>
      <dc:creator>Akarsh Barar</dc:creator>
      <pubDate>Sun, 25 Oct 2020 13:20:35 +0000</pubDate>
      <link>https://dev.to/akarshbarar/why-react-is-so-popular-5h3b</link>
      <guid>https://dev.to/akarshbarar/why-react-is-so-popular-5h3b</guid>
      <description>&lt;p&gt;If you have started with the Web Development or if you are doing web development from a long time then you must have heard of Angular, React and VueJs. They all are JavaScript framework for web development. But among then React is more popular than other. &lt;/p&gt;

&lt;h1&gt;
  
  
  What is React?
&lt;/h1&gt;

&lt;p&gt;React is a JavaScript &lt;strong&gt;library&lt;/strong&gt; developed by Facebook for easy and fast web development. It is used to create Single Page Applications and now days you can create native Mobile applications using React Native. Its first release was in year 2013. &lt;/p&gt;

&lt;h1&gt;
  
  
  So the Question arises is Why React is So Popular?
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Declarative Style&lt;/strong&gt;: A declarative style, like what react has, allows you to control flow and state in your application by saying "It should look like this". An imperative style turns that around and allows you to control your application by saying "This is what you should do".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Virtual DOM : The virtual DOM (VDOM) is a programming concept where an ideal, or “virtual”, representation of a UI is kept in memory and synced with the “real” DOM by a library such as ReactDOM. This process is called &lt;strong&gt;reconciliation&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easy to Learn : Being its only HTML and Javascript React is very easy to learn.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Community Support : React has a large base of developers and supporters. Since it is a old library you can find most of the answer in the Community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSX : JSX stands for JavaScript Xml, It means you can use javascript inside html or xml just by typeing your code inside '{' and'}'.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SEO: React on its own is not SEO friendly and everything works on Virtual DOM it is difficult of web crawler to find the content but if you are using Nextjs or Gatsby you can optimize you site for SEO.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SPA : One of the main Advantage of React is that We can create Single page Applications ie our site will not reload when change the page. UI is changed without Refresh.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Github repo of React  is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/facebook/react"&gt;https://github.com/facebook/react&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://github.com/akarshbarar"&gt;Github&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://www.instagram.com/mycodecave/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://twitter.com/CodeCave2"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;--------------------THANK YOU------------------------&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>jsx</category>
      <category>html</category>
    </item>
    <item>
      <title>How to start with NuxtJs?</title>
      <dc:creator>Akarsh Barar</dc:creator>
      <pubDate>Tue, 06 Oct 2020 18:11:39 +0000</pubDate>
      <link>https://dev.to/akarshbarar/how-to-start-with-nuxtjs-3dd9</link>
      <guid>https://dev.to/akarshbarar/how-to-start-with-nuxtjs-3dd9</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;How to Start with NuxtJs&lt;/strong&gt;
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Data Binding&lt;/li&gt;
&lt;li&gt;Use of VueX&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is NuxtJs?
&lt;/h2&gt;

&lt;p&gt;Nuxt is a progressive framework based on Vue.js to create modern web applications. It is based on Vue.js official libraries and powerful development tools .&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite of NuxtJs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basics of HTML&lt;/li&gt;
&lt;li&gt;Basics of JavaScript&lt;/li&gt;
&lt;li&gt;Basics of Vue(optional)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create Nuxt App
&lt;/h2&gt;

&lt;p&gt;You can create app in many ways but the three most used ways are:-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yarn create nuxt-app &lt;/li&gt;
&lt;li&gt;npx create-nuxt-app &lt;/li&gt;
&lt;li&gt;npm init nuxt-app &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Running Your App
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;cd &lt;/li&gt;
&lt;li&gt;yarn dev or npm run dev&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Folder Structure of Nuxt App
&lt;/h2&gt;

&lt;p&gt;|-assets&lt;br&gt;
|-component&lt;br&gt;
|---|-logo.vue&lt;br&gt;
|-layouts&lt;br&gt;
|---|-default.vue&lt;br&gt;
|-middleware&lt;br&gt;
|-pages&lt;br&gt;
|---|-index.vue&lt;br&gt;
|-plugins&lt;br&gt;
|-static&lt;br&gt;
|---|-favicon.ico&lt;br&gt;
|---|-icon.png&lt;br&gt;
|---|-sw.js&lt;br&gt;
|-store&lt;br&gt;
|-jsconfig.js&lt;br&gt;
|-nuxt.config.js&lt;br&gt;
|-package.json&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;assets&lt;/strong&gt; directory contains your un-compiled assets such as Stylus or Sass files, images, or fonts.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;components&lt;/strong&gt; directory contains your Vue.js Components.&lt;/li&gt;
&lt;li&gt;The __layouts __directory includes your application layouts. Layouts are used to change the look and feel of your page (for example by including a sidebar).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;middleware&lt;/strong&gt; directory contains your Application Middleware.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;pages&lt;/strong&gt; directory contains your Application Views and Routes. The framework reads all the .vue files inside this directory and creates the application router.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;plugins&lt;/strong&gt; directory contains your Javascript plugins that you want to run before instantiating the root Vue.js Application.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;static&lt;/strong&gt; directory is directly mapped to the server root (/static/robots.txt is accessible under &lt;a href="http://localhost:3000/robots.txt"&gt;http://localhost:3000/robots.txt&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;store&lt;/strong&gt; directory contains your Vuex Store files. The Vuex Store comes with Nuxt.js out of the box but is disabled by default. Creating an index.js file in this directory enables the store.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;nuxt.config.js&lt;/strong&gt; file contains your Nuxt.js custom configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Data Binding
&lt;/h3&gt;

&lt;p&gt;In export default part just make a data() and then initialize the variable like:&lt;br&gt;
 data() {&lt;br&gt;
        return {&lt;br&gt;
             message:'',&lt;br&gt;
 }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;now in HTML message can  be accessed using { { message } }&lt;/p&gt;

&lt;h3&gt;
  
  
  Button Click
&lt;/h3&gt;

&lt;p&gt;Add attribute v-on:click="increment" in button tag or you  can also use  @click="increment" where increment is the function that will be called on button click. So how we can make that function. In export default something like this:&lt;br&gt;
 methods: { &lt;br&gt;
      increment:function(e) {&lt;br&gt;
// DO ANYTHING THAT YOU WANT&lt;br&gt;
 }&lt;br&gt;
}&lt;/p&gt;

&lt;h2&gt;
  
  
  Routing
&lt;/h2&gt;

&lt;p&gt;For routing just create a page inside pages folder for example about.vue and your routing will automatically be done and in order to go to that link in HTML we have&lt;br&gt;
 &lt;strong&gt;&lt;a href="/about"&gt;About&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
 but in NuxtJs we have &lt;br&gt;
&lt;strong&gt;About&lt;/strong&gt;.&lt;br&gt;
in order to route on button click inside the method create a function and inside that just use &lt;br&gt;
        &lt;strong&gt;this.$router.push({ path: '/about' })&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  VueX
&lt;/h2&gt;

&lt;p&gt;Install Vuex using &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npm install vuex --save&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;yarn add vuex&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inside store folder create index.js file in order to create State.&lt;br&gt;
Import the vuex&lt;/p&gt;

&lt;p&gt;import Vue from 'vue'&lt;br&gt;
import Vuex from 'vuex'&lt;/p&gt;

&lt;p&gt;create State like&lt;br&gt;
export const state = () =&amp;gt; ( {&lt;br&gt;
    counter: 1000,&lt;br&gt;
    list:[],&lt;br&gt;
  } );&lt;/p&gt;

&lt;p&gt;In order to use this state in any file just follow the steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;import { mapState } from 'vuex' in script tag&lt;/li&gt;
&lt;li&gt;Inside export default 
computed: {
    ...mapState( {
        counter:state=&amp;gt;state.counter
    } )
},
Now we can directly use the counter variable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to change the  state add following line in store/index.js&lt;br&gt;
export const mutations =  {&lt;br&gt;
    inc(state)  {&lt;br&gt;
      state.counter++&lt;br&gt;
    },&lt;br&gt;
    dec(state)  {&lt;br&gt;&lt;br&gt;
        state.counter--&lt;br&gt;
      },&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;and in order to change the state data in any file just add following lines:&lt;br&gt;
           this.$store.commit('dec') &lt;br&gt;
in order to call the dec() function in store/index.js file.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this tutorial we have have learned about NuxtJs and some basic concepts of NuxtJs like routing and state management.&lt;/p&gt;

&lt;p&gt;Github repo of above is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/akarshbarar/NuxtJS_Vue-X/"&gt;NuxtJS_Vue-X&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Follow me on &lt;a href="https://github.com/akarshbarar"&gt;Github&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://www.instagram.com/mycodecave/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://twitter.com/CodeCave2"&gt;Twitter&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;--------------------THANK YOU------------------------&lt;/p&gt;

</description>
      <category>nuxt</category>
    </item>
  </channel>
</rss>
