<?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: Max Anselmo</title>
    <description>The latest articles on DEV Community by Max Anselmo (@themanselmo).</description>
    <link>https://dev.to/themanselmo</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%2F736528%2Ffc59eccf-4c76-4904-996a-673f9546e830.jpeg</url>
      <title>DEV Community: Max Anselmo</title>
      <link>https://dev.to/themanselmo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/themanselmo"/>
    <language>en</language>
    <item>
      <title>Remove Git Config from New Rails / React / etc Project</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Sat, 29 Jan 2022 18:03:22 +0000</pubDate>
      <link>https://dev.to/themanselmo/remove-git-config-from-new-rails-react-etc-project-l57</link>
      <guid>https://dev.to/themanselmo/remove-git-config-from-new-rails-react-etc-project-l57</guid>
      <description>&lt;p&gt;Have you ever begin working on a full stack project, created a new React (enter front end framework name here) and Ruby on Rails (enter back end framework name here) project inside of a single Github repository?&lt;br&gt;
ex file structure&lt;/p&gt;

&lt;p&gt;--- coffee-shop-app (github repo)&lt;br&gt;
     |&lt;br&gt;
     |---react-front-end&lt;br&gt;
     |&lt;br&gt;
     |---rails-back-end&lt;/p&gt;

&lt;p&gt;You may have encountered an issue when trying to push code and met with this message: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"You've added another git repository inside your current repository.&lt;br&gt;
Clones of the outer repository will not contain the contents of the embedded repository and will not know how to obtain it."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Some frameworks include a file for their own github configurations with the rest of the boilerplate code.&lt;/p&gt;

&lt;p&gt;Luckily, to delete this file all you need to do is cd into each submodule repo and use the command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf .git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you will be able to freely add files from your encompassing github repo.&lt;/p&gt;

&lt;p&gt;Hope this helps, this totally threw me for a loop at first!&lt;/p&gt;

</description>
      <category>fullstack</category>
      <category>rails</category>
      <category>react</category>
      <category>github</category>
    </item>
    <item>
      <title>Strange Bugs 1: The Fussy Controlled Form</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Thu, 09 Dec 2021 19:48:00 +0000</pubDate>
      <link>https://dev.to/themanselmo/strange-bugs-1-the-fussy-controlled-form-9gj</link>
      <guid>https://dev.to/themanselmo/strange-bugs-1-the-fussy-controlled-form-9gj</guid>
      <description>&lt;h1&gt;
  
  
  Welcome to Strange Bugs!
&lt;/h1&gt;

&lt;p&gt;In this post I will go over a bug I encountered while creating a controlled form in the app I'm working on.&lt;/p&gt;

&lt;p&gt;Here is the layout for the component I was building:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Card = () =&amp;gt; {
   const [showFront, setShowFront] = useState(true)
   const [formData, setFormData] = useState({
      input1: value1,
      input2: value2,
      ...
   })

   function handleInputChange(e) {
      const name = e.target.name;
      const value = e.target.value;
      setFormData({ ...formData, [name]: value });
   }
   ...

   const CardFront = () =&amp;gt; {
      return &amp;lt;form&amp;gt;
         &amp;lt;input name="input1" value={formData.input1}
         &amp;lt;input name="input2" value={formData.input2}
         ...
         &amp;lt;button&amp;gt;Submit&amp;lt;/button&amp;gt;
      &amp;lt;/form&amp;gt;

   }

   const CardBack = () =&amp;gt; {
      return &amp;lt;div&amp;gt;
         &amp;lt;p&amp;gt;{formdata.input1}&amp;lt;/p&amp;gt;
         &amp;lt;p&amp;gt;{formdata.input2}&amp;lt;/p&amp;gt;
         ...
      &amp;lt;/div&amp;gt;

   }

   return (
      { showFront ? &amp;lt;CardFront /&amp;gt; : &amp;lt;CardBack /&amp;gt;
   )

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Bug:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When attempting to type into one of the inputs, I was only able to enter one character, and then I would be tabbed out of the input, and would have to re click the input over and over to continue typing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Struggle:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This bug had me stumped for a good few hours, unsure what was causing the issue. After some time, I was convinced there was something going on with the state, as this issue had only came up after I turned the inputs into a controlled form by giving them state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Realization:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While taking a look and breaking things down line by line with a fellow peer, we finally discovered what was going on. On each keystroke while typing in one of the inputs, the state for the formData would be updated in the parent / wrapper component, which would re-render the child component, causing it to forget that we we're writing in one of the inputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My hack to fix this, was to simply break the nested components out of themselves, and put the jsx into react fragments instead.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;return (
      { showFront ? 
         &amp;lt;&amp;gt; 
            &amp;lt;form&amp;gt;
               &amp;lt;input name="input1" value= {formData.input1}
               &amp;lt;input name="input2" value={formData.input2}
            ...
               &amp;lt;button&amp;gt;Submit&amp;lt;/button&amp;gt;
            &amp;lt;/form&amp;gt;
         &amp;lt;/&amp;gt; 
         : 
         &amp;lt;&amp;gt; 
            &amp;lt;div&amp;gt;
               &amp;lt;p&amp;gt;{formdata.input1}&amp;lt;/p&amp;gt;
               &amp;lt;p&amp;gt;{formdata.input2}&amp;lt;/p&amp;gt;
               ...
            &amp;lt;/div&amp;gt;
         &amp;lt;/&amp;gt;
   )

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

&lt;/div&gt;



</description>
      <category>react</category>
      <category>webdev</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>Full-Stack Development in a Nutshell</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Wed, 24 Nov 2021 17:44:49 +0000</pubDate>
      <link>https://dev.to/themanselmo/the-full-stack-development-process-1hgp</link>
      <guid>https://dev.to/themanselmo/the-full-stack-development-process-1hgp</guid>
      <description>&lt;h1&gt;
  
  
  So what even is "Full-Stack Development"?
&lt;/h1&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%2Fuploads%2Farticles%2F43xe8xya9zs8qer4jldt.jpeg" 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%2Fuploads%2Farticles%2F43xe8xya9zs8qer4jldt.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Full-Stack&lt;/em&gt; is a term used to define a style of development that includes working on an application front to back, with everything in between how an application looks and a user interacts with it (Front-End) and how that application manages the data needed to do what it does, and how the "magic" happens behind the scenes (Back-End)&lt;/p&gt;

&lt;p&gt;This role is usually broken up between a &lt;em&gt;Front-End&lt;/em&gt; Developer, who &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;focuses on the look and feel of an application&lt;/li&gt;
&lt;li&gt;makes requests to the back-end for data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;while the &lt;em&gt;Back-End&lt;/em&gt; Developer focuses on &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;creating / managing the database&lt;/li&gt;
&lt;li&gt;crafting responses to be returned to the front-end&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a Full-Stack Developer, we will need to complete certain tasks to ensure our application is covered front to back and has everything it needs to function properly.&lt;/p&gt;

&lt;p&gt;The flow of data in one of our applications will be handled in the following way&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A User will visit our applications front-end, and will do some form of action, for example, try to log in or create an account.&lt;/li&gt;
&lt;li&gt;When they hit submit to sign up, a POST http request containing data from our sign up form on the front-end will be sent from our front-end to a specific API endpoint in the back-end server that is running.&lt;/li&gt;
&lt;li&gt;The back-end will receive the http request at its endpoint, and execute the action to create a new user in the database with the passed in data.&lt;/li&gt;
&lt;li&gt;If everything goes well with that transaction, then the user interacting with the front-end will be redirected to the login page to log in with their newly created account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The flow of data will be similar for most of not all other actions a user will have with our application.&lt;/p&gt;

&lt;h2&gt;
  
  
  A list of some skills needed to complete a full-stack application might include:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Front-End
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;HTML/CSS, JavaScript

&lt;ul&gt;
&lt;li&gt;HTML will be the skeleton of our front end, CSS will put a dress on that skeleton to make it look pretty, and JavaScript will make that skeleton dance!&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;How to make http requests

&lt;ul&gt;
&lt;li&gt;This is how we will interact with our back-end to get data to display&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Maybe a front-end framework like React.js/Next.js

&lt;ul&gt;
&lt;li&gt;This will help us build rich, immersive websites by allowing us to build more efficiently / quickly with our HTML / JavaScript skills&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Drawing things out / wireframing 

&lt;ul&gt;
&lt;li&gt;This is actually useful for both planning out your front-end page structure / layout as well as your database table structure / relationships in your back-end&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Back-End
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Ruby on Rails, Java / Spring, Python, JavaScript, etc

&lt;ul&gt;
&lt;li&gt;This will be what we write all the logic for our database with&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Any kind of SQL (PostgreSQL, SQLite, etc)

&lt;ul&gt;
&lt;li&gt;This will be used to create/ manage our database&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Data Structures / Algorithms

&lt;ul&gt;
&lt;li&gt;Knowledge in these areas is necessary for being able to efficiently search and sort through our data&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Model View Controller patterns

&lt;ul&gt;
&lt;li&gt;MVC comes in handy when orchestrating the logic in our back end that responds to http requests, and dictates what logic should be executed upon receiving a request.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Object Oriented Programming

&lt;ul&gt;
&lt;li&gt;OOP is useful to know when defining our database models, and allows for abstraction with topics like object classes and inheritance (this can also be used in the front end!)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&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%2Fuploads%2Farticles%2Facph52d7x5dmye5ct3ya.jpeg" 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%2Fuploads%2Farticles%2Facph52d7x5dmye5ct3ya.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And that is a general overview of Full-Stack Development!&lt;/p&gt;

</description>
      <category>fullstack</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Data Structures 101</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Thu, 18 Nov 2021 17:56:20 +0000</pubDate>
      <link>https://dev.to/themanselmo/data-structures-101-4h01</link>
      <guid>https://dev.to/themanselmo/data-structures-101-4h01</guid>
      <description>&lt;p&gt;&lt;strong&gt;Welcome to Data Structures 101!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here we will cover a basic overview of concepts you'll need to get started mastering your skills of structuring data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array&lt;/strong&gt;&lt;br&gt;
The Array is the most basic data structure, which is actually used as the foundation to some of the following structures (queue, stack)&lt;/p&gt;

&lt;p&gt;An array is simply a list of something, for example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Shopping List: Onion, Garlic, Carrots, Milk, Eggs

let shoppingList = ["Onion", "Garlic", "Carrots", "Milk", "Eggs"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Rules for adding items to an array are pretty loose, and elements can usually be added in any order, but this differs for other data structures.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Queue&lt;/strong&gt;&lt;br&gt;
The Queue is similar to an array in that it is a list, however when adding or removing things to a queue, we have to follow a "&lt;strong&gt;first&lt;/strong&gt; in, &lt;strong&gt;first&lt;/strong&gt; out" order of operations.&lt;br&gt;
Meaning, the &lt;strong&gt;first&lt;/strong&gt; item we insert into a queue, will be the &lt;strong&gt;first&lt;/strong&gt; item to be removed from a queue.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gfBqZjvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.guim.co.uk/img/static/sys-images/Guardian/About/General/2011/6/15/1308149463745/People-Waiting-in-Line-Ou-005.jpg%3Fwidth%3D620%26quality%3D85%26auto%3Dformat%26fit%3Dmax%26s%3D51f7746a7aff7ce2dbbe76d0d6d25912" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gfBqZjvG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.guim.co.uk/img/static/sys-images/Guardian/About/General/2011/6/15/1308149463745/People-Waiting-in-Line-Ou-005.jpg%3Fwidth%3D620%26quality%3D85%26auto%3Dformat%26fit%3Dmax%26s%3D51f7746a7aff7ce2dbbe76d0d6d25912" alt="Image description" width="460" height="276"&gt;&lt;/a&gt;&lt;br&gt;
Think of a queue of people waiting in line...&lt;br&gt;
The first person in line is going to be the first person to leave the line!&lt;br&gt;
This means when adding or removing elements from the queue, we are limited to this same way of thinking.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stack&lt;/strong&gt;&lt;br&gt;
The Stack is also similar to an array, and a brother/sister to the queue, however when adding or removing things to a stack, we have to follow a "&lt;strong&gt;first&lt;/strong&gt; in, &lt;strong&gt;last&lt;/strong&gt; out" order of operations.&lt;br&gt;
Meaning, the &lt;strong&gt;first&lt;/strong&gt; item we insert into a queue, will be the &lt;strong&gt;last&lt;/strong&gt; item to be removed from a queue.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OCQV9vzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://blog.williams-sonoma.com/wp-content/uploads/2020/02/stack-pancakes-blog-post-1000px-680x680.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OCQV9vzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://blog.williams-sonoma.com/wp-content/uploads/2020/02/stack-pancakes-blog-post-1000px-680x680.jpg" alt="Image description" width="680" height="680"&gt;&lt;/a&gt;&lt;br&gt;
Think of a stack of pancakes! &lt;br&gt;
The first pancake added to the plate is going to be the last one to be removed (granted you eat them top to bottom and don't just slice through all of the pancakes at once...).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Linked List&lt;/strong&gt;&lt;br&gt;
The Linked List is where things begin to get a little abstract. This structure consists of an element (or node) that has a variable in it that &lt;em&gt;points&lt;/em&gt; to another element in memory. So rather than being contained inside of something like an array, these elements are connected via their own pointer variable that relates them to one another.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ACvSqMB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/970/1%2Af2oDQ0cdY54olxCFOIMIdQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ACvSqMB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://miro.medium.com/max/970/1%2Af2oDQ0cdY54olxCFOIMIdQ.png" alt="Image description" width="880" height="546"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Linked lists can be singly linked, meaning they have a head element that points to the next element, and the next, and so on until the reaching an element that has a pointer to NULL.&lt;br&gt;
They can also be doubly linked, meaning each element has a next and previous pointer to their respective next and previous elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tree&lt;/strong&gt;&lt;br&gt;
A tree structure is sort of similar to a linked list in that its elements point to each other in memory, although here instead of having a next and/or previous variable pointing to an element, it has a left and/or right child element. This indicates whether the element being pointed to is to the left or right of said element.&lt;br&gt;
The left / right nature of each elements child elements leads to the "tree" like structure, giving this data structure its name!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7NQVUqmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.thecrazyprogrammer.com/wp-content/uploads/2019/09/General-Tree-Structure.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7NQVUqmD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://www.thecrazyprogrammer.com/wp-content/uploads/2019/09/General-Tree-Structure.png" alt="Image description" width="570" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While possibly one of the most difficult to fully understand, the tree structure can be extremely effective performance-wise given proper implementation.&lt;/p&gt;

&lt;p&gt;And that is the end of Data Structures 101!&lt;br&gt;
There is a LOT more to learn about each of these structures and the pros and cons of each, but this is just a basic overview to get your digital feet wet.&lt;/p&gt;

&lt;p&gt;Here's some links to additional sources on the topic:&lt;br&gt;
&lt;a href="https://www.tutorialspoint.com/data_structures_algorithms/index.htm"&gt;tutorialspoint: data_structures_algorithms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>computerscience</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Getting Started with Gatsby.js</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Thu, 04 Nov 2021 14:54:25 +0000</pubDate>
      <link>https://dev.to/themanselmo/getting-started-with-gatsbyjs-2m7i</link>
      <guid>https://dev.to/themanselmo/getting-started-with-gatsbyjs-2m7i</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Gatsby?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Gatsby is a &lt;em&gt;static site generator&lt;/em&gt;, which means that it produces &lt;em&gt;static html files&lt;/em&gt; that we serve to the viewers of our application. Gatsby will not necessarily be running on our final application, however it will &lt;em&gt;GENERATE&lt;/em&gt; that application that will be deployed!&lt;/p&gt;

&lt;p&gt;Just because it's a "static" site, that does not mean the site isn't interactive or responsive. We can put &lt;em&gt;Javascript&lt;/em&gt; files into the pages that Gatsby serves, make api calls, do interactions, and build rich and immersive pages.&lt;/p&gt;

&lt;p&gt;Gatsby uses &lt;em&gt;node.js&lt;/em&gt; to help generate the static files that it serves up to the user.&lt;/p&gt;

&lt;p&gt;To source data, Gatsby uses another technology called &lt;em&gt;graphql&lt;/em&gt; (graphql is a technology that makes api calls simpler and more efficient, as well as allowing us to source data from a variety of sources! This allows us to take in data from markdown files, CMS's (Wordpress, etc), access databases,  and more!&lt;/p&gt;

&lt;p&gt;Gatsby is built on top of React, which allows us to take advantage of React's modularity and templating abilities, making it easier to keep our code organized and reusable.&lt;/p&gt;

&lt;p&gt;Gatsby is also built with a plugin architecture in mind, allowing &lt;br&gt;
users to develop and share their own tools for everyone to use!&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%2Fuploads%2Farticles%2F5oit8pd1vgj8vfgk74ak.jpeg" 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%2Fuploads%2Farticles%2F5oit8pd1vgj8vfgk74ak.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Use Gatsby?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Speed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since Gatsby pages are static, they are WAY faster than other options.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Security&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Since we are just shipping static html pages, should a hacker get into our application they will only have access to those static pages and wont be able to do as much damage compared to if they got into a Wordpress site or access to user information.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Dev Experience&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Programming with Gatsby involves working with a modern development environment. Gatsby's tools are 'simple' to use (compared to more antiquated technologies), the languages are clean and tidy, and the open source, great documentation and tutorials provided by the Gatsby team and community are amazing resources.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lets make a &lt;em&gt;basic&lt;/em&gt; Gatsby app&lt;/p&gt;

&lt;p&gt;Go into your terminal and run &lt;code&gt;npm install -g gatsby-cli&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This installs the necessary commands on your machine to create and work with a Gatsby application in the command line.&lt;/p&gt;

&lt;p&gt;To verify the Gatsby cli has been installed, run &lt;code&gt;Gatsby --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If some output like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Gatsby CLI version: [version number]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;is displayed, you're good to go!&lt;/p&gt;

&lt;p&gt;Now to create our boilerplate Gatsby Application.&lt;br&gt;
Run &lt;code&gt;gatsby new&lt;/code&gt; &lt;br&gt;
You will be prompted to enter your applications name, as well as to configure a few other things.&lt;br&gt;
Once that is done loading up, your app is ready to go!&lt;/p&gt;

&lt;p&gt;Now &lt;code&gt;cd&lt;/code&gt; into your newly created app, and run &lt;code&gt;gatsby develop&lt;/code&gt;,&lt;br&gt;
this will start your local development server for your application.&lt;br&gt;
You should see this message indicating everything's up and running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You can now view [YOUR-APP-NAME] in the browser.
⠀
  http://localhost:8000/
⠀
View GraphiQL, an in-browser IDE, to explore your site's data and
schema
⠀
  http://localhost:8000/___graphql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Navigate to &lt;code&gt;http://localhost:8000/&lt;/code&gt; in your browser, and you should be seeing your freshly generated Gatsby site!&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%2Fuploads%2Farticles%2F4rksff5n9gs60vzmrhtg.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%2Fuploads%2Farticles%2F4rksff5n9gs60vzmrhtg.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulations! You now have your own running Gatsby Application ready to be customized and flushed out to your hearts content.&lt;/p&gt;

&lt;p&gt;Links to more sources on Gatsby&lt;br&gt;
&lt;a href="https://www.gatsbyjs.com/" rel="noopener noreferrer"&gt;Gatsby Home Site&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>gatsby</category>
    </item>
    <item>
      <title>Beginners Guide to CRUD using JavaScript</title>
      <dc:creator>Max Anselmo</dc:creator>
      <pubDate>Thu, 28 Oct 2021 02:30:32 +0000</pubDate>
      <link>https://dev.to/themanselmo/beginners-guide-to-crud-using-javascript-2d03</link>
      <guid>https://dev.to/themanselmo/beginners-guide-to-crud-using-javascript-2d03</guid>
      <description>&lt;p&gt;So you want to write your own CRUD functionality in JavaScript? Well this is the right place to be!&lt;br&gt;
But first off, what the heck is CRUD?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CRUD&lt;/strong&gt; stands for:&lt;br&gt;
&lt;strong&gt;C&lt;/strong&gt;reate - &lt;strong&gt;R&lt;/strong&gt;ead - &lt;strong&gt;U&lt;/strong&gt;pdate - &lt;strong&gt;D&lt;/strong&gt;elete&lt;/p&gt;

&lt;p&gt;These are the four cardinal functions used when interacting with a database or dealing with data in general, and to use that functionality in JavaScript, we're going to use something called &lt;code&gt;fetch&lt;/code&gt; to make a http request.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fetch&lt;/code&gt; is a built in JavaScript function that is not compatible with older browsers, but works very well with the modern browsers that do support it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;fetch&lt;/code&gt; takes in an &lt;em&gt;address&lt;/em&gt; where the http request should be sent to, and optionally takes in &lt;em&gt;options&lt;/em&gt; (method, headers, body, etc) and returns a promise (the container that our fetch response is in).&lt;/p&gt;

&lt;p&gt;The most basic fetch request is a &lt;strong&gt;Get&lt;/strong&gt; request. This is an example of our &lt;strong&gt;Read&lt;/strong&gt; crud functionality.&lt;/p&gt;

&lt;p&gt;Here is how we will set up our get request using fetch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const whereWeWantToFetch = "url"
fetch(whereWeWantToFetch)
.then(res =&amp;gt; res.json())
.then(data =&amp;gt; console.log(data))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When no &lt;code&gt;method&lt;/code&gt; is included, and the only argument passed to &lt;code&gt;fetch&lt;/code&gt; is the url, the default operation will be a &lt;strong&gt;Get&lt;/strong&gt; request.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;url&lt;/em&gt; is going to be where we are fetching to, where our database is.&lt;br&gt;
We &lt;em&gt;then&lt;/em&gt; convert our promise returned from our fetch to usable json, and finally &lt;em&gt;then&lt;/em&gt; take our &lt;strong&gt;data&lt;/strong&gt; and do whatever we want with it! (Although here we simply console.log it)&lt;/p&gt;

&lt;p&gt;The next example request is a &lt;strong&gt;Post&lt;/strong&gt; request. This is an example of our &lt;strong&gt;Create&lt;/strong&gt; crud functionality.&lt;br&gt;
Here is how we will set up our post request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const whatIWantToPost = "Post me!"
const whereWeWantToFetch = "url"
fetch(whereWeWantToFetch, {
    method: "POST",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify(whatIWantToPost)
})
.then(res =&amp;gt; res.json())
.then(data =&amp;gt; console.log(data))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice the post requires a few extra bits compared to our get request. Here we need to include a &lt;em&gt;method&lt;/em&gt; (what we are doing, here we are POSTing), &lt;em&gt;headers&lt;/em&gt; (letting the server know what type of data to expect from the post request), and a &lt;em&gt;body&lt;/em&gt; (what we are sending in the post request)&lt;/p&gt;

&lt;p&gt;The third example request is a &lt;strong&gt;Patch&lt;/strong&gt; request. This is an example of our &lt;strong&gt;Update&lt;/strong&gt; crud functionality.&lt;br&gt;
Here is how we will set up our Patch request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const itemToUpdate = {...}
const whereWeWantToFetch = "url/${itemToUpdate.id}"
fetch(whereWeWantToFetch, {
    method: "PATCH",
    headers: {
        "Content-Type": "application/json"
    },
    body: JSON.stringify({
        key: "updatedValue"
    })
})
.then(res =&amp;gt; res.json())
.then(data =&amp;gt; console.log(data))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The patch request is similar to post, however here we are updating an existing item in our database.&lt;br&gt;
Notice here we have to include an &lt;strong&gt;id&lt;/strong&gt; at the end of our url to specify which item in our database we would like to update.&lt;/p&gt;

&lt;p&gt;The final and relatively simple request is our &lt;strong&gt;Delete&lt;/strong&gt; request, completing our CRUD acronym.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const itemToDelete = {...}
const whereWeWantToFetch = "url/${itemToDelete.id}"
fetch(whereWeWantToFetch, {
    method: "DELETE"
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Delete requires no headers or body, only a method, as it is just removing something from our database.&lt;/p&gt;

&lt;p&gt;... and with that, you now have all the basics to implement CRUD functions into your JavaScript application!&lt;/p&gt;

&lt;p&gt;Here's some additional resources on the topic:&lt;br&gt;
&lt;a href="https://javascript.info/fetch"&gt;javascript docs&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch"&gt;mozilla&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.w3schools.com/js/js_api_fetch.asp"&gt;w3schools&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>database</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
