<?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: Taimoor Sattar</title>
    <description>The latest articles on Forem by Taimoor Sattar (@taimoorsattar7).</description>
    <link>https://forem.com/taimoorsattar7</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%2F124844%2Fbe932972-1f03-4686-838f-417862bab2a3.jpg</url>
      <title>Forem: Taimoor Sattar</title>
      <link>https://forem.com/taimoorsattar7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/taimoorsattar7"/>
    <language>en</language>
    <item>
      <title>9 reasons to use Gatsby Framework for React developer</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Sun, 01 Jan 2023 20:03:38 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/9-reasons-to-use-gatsby-framework-for-react-developer-8mk</link>
      <guid>https://forem.com/taimoorsattar7/9-reasons-to-use-gatsby-framework-for-react-developer-8mk</guid>
      <description>&lt;p&gt;Gatsby is a React-based framework that can be used to create static and dynamic websites. Most React developers would think why would we need Gatsby if we can build websites using React?&lt;/p&gt;

&lt;p&gt;React is not a Framework, but it is a Javascript library used to build reusable components. To build the website, We need to take care of many things e.g. Page routing, code automation, Image optimization, SEO, etc. For that, we need to install an extra package to build the code infrastructure for the website.&lt;/p&gt;

&lt;p&gt;Instead of building the infrastructure from scratch, we can use a framework (built on React) to build the website.&lt;/p&gt;

&lt;p&gt;There're many React frameworks available but the most popular are Nextjs, Gatsbyjs, and Create React App. Below I've outlined 9 reasons to use Gatsby Framework for React developers.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sr#&lt;/th&gt;
&lt;th&gt;Reasons&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.&lt;/td&gt;
&lt;td&gt;Gatsby Functions&lt;/td&gt;
&lt;td&gt;We can define an API function in the Gatsby that responds to the incoming HTTP request. Gatsby function is like a server function that is executed when we send the HTTP request.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.&lt;/td&gt;
&lt;td&gt;Gatsby Plugin&lt;/td&gt;
&lt;td&gt;Gatsby provides thousands of plugins that we can use in the project to add functionality to the website. Moreover, Gatsby provides a source plugin that we can use to source data at build time from different resources e.g. WordPress, CSV, SANITY, excel, APIs, etc.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.&lt;/td&gt;
&lt;td&gt;Filesystem Routes&lt;/td&gt;
&lt;td&gt;In Gatsby, we can create a Page component to define the route of the website. We can define static or dynamic routes based on the need. Dynamic route renders the page based on the slug in the URL.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4.&lt;/td&gt;
&lt;td&gt;Partial Hydration&lt;/td&gt;
&lt;td&gt;React Server Component is possible with Partial Hydration. With Partial Hydration, Gatsby sends only necessary Javascript to the client browser. Partial Hydration is like executing React component on the server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5.&lt;/td&gt;
&lt;td&gt;Render Data&lt;/td&gt;
&lt;td&gt;Gatsby gives the choice to the user to render the website either at build time (Static Site) or at runtime (Server-Side Rendering).  &lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6.&lt;/td&gt;
&lt;td&gt;Head API&lt;/td&gt;
&lt;td&gt;You might be familiar with React Helmet NPM Package that is used to manage the meta tags in the document Head. Gatsby provides Head API out of the box that we can use to manage the meta tags in the document Head.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7.&lt;/td&gt;
&lt;td&gt;Script Component&lt;/td&gt;
&lt;td&gt;Gatsby provides a script component that we can use to load the script component on the website. With the Script Component, we can define loading strategies that provide performance out of the box.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8.&lt;/td&gt;
&lt;td&gt;Slice API&lt;/td&gt;
&lt;td&gt;In Gatsbyjs, we can use Gatsby Slice API to build only those pieces of component that are changed and else remain constant.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;9.&lt;/td&gt;
&lt;td&gt;GraphQL Data Layer&lt;/td&gt;
&lt;td&gt;Gatsby ships with GraphQL data layer by default. We can use the GraphQL layer to query the build time data.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If all the above benifits makes sense to you, you might need to try Gatsbyjs. If you're interested to learn, I've wrote a &lt;a href="https://taimoorsattar.com/p/build-standout-website" rel="noopener noreferrer"&gt;Gatsbyjs Course&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>How To Code And Build Your Website?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Fri, 15 Jul 2022 10:08:00 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-to-code-and-build-your-website-3cbe</link>
      <guid>https://forem.com/taimoorsattar7/how-to-code-and-build-your-website-3cbe</guid>
      <description>&lt;p&gt;In this blog, I share with you a brief roadmap on how you can start to code and build your website online.To start writing code, you first need to have a code editor. The most popular choice for the code editor among developers is the VScode editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vRndVEsj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpcgi3qbkcz4ttcdx2ac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vRndVEsj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wpcgi3qbkcz4ttcdx2ac.png" alt="Image description" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started, you first need to understand the basic languages e.g. HTML, CSS, and Javascript. HTML is a markup language, CSS is used to style HTML elements, and Javascript loads dynamic content. You can understand it better by looking at the image below, where the skeleton of the body is described as HTML, the outer skin is described as CSS and his action as Javascript.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f-xlVCqB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex26k6yymzpwslx1niqr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f-xlVCqB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ex26k6yymzpwslx1niqr.jpg" alt="VScode editor" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to learn more about the basic languages, you can follow the below link&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://taimoorsattar.com/blogs/javascript"&gt;Get started with Javascript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://taimoorsattar.com/blogs/learn-css"&gt;Get started with CSS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A client-side language such as HTML, CSS, or Javascript is responsible for displaying content on a browser (front-end). If we want to perform server-side tasks like a filesystem and connect with the database; then we need to learn server-side languages e.g. nodejs, and PHP. You have the option to choose between different server-side languages. If you are a WordPress lover, then PHP is the way to go. If you want to write Javascript on the server, then Nodejs is the option.&lt;/p&gt;

&lt;p&gt;As mentioned, Javascript is used to load dynamic content (UI) without refreshing the page e.g. validating user input, popup modal/ads, toggling dark and light mode, etc. But if the UI of the website becomes more complex, then handling it with Javascript could be a very lengthy task. So, we need a more robust UI library, Reactjs. React is the JavaScript library for building user interfaces and is the most popular among developers. It helps you manage a lot of things easier with features like Virtual DOM(normal DOM updates are slow), handling data with states, component-based structure, etc.&lt;/p&gt;

&lt;p&gt;Along with ReactJS, we need a framework that makes our development workflow smoother e.g. Page route, SSR, SSG, code automation, image optimization, etc. The most popular React frameworks are Gatsbyjs and Nextjs. As I’m more inclined towards Gatsbyjs, here I’ll discuss the Gatsbyjs framework. Gatsby is a modern web framework built on top of React and GraphQL. We can use Gatsbyjs to build both static and dynamic sites. To get started with Gatsbyjs, you can choose Gatsby starter template. In the Gatsby project, any &lt;code&gt;**.js&lt;/code&gt; file located in the &lt;code&gt;src/pages&lt;/code&gt; folder serves as a page route. To start running the Gatsby project, we can execute the below command in the terminal.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After, Your site is now running at &lt;code&gt;http://localhost:8000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We also need a backend server in Gatsbyjs to perform backend tasks. Luckily, in Gatsby, we can write serverless functions without running servers. To create a serverless function, we can create a &lt;code&gt;**.js&lt;/code&gt; file at the &lt;code&gt;src/api&lt;/code&gt; location in the project. In the frontend, we can execute the serverless function by sending HTTP requests to the respective API route.&lt;/p&gt;

&lt;p&gt;For example, the &lt;code&gt;newsletter.js&lt;/code&gt; file located at &lt;code&gt;src/api&lt;/code&gt; create the API route at &lt;code&gt;http://localhost:8000/api/newsletter&lt;/code&gt;. So to execute the respective function from the frontend, we can send the HTTP response to the respective API route as in the below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;axios&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;onSubmit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;subscribe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/newsletter`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
 &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
 &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&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;subscribe&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;?.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;success&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Great!!!&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To store the user’s data we need a database. There are many options to choose between the database e.g SQL or non-SQL. To interact with the database, we need a server e.g. nodejs. But, some of the database companies allow the developer to perform CRUD (create, read, update, and delete) operations on the database using the API. So, we can add an extra API layer to the database. Instead of interacting with the database, we can send the HTTP requests to the API route to retrieve or mutate the data. In this way, we can perform CRUD operations on both clients (frontend) and server sides.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oVsDR5Gt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxi9zry997iv40efueos.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oVsDR5Gt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxi9zry997iv40efueos.jpg" alt="Database API layer" width="716" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, Sanity_io is the unified content platform. To mutate and retrieve the data from the Sanity server, we can send the HTTP request to the respective API route along with the query parameter.&lt;/p&gt;

&lt;p&gt;To deploy your website, you need to have a public domain and a host server. If you don’t have a public domain, don’t worry you can host your website on the subdomain of the host server. The most popular hosting website are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Netlify&lt;/li&gt;
&lt;li&gt;GitHub Pages&lt;/li&gt;
&lt;li&gt;Heroku&lt;/li&gt;
&lt;li&gt;Vercel&lt;/li&gt;
&lt;li&gt;Render&lt;/li&gt;
&lt;li&gt;Surge&lt;/li&gt;
&lt;li&gt;Firebase&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Depending on the hosting website, you might have many options to build and deploy your website. But, the approach that we can follow is to push your code on Github (ship your code) and then deploy it on the netlify server as shown below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vW9k7yQP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tpr1ktajz3pydqp5pu5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vW9k7yQP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tpr1ktajz3pydqp5pu5.png" alt="Deploy on Netlify" width="800" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Netlify is the hosting platform to host your assert/code live on the web. Netlify triggers a build command whenever you push your code up on Github. After your website is successfully built, netlify generates a public URL that you can visit to view your website. To learn more about how to deploy your website on netlify, you can visit this page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Words
&lt;/h2&gt;

&lt;p&gt;You have a brief understanding of how you can learn to code. To start off, practice some code online and get your hands dirty with the project. Some of the projects that you start doing right now are listed below&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build a responsive website with HTML, CSS, and Javascript&lt;/li&gt;
&lt;li&gt;Build a todo list with React Project&lt;/li&gt;
&lt;li&gt;Store user’s details in the database.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In case you are interested in a more in-depth course, you can check out the &lt;a href="https://taimoorsattar.com/p/build-standout-website"&gt;Build website with Gatsbyjs&lt;/a&gt; - course.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Create an image slider using HTML and CSS</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Fri, 06 May 2022 11:27:34 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/create-an-image-slider-using-html-and-css-250l</link>
      <guid>https://forem.com/taimoorsattar7/create-an-image-slider-using-html-and-css-250l</guid>
      <description>&lt;p&gt;In this section, we learn how to create image slider using HTML and CSS. You can view the full source code at the below link.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/taimoorsattar/pen/yLJBdKO"&gt;https://codepen.io/taimoorsattar/pen/yLJBdKO&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👆👆👆&lt;/p&gt;

&lt;p&gt;To get started, we can structure Html code as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"wrapper"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Image Slider&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"slider"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt;
      &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://i.picsum.photos/id/694/500/500.jpg?hmac=cEe2DO9tVxp0o0HjSI5RboKc75ofkq50NvKBIlB_0fQ"&lt;/span&gt;
      &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"pic"&lt;/span&gt;
    &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt;
      &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://i.picsum.photos/id/531/500/500.jpg?hmac=eaduedF4dw0jS6AeDrrxNJIxAlsmWfdZWEPdEG84WRw"&lt;/span&gt;
      &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"pic"&lt;/span&gt;
    &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

    . .
    &lt;span class="c"&gt;&amp;lt;!-- More Images Here. --&amp;gt;&lt;/span&gt;
    . .
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- wrapper --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can add as many image as you like. To download dummy images, you can visit &lt;a href="https://picsum.photos"&gt;picsum.photos&lt;/a&gt; site.&lt;/p&gt;

&lt;p&gt;In the above HTML, we have define the class names to the HTML elements that is structure as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.wrapper
  └── .slider
      └── &amp;lt;img&amp;gt;
      └── &amp;lt;img&amp;gt;
      └── ....&amp;lt;img&amp;gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can insert as many image as we like. We can only see those images that are visible to us. As describe in the below image, yellow area is the visible area where image are shown. The image slider left to reveal more images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TsjGQmoB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b057fwdckvjk8gs6v8hv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TsjGQmoB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b057fwdckvjk8gs6v8hv.png" alt="Image Slider sketch" width="800" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, we need to define the width and height of the visible area as shown above. To define the width of visible area, we can define the &lt;code&gt;.wrapper&lt;/code&gt; class as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.wrapper&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;auto&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;960px&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;p&gt;In order to allow more images to be revealed, the visible area should scroll. For that, we can define the &lt;code&gt;.slider&lt;/code&gt; class as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.slider&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;overflow-x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;scroll&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;white-space&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;nowrap&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;p&gt;Next, to make the scroll bar of slider more fancy, we can write the below code in CSS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nd"&gt;::-webkit-scrollbar&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;10px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Track */&lt;/span&gt;
&lt;span class="nd"&gt;::-webkit-scrollbar-track&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#f1f1f1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Handle */&lt;/span&gt;
&lt;span class="nd"&gt;::-webkit-scrollbar-thumb&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#888&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;border-radius&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;5px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;/* Handle on hover */&lt;/span&gt;
&lt;span class="nd"&gt;::-webkit-scrollbar-thumb:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#555&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;p&gt;Also, I've wrote a blog about CSS scrollbar if you're interested to learn, visit the below link.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://taimoorsattar.dev/blogs/custom-scrollbar-in-css"&gt;CSS scrollbar&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, our image slider preview as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fanIkN_m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/socqzzxxo7b7pxa4ptl5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fanIkN_m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/socqzzxxo7b7pxa4ptl5.jpg" alt="Final Image slider" width="800" height="193"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How Do I Build A Platform To Sell My Course?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Mon, 21 Mar 2022 16:00:59 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-do-i-build-a-platform-to-sell-my-course-28i9</link>
      <guid>https://forem.com/taimoorsattar7/how-do-i-build-a-platform-to-sell-my-course-28i9</guid>
      <description>&lt;p&gt;There are many online platforms for selling courses online, however, I found a few limitations. For the course platform, I would like more customization of landing pages, subscriptions, and content structure. Therefore, I created my own platform for selling courses myself.&lt;/p&gt;

&lt;p&gt;Here, I'll briefly describe how I built a platform for selling my course. We used Gatsby Framework, Sanity_io, and Stripe to build the website.&lt;/p&gt;

&lt;p&gt;Gatsby is a framework built on React. We use the Gatsby Framework to build the frontend and backend. The benefits of using the Gatsby framework are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It supports thousands of plugins that we can use in the project.&lt;/li&gt;
&lt;li&gt;We can fetch the data both at build and runtime.&lt;/li&gt;
&lt;li&gt;Run serverless function.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To get started with the Gatsby Framework, you can choose the starter template from the below page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.gatsbyjs.com/starters"&gt;https://www.gatsbyjs.com/starters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JHUPIElu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qg0bdanzebbs9pl9kk26.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JHUPIElu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qg0bdanzebbs9pl9kk26.jpg" alt="Gatsbyjs Starter" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The starter template is the reference point. You can customize the starter template as per your need. For the project, we used Tailwind CSS to style the HTML elements. Tailwind CSS provides utility classes that we can use in the project. Take a look at the image below to see how tailwind works.&lt;/p&gt;

&lt;p&gt;You can also find tons of Tailwind CSS components online that you can use in your project. Some of the example websites are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tailwindcomponents.com"&gt;https://tailwindcomponents.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flowbite.com"&gt;https://flowbite.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.wickedtemplates.com"&gt;https://www.wickedtemplates.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In order to make the website available on the internet, we host the project on Github and deploy the repo on Netlify. Netlify provides a better user experience to build, deploy, and scale production applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FXLiHbnt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxr02sa7uh5f5jm7ti4x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FXLiHbnt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxr02sa7uh5f5jm7ti4x.jpg" alt="Netlify build" width="800" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gatsby is a framework, not a database. So, we need a database to store and manage the content data. I use Sanity_io for that purpose. You can see the official Sanity page below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.sanity.io"&gt;https://www.sanity.io&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ldiURDhm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hdvdq8w3j3g9iwc0d6g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ldiURDhm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hdvdq8w3j3g9iwc0d6g.jpg" alt="Sanity Website" width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sanity_io has two layers as below.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sanity Studio&lt;/li&gt;
&lt;li&gt;Sanity Server&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The Sanity Server is a database, fully managed by the Sanity team so we don't need to worry about that. Sanity has a pricing model that charges for data usage.&lt;/p&gt;

&lt;p&gt;Sanity Studio is a CMS that allows us to fully customize the document's schema. In our case, we can create different documents in Sanity Studio e.g. course, customer, subscription, etc. For each document, we can define custom schema as per the requirements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--218V-O66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7j81ht7s0q2mmaugxuz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--218V-O66--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7j81ht7s0q2mmaugxuz.jpg" alt="Sanity Studio" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stripe is the platform we use to process online payments. To collect payments from users, we need to build a checkout page. In Stripe, we have multiple options to create checkout. Below are two approaches to creating Stripe checkout:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Stripe built-in checkout (fully managed by Stripe team).&lt;/li&gt;
&lt;li&gt;Create custom checkout using the Stripe API.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Stripe's built-in checkout is easier to use since we can have fewer bugs and more payment solutions out of the box.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to interconnect different layers of service?
&lt;/h2&gt;

&lt;p&gt;The data is stored in Sanity Studio, the frontend UI is built on Gatsby Framework, and recipient subscription details are available on the Stripe server. As described, we have three layers of services. We want the data to be available to the user in the Gatsby project. To glue the data layers, we can use the API.&lt;/p&gt;

&lt;p&gt;By using the Stripe Node API, we can retrieve and modify the recipient subscription. In the Gatsby framework, we use serverless functions to execute the Stripe Node API calls. You can find the Stripe Node API on the below page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stripe.com/docs/api?lang=node"&gt;https://stripe.com/docs/api?lang=node&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---X3SanTZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hg983pxlier3gs39gxm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---X3SanTZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hg983pxlier3gs39gxm.jpg" alt="Stripe Node API" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get the Sanity data in the frontend, we can send the HTTP requests to the respective API route. We can use the Sanity GROQ language to get the desired data from the Sanity server. You can learn more about Sanity GROQ language on the following page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.sanity.io/docs/groq"&gt;https://www.sanity.io/docs/groq&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final words
&lt;/h2&gt;

&lt;p&gt;Here, I discuss briefly how I built my course platform website. If you want to learn more, you can check the below course.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://taimoorsattar.dev/p/build-standout-website"&gt;Build A Standout Website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Also follow me on twitter &lt;a href="https://twitter.com/intent/user?screen_name=taimoorsattar7"&gt;@taimoorsattar7&lt;/a&gt; for more update.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>codenewbie</category>
      <category>gatsby</category>
      <category>showdev</category>
    </item>
    <item>
      <title>How to use Promise in JavaScript</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Thu, 05 Aug 2021 10:09:56 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-to-use-promise-in-javascript-16f8</link>
      <guid>https://forem.com/taimoorsattar7/how-to-use-promise-in-javascript-16f8</guid>
      <description>&lt;p&gt;Promise in JavaScript is the way to wait for a certain action to process or complete. The promise has the following states:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pending&lt;/strong&gt;: incomplete (initial state), neither fulfilled nor rejected.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fulfilled&lt;/strong&gt;: The process was successfully completed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rejected&lt;/strong&gt;: The process failed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, where the promise is useful? We can use promise in JavaScript in a different situation. For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Wait for the response from the HTTP request &lt;/li&gt;
&lt;li&gt;async and await function&lt;/li&gt;
&lt;li&gt;Schedule Task e.g. &lt;a href="https://taimoorsattar.dev/blogs/settimeout-and-setinterval-using-javascript"&gt;setTimeout and setInterval&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can use &lt;a href="https://taimoorsattar.dev/blogs/request-data-using-javascript-fetch-api"&gt;fetch in JavaScript&lt;/a&gt; to retrieve the data from a certain API endpoint. The fetch in JavaScript is a promise that returns the data if the request is successfully processed.&lt;/p&gt;

&lt;p&gt;Let's take an example. We have 1st person that's giving the promise and 2nd person that's waiting for the promise to fulfill.&lt;/p&gt;

&lt;p&gt;In JavaScript, we can define the promise as below:&lt;br&gt;
&lt;/p&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;myPromise&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&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;setTimeout&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="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mf"&gt;0.5&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
      &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;foo&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="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Exception!&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="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;300&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;p&gt;In the above, we define the promise that waits for 0.3 seconds and returns the pass or fails message based on the boolean logic (true or false).&lt;/p&gt;

&lt;p&gt;Now, to wait for the promise to complete, we can write code in JavaScript as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;myPromise&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; and bar&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="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;finally&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Promise completed&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;p&gt;In the above code, the following callback function runs:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.then&lt;/code&gt;: Executes when the process is successfully completed&lt;br&gt;
&lt;code&gt;.catch&lt;/code&gt;: Executes when the process is failed&lt;br&gt;
&lt;code&gt;.finally&lt;/code&gt;: execute at every condition&lt;/p&gt;



&lt;p&gt;Moving further... Let's say, we have more than one person that is giving the promise. We can define in JavaScript as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const promise1 = Promise.resolve("great");
const promise2 = new Promise((resolve, reject) =&amp;gt; {
  setTimeout(resolve, 300, 'Yesss!!!');
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can use &lt;code&gt;Promise.all&lt;/code&gt; that returns a promise which resolves after all of the given promises have either fulfilled or rejected. We can write in JavaScript as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Promise.all([promise1, promise2]).then((values) =&amp;gt; {
  console.log(values);
})
.catch(error =&amp;gt; {
  console.error(error.message)
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will log the following in the console:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;["great","Yesss!!!"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;The previous example works OK if all the promises resolve successfully. But... let's say, If one of the promises is rejected, the overall &lt;strong&gt;Promise.all&lt;/strong&gt; will be rejected even if every other promise is resolved successfully.&lt;/p&gt;

&lt;p&gt;Let say, If we are waiting for many promises. Some promises got fulfilled and some are rejected. In JavaScript, we can define promise as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;p1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&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;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p1_delayed_resolution1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;p2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reject&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;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;p2_immediate_rejection&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;p&gt;In &lt;code&gt;Promise.all&lt;/code&gt;, we can use the &lt;code&gt;.catch&lt;/code&gt; statement to handle the error of each promise.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="nx"&gt;p1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="nx"&gt;p2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// "p1_delayed_resolution"&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;values&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// "Error: p2_immediate_rejection"&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
    </item>
    <item>
      <title>How to become web developer in 2021?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Tue, 12 Jan 2021 08:04:07 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-to-become-web-developer-in-2021-eaa</link>
      <guid>https://forem.com/taimoorsattar7/how-to-become-web-developer-in-2021-eaa</guid>
      <description>&lt;p&gt;To learn about web development in 2021, you have to understand what makes up the websites.&lt;/p&gt;

&lt;p&gt;In the blog, we cover the fundamental concepts to kickstart your career as a web developer in 2021.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start from the basics
&lt;/h2&gt;

&lt;p&gt;If you want to learn website development, start from the basics. Before you run, you have to learn how to walk. The basic ingredient of website development is HTML, CSS, and JavaScript.&lt;/p&gt;

&lt;p&gt;HTML is the structure layout of the website. For example, heading, paragraph, sidebar, etc.&lt;/p&gt;

&lt;p&gt;CSS used to style the HTML content of the website. CSS adds styles to the content like color, margin, padding, typography, etc.&lt;/p&gt;

&lt;p&gt;JavaScript is used to add/render dynamic content to the website without refreshing the page. For example, open and close menu-content items, popup modal, etc. We can use JavaScript to load the content based on certain actions e.g. click of the button, load content based on specific routes, etc. If your website is complex, handling dynamic content with just JavaScript is complex work. You need a library that can help dynamic content rendering easy for you. &lt;a href="https://taimoorsattar.dev/blogs/why-need-for-react-js"&gt;That's where ReactJS&lt;/a&gt; helps you to build user interfaces. Some other React alternative is Svelte, VUE.js, Angular, etc.&lt;/p&gt;

&lt;p&gt;HTML, CSS, and JavaScript are the front end of the website that &lt;strong&gt;browser can understand&lt;/strong&gt;. We can manipulate and change the property/logic of HTML, CSS, and JavaScript on the browser using the inspect tool. So, if you are making a website that needs bank account validation, it's not a good idea to serve all of your logic on the front-end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting with the backend/database
&lt;/h2&gt;

&lt;p&gt;Backend languages run on the server, not on the browser. NodeJS, PHP, etc are some programming languages that run on the servers. The server could be accessed by administrators, not the public. We can validate/perform the logical operation on the server.&lt;/p&gt;

&lt;p&gt;In the Backend, you can perform the logical operations to CRUD (Create, Read, Update, and Delete) into the database. Different types of databases are SQL and non-SQL databases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SQL database&lt;/strong&gt; is table-based while the non-sql database is documentation-based (key-value).&lt;/p&gt;

&lt;p&gt;Example of SQL databases are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MYSQL&lt;/li&gt;
&lt;li&gt;PostgreSQL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples of NON-SQL databases on the internet are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;&lt;a href="https://firebase.google.com"&gt;Firebase&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We use the database to store, retrieve, and manipulate the data on the server e,g. store login credential.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to open source projects
&lt;/h2&gt;

&lt;p&gt;Taking an online course helps to learn the fundamental concepts of website development. After that, you can follow up with the open-source projects on the internet. Contributing to the open-source project helps you to learn the technique to solve problems in a more convenient way.&lt;/p&gt;

&lt;p&gt;Search open-source projects on &lt;a href="https://github.com"&gt;GitHub&lt;/a&gt; and start to contribute. Manage your project with version control using Git. &lt;a href="https://git-scm.com"&gt;Git&lt;/a&gt; helps you to collaborate with teams, track your history changes version control files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Learn the Framework
&lt;/h2&gt;

&lt;p&gt;The framework makes it easy for developers to start making websites as it bundles with the initial configuration settings. Configuration setting may include routing, code automation, architecture, etc. You can more focus on programming stuff, rather than automation/configuration stuff.&lt;/p&gt;

&lt;p&gt;Examples of some modern React frameworks are &lt;a href="https://nextjs.org"&gt;NextJs&lt;/a&gt;, &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt;, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage documents on CMS
&lt;/h2&gt;

&lt;p&gt;CMS (Content Management System) allows you to manage files/posts on the servers. CMS is mainly for administration purposes. With CMS, you can create, manage, update content on the website, assign different roles to the users, and upload files.&lt;/p&gt;

&lt;p&gt;Examples of CMS are &lt;a href="https://strapi.io"&gt;strapi&lt;/a&gt;, &lt;a href="https://taimoorsattar.dev/blogs/wordpress"&gt;WordPress&lt;/a&gt;, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hosting project on the public server
&lt;/h2&gt;

&lt;p&gt;To share your local project with the public, you need to host it on the hosting provider. There are different hosting providers on the internet. Some of them are listed below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.netlify.com"&gt;netlify&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vercel.com"&gt;vercel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/run"&gt;Google Cloud Run&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are different architectures in which to host your website on the public server. You may choose &lt;a href="https://taimoorsattar.dev/blogs/monolithic-and-microservice-architecture-for-website-development"&gt;monolithic or microservices architecture&lt;/a&gt; to host your website. There main difference between the two architectures is that whether you want all of your application services in one place(server) or host service in a different place (server). You can host your front-end application service on one server and back-end service on another server.&lt;/p&gt;

&lt;p&gt;If you like this post, follow me on Twitter &lt;a href="https://twitter.com/intent/follow?original_referer=https%3A%2F%2Fpublish.twitter.com%2F&amp;amp;ref_src=twsrc%5Etfw&amp;amp;screen_name=taimoorsattar7&amp;amp;tw_p=followbutton"&gt;@taimoorsattar7&lt;/a&gt; for more update.&lt;/p&gt;

&lt;p&gt;To find out more, visit my blog &lt;a href="https://taimoorsattar.dev"&gt;taimoorsattar.dev&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>writing</category>
    </item>
    <item>
      <title>javascript url</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Wed, 30 Dec 2020 07:21:28 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/javascript-url-45ap</link>
      <guid>https://forem.com/taimoorsattar7/javascript-url-45ap</guid>
      <description></description>
    </item>
    <item>
      <title>CSS with javascript</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Wed, 30 Dec 2020 07:16:12 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/css-with-javascript-5hkm</link>
      <guid>https://forem.com/taimoorsattar7/css-with-javascript-5hkm</guid>
      <description></description>
    </item>
    <item>
      <title>Is Create-React-App Good For SEO?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Wed, 23 Dec 2020 08:09:44 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/is-create-react-app-good-for-seo-5ei</link>
      <guid>https://forem.com/taimoorsattar7/is-create-react-app-good-for-seo-5ei</guid>
      <description>&lt;p&gt;In short, &lt;strong&gt;create-react-app is not good for SEO&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  why?
&lt;/h2&gt;

&lt;p&gt;create-react-app is a &lt;strong&gt;SPA (single page application)&lt;/strong&gt;. In a SPA, all necessary HTML, JavaScript, and CSS code retrieved by the browser with a single page load or data add dynamically to the page based on certain actions.&lt;/p&gt;

&lt;p&gt;Search engines and social media look for SEO meta tags on the website. Based on these meta tags, display formated content to the user.&lt;/p&gt;

&lt;p&gt;By default in create-react-app, metatag like title and description mentioned in &lt;code&gt;public/index.html&lt;/code&gt;. When the page loads, the default title shows in the tab of the browser and for every route, it follows the same.&lt;/p&gt;

&lt;p&gt;What if, you are fetching an article post from an API and after fetching the data, it updates the value of title and description. But the default title shows up in the SEO, not the fetching title. If your app depends on SEO then it is a huge problem.&lt;/p&gt;

&lt;h2&gt;
  
  
  So how you can overcome this?
&lt;/h2&gt;

&lt;p&gt;You need to prerender the create-react-app. To prerender, You can download either of two npm package as below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-snapshot"&gt;React SnapShot&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-snap"&gt;React Snap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The above plugins work well if you are not using Windows / local storage objects in your project (Javascript), else you need to follow some extra checks.&lt;/p&gt;

&lt;p&gt;Moreover, you can use &lt;a href="https://www.gatsbyjs.com/"&gt;Gatsby&lt;/a&gt; and the &lt;a href="https://nextjs.org/"&gt;next JS&lt;/a&gt; are the frameworks that are built on React with SEO friendly pre-rendered website.&lt;/p&gt;

&lt;p&gt;You can follow me on Twitter &lt;a href="https://twitter.com/taimoorsattar7"&gt;@taimoorsattar7&lt;/a&gt; for more updates.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How do you promote your online business?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Wed, 16 Dec 2020 09:53:53 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-do-you-promote-your-online-business-3mca</link>
      <guid>https://forem.com/taimoorsattar7/how-do-you-promote-your-online-business-3mca</guid>
      <description></description>
      <category>discuss</category>
    </item>
    <item>
      <title>How to Document your repository in GitHub?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Fri, 03 Apr 2020 21:52:00 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/how-to-document-your-repository-in-github-59f2</link>
      <guid>https://forem.com/taimoorsattar7/how-to-document-your-repository-in-github-59f2</guid>
      <description>&lt;p&gt;Documentation of your repo will help you in many aspects. When you link your repo to the hiring team, they will better understand what your code is doing. Also, it will help others to contribute to your project. To write documentation for your repo, you can create &lt;code&gt;README.md&lt;/code&gt; in the root of the repo.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;README.md&lt;/code&gt; reads as a markdown file. I have also written details articles about &lt;a href="https://taimoorsattar.dev/blogs/markdown-guide-getting-started-20200304"&gt;Markdown Get Started Guide&lt;/a&gt;. &lt;strong&gt;Markdown does not give you whole lot control over the styling of the page&lt;/strong&gt;. For example, center the image, adjust the width and height, etc. Additionally, you can also write HTML (inline-CSS) in the &lt;code&gt;README.md&lt;/code&gt; file as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div align="center"&amp;gt;
  &amp;lt;br&amp;gt;
  &amp;lt;img alt="logo" src="/image.png" width="200px"&amp;gt;
  &amp;lt;h1&amp;gt;Your headline&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;br&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  What information to include in &lt;code&gt;README.md&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;It all depends on your project. It is how you explain what the project is all about. But I have listed out some point that you can list in your documentation repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- Include Photo or logo
- How it Works
- Getting started.
- Prerequisites
- How to contribute (Write CONTRIBUTING.md)
- Information about team
- Related Project
- Contributors, Backers, or Sponsors.
- License
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Add Table of Content (TOC)
&lt;/h2&gt;

&lt;p&gt;If your &lt;code&gt;README.md&lt;/code&gt; file has a long length, then it's better to add table of content. You can add a table of content like this below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- [How it Works](#how-it-works)
- [Getting started](#get-started)
- [Contributing](#contributing)
- [Core team](#core-team)
- [License](#license)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Clicking the &lt;code&gt;TOC&lt;/code&gt; link will scroll to the desire section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## How it Works
your explanation...

## Getting started](#get-started)
your explanation...

## [Contributing](#contributing)
your explanation...

## [Core team](#core-team)
your explanation...

## [License](#license)
your explanation...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create Badge/shields
&lt;/h2&gt;

&lt;p&gt;Batches/shields look nicer as it adds information on your repo. Batches/Shields are small block legible badges in SVG and raster format, which can be included in GitHub readmes or any other web page. You can check the status of repo like code size, commit status, or deployments, etc. You can look at how these Badges look on the repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XybJbAwZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/wy48th8r5vpurvfuokh1.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XybJbAwZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/wy48th8r5vpurvfuokh1.PNG" alt="Badge/shields GitHub" width="800" height="58"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How you can add these badges
&lt;/h3&gt;

&lt;p&gt;If you use Netlify to deploy your code; you get a badge on their dashboard which shows deploys status. &lt;a href="https://shields.io"&gt;shields.io&lt;/a&gt; and &lt;a href="https://www.codetriage.com"&gt;codetriage&lt;/a&gt; are also good resources to add badges for your repo. you can add in README.md as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;img src="https://img.shields.io/github/languages/code-size/taimoorsattar7/underlinejobs" alt="GitHub Code Size in Bytes"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  further structure your documentation
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;README.md&lt;/code&gt; describes the basic information about the repo. If your information is long enough to fit into &lt;code&gt;README.md&lt;/code&gt;, you can make further sections. For example, &lt;code&gt;CODE_OF_CONDUCT.md&lt;/code&gt; and &lt;code&gt;CONTRIBUTING.md&lt;/code&gt;. Write how to contribute to this repo in the &lt;code&gt;CONTRIBUTING.md&lt;/code&gt; and code of conduct in &lt;code&gt;CODE_OF_CONDUCT.md&lt;/code&gt;. In this way, you can be more organized.&lt;/p&gt;

&lt;p&gt;Your documentation should be grammatically correct so it is properly understood by others. You can check grammatical mistakes using tools like &lt;a href="http://www.hemingwayapp.com"&gt;hemingwayapp&lt;/a&gt; and &lt;a href="https://www.grammarly.com"&gt;grammarly&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Show some love if you like this article. Follow me on twitter &lt;a href="https://twitter.com/taimoorsattar7"&gt;@taimoorsattar7&lt;/a&gt; as I post frequently.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>github</category>
    </item>
    <item>
      <title>Whats your's set of software used in you daily routine?</title>
      <dc:creator>Taimoor Sattar</dc:creator>
      <pubDate>Fri, 20 Dec 2019 18:53:40 +0000</pubDate>
      <link>https://forem.com/taimoorsattar7/whats-your-s-set-of-software-used-in-you-daily-routine-19h4</link>
      <guid>https://forem.com/taimoorsattar7/whats-your-s-set-of-software-used-in-you-daily-routine-19h4</guid>
      <description>&lt;p&gt;In daily routine, there are lot of software I used to interact with. I prefer &lt;a href="https://www.grammarly.com"&gt;Grammarly&lt;/a&gt; for writing, &lt;a href="https://code.visualstudio.com"&gt;Vs studio code&lt;/a&gt; for writing code, &lt;a href="https://affinity.serif.com/en-gb"&gt;affinity designer&lt;/a&gt; for designing stuff, &lt;a href="https://www.gitbook.com"&gt;gitbook&lt;/a&gt; for documentation.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
