<?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: Audrea Cook</title>
    <description>The latest articles on DEV Community by Audrea Cook (@audthecodewitch).</description>
    <link>https://dev.to/audthecodewitch</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%2F239639%2F3050525d-9596-46a9-b8aa-b67b1a11a584.jpg</url>
      <title>DEV Community: Audrea Cook</title>
      <link>https://dev.to/audthecodewitch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/audthecodewitch"/>
    <language>en</language>
    <item>
      <title>A Tale of Two Classes</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 17 Jul 2020 17:06:31 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/a-tale-of-two-classes-1ibd</link>
      <guid>https://dev.to/audthecodewitch/a-tale-of-two-classes-1ibd</guid>
      <description>&lt;p&gt;Yesterday, I was challenged by a potential employer (fingers crossed) to share a few JS classes I’m proud of. I had a lot of fun writing this up, and I figured I would share it with y’all, as well.&lt;/p&gt;

&lt;p&gt;Below, you will find code samples from my React app, &lt;a href="https://github.com/AudTheCodeWitch/OurCAL" rel="noopener noreferrer"&gt;OurCal&lt;/a&gt;, which is deployed on Heroku, &lt;a href="https://our-cal.herokuapp.com/" rel="noopener noreferrer"&gt;here&lt;/a&gt;. I chose this project because it was originally written in vanilla JS before I refactored it, and I thought it would be interesting to show how the classes evolved.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/AudTheCodeWitch/OurCAL/blob/v0.1.0/frontend/javascripts/block.js" rel="noopener noreferrer"&gt;vanilla JS &lt;code&gt;Block&lt;/code&gt; class&lt;/a&gt; creates the 25x25 pixel grid, or block. The constructor accepts the block’s &lt;code&gt;name&lt;/code&gt; and an array of &lt;code&gt;pixels&lt;/code&gt;. To create the individual &lt;code&gt;Pixel&lt;/code&gt; objects, the constructor calls the &lt;code&gt;createPixels&lt;/code&gt; method, which loops through the &lt;code&gt;pixels&lt;/code&gt; array and calls on the &lt;code&gt;Pixel&lt;/code&gt; class for each element. This method returns the newly-created &lt;code&gt;Pixel&lt;/code&gt; objects as an array to be sent to the back end.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://github.com/AudTheCodeWitch/OurCAL/blob/v0.1.0/frontend/javascripts/pixel.js" rel="noopener noreferrer"&gt;vanilla JS &lt;code&gt;Pixel&lt;/code&gt; class&lt;/a&gt; is a simple constructor. It accepts four arguments, the &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; coordinates, the background &lt;code&gt;color&lt;/code&gt;, and the &lt;code&gt;color_variable&lt;/code&gt; representing the pen used to select the pixel.&lt;/p&gt;

&lt;p&gt;After converting OurCal to a React app, the classes get a bit more complex (and fun).&lt;/p&gt;

&lt;center&gt;
&lt;img src="https://i.giphy.com/media/42wakmA8VzrB7eP0VT/source.gif" alt='Moira Rose saying, "No one will ever accuse you of being vanilla again."' width="475" height="475"&gt;
&lt;/center&gt;

&lt;p&gt;The &lt;a href="https://github.com/AudTheCodeWitch/OurCAL/blob/main/client/src/components/CompleteBlock.js" rel="noopener noreferrer"&gt;React &lt;code&gt;CompleteBlock&lt;/code&gt; class&lt;/a&gt; displays a fully-colored block. It takes the block’s &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;block&lt;/code&gt; data as props. The &lt;code&gt;createBlock&lt;/code&gt; and &lt;code&gt;createColumns&lt;/code&gt; methods work in tandem to populate a grid with individual &lt;code&gt;Pixel&lt;/code&gt; objects. On &lt;code&gt;componentDidMount()&lt;/code&gt;, the pixels are then filled with the appropriate background colors, using the &lt;code&gt;colorPixels&lt;/code&gt; method.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://github.com/AudTheCodeWitch/OurCAL/blob/main/client/src/components/Pixel.js" rel="noopener noreferrer"&gt;React &lt;code&gt;Pixel&lt;/code&gt; class&lt;/a&gt; creates the individual pixels, based on the block’s location, which is passed in through props. If the location is &lt;code&gt;Template&lt;/code&gt; (the editable block), a click handler is attached to the pixel. The &lt;code&gt;handleClick&lt;/code&gt; method toggles the pixel’s &lt;code&gt;className&lt;/code&gt; (and corresponding background color). Pixels in the &lt;code&gt;Template&lt;/code&gt; location are also added to the Redux store through &lt;code&gt;componentDidMount.&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Alert!
&lt;/h2&gt;

&lt;p&gt;The current Heroku deployment contains a bug dealing with the toggled background colors.&lt;/p&gt;

&lt;center&gt;
&lt;img src="https://i.giphy.com/media/1xOQlQxrIX4Jw6lBZI/giphy.gif" alt="Night Flight bug and screaming woman" width="480" height="480"&gt;
&lt;/center&gt;

&lt;p&gt;I am aware of it and have addressed the problem in the code. I’m working on deploying the fix, hopefully, later today.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>oop</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Upgrade Your Flatiron Blog - Part 2</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Thu, 09 Jul 2020 22:15:00 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/upgrade-your-flatiron-blog-part-2-1dae</link>
      <guid>https://dev.to/audthecodewitch/upgrade-your-flatiron-blog-part-2-1dae</guid>
      <description>&lt;p&gt;A few months ago, I shared &lt;a href="https://dev.to/audthecodewitch/upgrade-your-basic-flatiron-blog-2fc5-temp-slug-5074332"&gt;how to spruce up your Flatiron blog&lt;/a&gt;. Since then, I’ve continued to publish a new blog post each week. Learn.co provides Flatiron students with a built-in blogging platform that is serviceable, if not flashy. Of CodeWitch.dev’s 35 blog posts, I wrote and published 30 of them through Learn.co.&lt;/p&gt;

&lt;p&gt;At the beginning of June, a prospective employer asked me what I knew about CMSs, or Content Management Systems. At the time, my answer was, “Honestly? Not much.”&lt;/p&gt;

&lt;p&gt;Determined to come up with a better answer for my follow-up email, I did some research. I learned that a CMS is simply a way to handle all the content (pages, blog posts, etc.) for a website. A CMS is especially helpful for team members who aren’t as tech-savvy because it wraps the tricky code into a nice, WYSIWYG (what you see is what you get) format.&lt;/p&gt;

&lt;p&gt;As an experiment, I decided to migrate my Flatiron blog to a CMS. Through this process, I figured I would learn a new skill, have a better understanding of what a CMS is actually good for, and maybe – just maybe – find a nicer text editor for my blog.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choose a CMS
&lt;/h2&gt;

&lt;p&gt;There are countless CMSs out there, but I ultimately settled on Forestry.io for the following reasons:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The free plan would fit my needs perfectly.&lt;/li&gt;
&lt;li&gt;It integrates cleanly with GitHub Pages and Jekyll, which is how Flatiron initially builds your blog.&lt;/li&gt;
&lt;li&gt;It has a live preview server.&lt;/li&gt;
&lt;li&gt;It is git-based, meaning all posts and edits would be pushed to the GitHub repository first, making it easy to track changes.&lt;/li&gt;
&lt;li&gt;It came &lt;a href="https://bejamas.io/blog/headless-cms/#introduction" rel="noopener noreferrer"&gt;highly recommended&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sign Up for Forestry.io
&lt;/h2&gt;

&lt;p&gt;If you’re ready to make the change, sign up for your &lt;a href="https://app.forestry.io/signup" rel="noopener noreferrer"&gt;free Forestry.io account&lt;/a&gt;. I chose to sign up through GitHub, but you can use a regular email address and password if you like.&lt;/p&gt;

&lt;h2&gt;
  
  
  Import Your Blog
&lt;/h2&gt;

&lt;p&gt;Once you’ve logged in, importing your blog is simple.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the green &lt;strong&gt;Add Site&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Within the popup, select your static site generator. Again, your Flatiron blog is already built with Jekyll.
&lt;center&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Faddsite.png" alt="Select Static Site" width="800" height="400"&gt;
&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Select your git provider. Your Flatiron blog is on Github. Make sure the &lt;strong&gt;Quick Setup via OAuth&lt;/strong&gt; toggle is on.
&lt;center&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fgitprovider.png" alt="Select git provider" width="800" height="400"&gt;
&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Choose your git repository (it should look like &lt;code&gt;YourUsername/BlogName.github.io&lt;/code&gt;) and the branch you would like to use.
&lt;center&gt;
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fchooserepo.png" alt="Choose git repository" width="800" height="400"&gt;
&lt;/center&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From here, Forestry will import your blog!&lt;/p&gt;

&lt;h2&gt;
  
  
  Start Writing
&lt;/h2&gt;

&lt;p&gt;On the left sidebar, Forestry.io will detect the basic components of your blog. They will be broken into &lt;strong&gt;Pages&lt;/strong&gt; (your home, about, and any other static pages you created) and &lt;strong&gt;Posts&lt;/strong&gt; (your individual blog posts).&lt;/p&gt;

&lt;p&gt;If you click the &lt;strong&gt;Posts&lt;/strong&gt; button, it will display all the blog posts you’ve published so far. One feature I really like is the &lt;strong&gt;Set as draft&lt;/strong&gt; option, located under the &lt;strong&gt;More Options&lt;/strong&gt; (&lt;code&gt;...&lt;/code&gt;) icon to the right of each post. This way, you can make edits and use the live previewer without changing your published post until you are ready!&lt;/p&gt;

&lt;p&gt;To begin a new blog post, click the &lt;strong&gt;Create new&lt;/strong&gt; button. On the left will be your front matter (learn how to configure that here), and the right will display your WYSIWYG editor.&lt;/p&gt;

&lt;center&gt;
    &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fwysiwyg.png" alt="WYSIWYG editor view" width="800" height="400"&gt;
  &lt;/center&gt;

&lt;p&gt;For the most part, this view works perfectly for me. However, I occasionally want to tweak my code blocks or customize the HTML a bit more. For this, I click the &lt;strong&gt;More Options&lt;/strong&gt; (&lt;code&gt;...&lt;/code&gt;) icon at the top of the page and select the &lt;strong&gt;Raw Editor&lt;/strong&gt;. This displays your blog post in its bare Markdown format, complete with handy-dandy line numbers!&lt;/p&gt;

&lt;center&gt;
    &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fraweditor.png" alt="Raw editor view" width="800" height="400"&gt;
  &lt;/center&gt;

&lt;h2&gt;
  
  
  Make Forestry.io Your Own
&lt;/h2&gt;

&lt;p&gt;By now, you are successfully using a CMS to run your technical blog! The simple instructions I provided are a great start, but Forestry.io has many tools yet to be explored! I highly recommend you &lt;a href="https://forestry.io/docs/welcome/" rel="noopener noreferrer"&gt;check out their awesome docs&lt;/a&gt;. I also suggest reading up on Forestry.io’s &lt;strong&gt;Front matter&lt;/strong&gt; and &lt;strong&gt;Media&lt;/strong&gt; tools. In short: have fun with it! It is your blog, after all.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>COVIDiary pt. 11 - Basic Header</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 26 Jun 2020 21:29:46 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-11-basic-header-2lo8</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-11-basic-header-2lo8</guid>
      <description>&lt;p&gt;Welcome to Part 11 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2"&gt;Part 6: Formatting Data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me"&gt;Part 7: A Little More Action&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-8-make-the-connection-1p06"&gt;Part 8: Make the Connection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-9-ux-design-l5j"&gt;Part 9: UX Design&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-10-our-first-component-3883"&gt;Part 10: Our First Component&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re creating a simple &lt;code&gt;Header&lt;/code&gt; component. We aren’t getting into the nitty-gritty of adding auth just yet. Today’s goal is to get the basic layout of our &lt;code&gt;Header&lt;/code&gt;. Before we begin, run &lt;code&gt;yarn start&lt;/code&gt; in your terminal to open your application in the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stub the Component
&lt;/h2&gt;

&lt;p&gt;Create a new file in your &lt;code&gt;src/components&lt;/code&gt; folder called &lt;code&gt;Header.js&lt;/code&gt;. Add a simple functional component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react';

const Header = () =&amp;gt; {
  return (
    &amp;lt;div&amp;gt;
      COVIDiary
    &amp;lt;/div&amp;gt;
  );
};

export default Header;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Import the Header
&lt;/h2&gt;

&lt;p&gt;Let’s add our &lt;code&gt;Header&lt;/code&gt; to &lt;code&gt;App.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;src/App.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Header from './components/Header';

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

&lt;/div&gt;



&lt;p&gt;Just after the opening &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; In the &lt;code&gt;render()&lt;/code&gt; section, add our component:&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;Header /&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;You can remove all the default React code if you’d like. I moved it into a &lt;code&gt;main&lt;/code&gt; tag so I had a placeholder between my header and footer.&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;main&amp;gt;
  &amp;lt;img src={logo} className="App-logo" alt="logo" /&amp;gt;
  &amp;lt;p&amp;gt;
    Edit &amp;lt;code&amp;gt;src/App.js&amp;lt;/code&amp;gt; and save to reload.
  &amp;lt;/p&amp;gt;
  &amp;lt;a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer"&amp;gt;
    Learn React
  &amp;lt;/a&amp;gt;
&amp;lt;/main&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Right now, your project will look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fbasic-header.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fbasic-header.jpg" title="Basic Header" alt="COVIDiary with the stubbed header component" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fill in the Details
&lt;/h2&gt;

&lt;p&gt;Let’s start to format our header to match our wireframe sketch. From here on out, we’re working in &lt;code&gt;components/Header.js&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For our header, we will be using React-Bootstrap’s &lt;a href="https://react-bootstrap.github.io/components/navbar/" rel="noopener noreferrer"&gt;&lt;code&gt;NavBar&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://react-bootstrap.github.io/components/navs/" rel="noopener noreferrer"&gt;&lt;code&gt;Nav&lt;/code&gt;&lt;/a&gt; components. To begin, import the components at the top of your file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Navbar from "react-bootstrap/Navbar";
import Nav from "react-bootstrap/Nav";

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

&lt;/div&gt;



&lt;p&gt;Now, let’s replace our &lt;code&gt;div&lt;/code&gt; with &lt;code&gt;NavBar&lt;/code&gt;. We’ll pass it props to adjust the styling.&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;Navbar expand='md' bg='dark' variant='dark' as='header'&amp;gt;
  {/*expand - breakpoint at which hamburger menu expands*/}
  {/*bg - sets background color*/}
  {/*variant - use dark color scheme for dark bg*/}
  {/*as - converts default &amp;lt;div&amp;gt; tag to &amp;lt;header&amp;gt; tag*/}
&amp;lt;/Navbar&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Within our &lt;code&gt;Navbar&lt;/code&gt;, let’s put our site’s name on the left. You could also use a logo here, if you had one. We’ll have this element link to our root page.&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;Navbar.Brand href="/"&amp;gt;COVIDiary&amp;lt;/Navbar.Brand&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;We also want to make sure our &lt;code&gt;Navbar&lt;/code&gt; is responsive so it will adapt when users adjust their screen sizes.&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;Navbar.Toggle aria-controls="responsive-navbar-nav"/&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Finally, let’s add the main navigation links. We want them to collapse into a hamburger menu on smaller screens, so we will wrap them in a &lt;code&gt;&amp;lt;Navbar.Collapse&amp;gt;&lt;/code&gt; component. Note the id and className come straight from the React-Bootstrap documentation.&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;Navbar.Collapse id="responsive-navbar-nav"&amp;gt;
  &amp;lt;Nav className="ml-auto" as='nav'&amp;gt;
  {/*ml-auto - aligns nav links to the right of the container*/}
    &amp;lt;Nav.Link href="/about"&amp;gt;About&amp;lt;/Nav.Link&amp;gt;
    &amp;lt;Nav.Link href="/register"&amp;gt;Register&amp;lt;/Nav.Link&amp;gt;
  &amp;lt;/Nav&amp;gt;
&amp;lt;/Navbar.Collapse&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Our basic header is complete! Here it is on medium and larger screens:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fmedium-header.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fmedium-header.jpg" title="Medium Header" alt="Header on medium and larger screens" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is the hamburger menu on small screens:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fcollapsed-header.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fcollapsed-header.jpg" title="Small Header" alt="Header with hamburger menu" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And here is the expanded hamburger menu:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fexpanded-small-header.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fexpanded-small-header.jpg" title="Expanded Small Header" alt="Header with expanded hamburger menu" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Now that we’ve got our &lt;code&gt;Header&lt;/code&gt; component, we’re ready to get into some more complicated aspects of our front end!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Words Matter</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 19 Jun 2020 21:43:53 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/words-matter-184o</link>
      <guid>https://dev.to/audthecodewitch/words-matter-184o</guid>
      <description>&lt;p&gt;Earlier this week, GitHub announced they are working on changing their default branch name from &lt;code&gt;master&lt;/code&gt; to &lt;code&gt;main&lt;/code&gt; to show solidarity with the Black Lives Matter movement. This sparked a bit of a Twitter storm, with arguments both for and against this change.&lt;/p&gt;

&lt;p&gt;As a white, cis-gendered woman of middle-class, I haven’t felt like I had much to personally contribute to the Black Lives Matter discussion. Instead, I’ve used my platform to amplify the voices of others – to share with, support, and encourage those who fight for an end to the systemic racism in our country.&lt;/p&gt;

&lt;p&gt;But now we’re talking about words. On this, I have something to say (and a degree to back it up).&lt;/p&gt;

&lt;h2&gt;
  
  
  My Path
&lt;/h2&gt;

&lt;p&gt;I grew up in a small community of mostly-white, mostly-middle-class, country folk. I was taught to never say the N-word, but I heard it every now and again. But other words were deemed perfectly acceptable. I am ashamed to say that “gay” and “retarded,” both used in a derogatory sense, were a regular part of my lexicon. They were just the words everyone used (remember this for later).&lt;/p&gt;

&lt;p&gt;When I was in college, my brother, Adam, came out as a proud gay man. Shortly thereafter, my sister-in-law, Kyal, came out as a lesbian. Suddenly, I cared very much when someone described something negatively as “gay.” Two of the most beautiful, hilarious, and kind people in my universe are gay. There isn’t a single negative thing to be said about either of them, and I’ll have words with anyone who would like to say otherwise.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The term “gay,” as I had used it growing up, directly hurt people I cared about. So I stopped using it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Seven years ago, a princess was born. Her name is Haylie Sophia Grace, she is my niece, and she just happens to have Down Syndrome. Soon after her birth, her mom shared a post that read, “Spread the word to end the word.” That was the first time I truly connected the dots that a word I used all my life could be used to describe this precious baby. I was appalled. Over the years, Haylie has grown into one of the most expressive (and bossy) children I know, and I love her to bits. Not for a millisecond has the R-word applied to that intelligent, loving, and feisty little girl.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The R-word directly hurt people I cared about. So I stopped using it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The words “master/slave, blacklist/whitelist, black hat/white hat” are directly hurting people in our tech community. I care about them, so I stopped using the words. It really is that simple.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  An Argument
&lt;/h2&gt;

&lt;p&gt;Unfortunately, there are those who say it is, in fact, &lt;em&gt;not&lt;/em&gt; that simple. These technological terms have always been used this way. &lt;em&gt;Obviously,&lt;/em&gt; they aren’t about race; they are just the words we use.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Rebuttal
&lt;/h2&gt;

&lt;p&gt;Excuse me while I retrieve my eyeballs. They rolled so far back they got stuck behind my brain for a second.&lt;/p&gt;

&lt;center&gt;
&lt;img alt="Liz Lemon Eye Roll" src="https://i.giphy.com/media/BB8Gx0CaEASHu/source.gif" width="480" height="270"&gt;
&lt;/center&gt;

&lt;p&gt;I’ve got news for you. As I’ve personally proven, we can change our vocabulary. It takes a little conscious effort, at first, but it can be done. &lt;em&gt;And it isn’t even that hard.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;From a historical standpoint, it is perfectly logical that we would adopt new terminology. Language scholars will readily tell you that English, like all languages, is constantly evolving, primarily through changes in grammar, syntax, and – wait for it – &lt;em&gt;vocabulary&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Words that were acceptable in the past are now some of our favorite swear words (NSFW - read “&lt;a href="https://newrepublic.com/article/116713/swear-word-history-where-your-favorite-curses-came" rel="noopener noreferrer"&gt;Swear Word History&lt;/a&gt;” by Kate Wiles). Others have been completely forgotten, such as the Middle English (think &lt;em&gt;Canterbury Tales)&lt;/em&gt; word “clepped,” which means “called.” Don’t even get me started on Old English (think &lt;em&gt;Beowulf&lt;/em&gt;). Just try to read &lt;a href="http://www.oldenglishaerobics.net/psalm1.php" rel="noopener noreferrer"&gt;Psalm 1&lt;/a&gt; and tell me we haven’t changed a thing or two over the years.&lt;/p&gt;

&lt;p&gt;While some of these changes can be attributed to a specific reason, many just simply changed. If we can stop using “clepped” and start using “called” &lt;em&gt;just because&lt;/em&gt; surely we can change our vocabulary for an actual reason (Hint: the reason is our words are HURTING people in our community).&lt;/p&gt;

&lt;p&gt;History proves words everyone used don’t have to stick around. Just because we once used these terms, doesn’t mean we need to continue to, especially when there are substitutes at the ready. It’s time to evolve.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Change Your GitHub Branches
&lt;/h2&gt;

&lt;p&gt;So let’s start small by changing our primary GitHub branches from &lt;code&gt;master&lt;/code&gt; to &lt;code&gt;main&lt;/code&gt;. Unfortunately, I do not know of an automated way to do this, so you will need to go through these steps for each of your repositories. I will be doing this myself over the coming days.&lt;/p&gt;

&lt;p&gt;In your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git branch -master main
$ git push -u origin main

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

&lt;/div&gt;



&lt;p&gt;In your GitHub repository:&lt;/p&gt;

&lt;p&gt;Click the &lt;strong&gt;Settings&lt;/strong&gt; tab. On the side menu, click &lt;strong&gt;Branches&lt;/strong&gt;. Select &lt;code&gt;main&lt;/code&gt; from the dropdown. Click &lt;strong&gt;Update&lt;/strong&gt; , confirm the change, and you’re done!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Frenamed-branch.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Frenamed-branch.jpg" title="Default Branch" alt="How to set your default GitHub branch" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  A Final Thought
&lt;/h2&gt;

&lt;p&gt;In addition to ridding your technical projects of these insensitive terms, I would like to encourage you to consider what other words, currently present in your lexicon, might have an unintended effect on the people around you. The entry on &lt;a href="https://developers.google.com/style/inclusive-documentation" rel="noopener noreferrer"&gt;Writing Inclusive Documentation&lt;/a&gt; in the Google Developer Documentation Style Guide is a great starting point if you need some ideas.&lt;/p&gt;

&lt;p&gt;The bottom line is this: if we can adapt our vocabulary to make even one person feel heard and respected, why shouldn’t we?&lt;/p&gt;

</description>
    </item>
    <item>
      <title>COVIDiary pt. 10 - Our First Component</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Thu, 11 Jun 2020 21:37:41 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-10-our-first-component-3883</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-10-our-first-component-3883</guid>
      <description>&lt;p&gt;Welcome to Part 10 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2"&gt;Part 6: Formatting Data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me"&gt;Part 7: A Little More Action&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-8-make-the-connection-1p06"&gt;Part 8: Make the Connection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-9-ux-design-325k-temp-slug-13698"&gt;Part 9: UX Design&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re FINALLY writing code that will actually render in our browser! Today, we’re going to build our &lt;code&gt;Footer&lt;/code&gt; component. Though it’s a relatively simple piece of our application, I decided to start with it for a few reasons. First, the &lt;code&gt;Footer&lt;/code&gt; is the only page element that will be consistent throughout our entire application. It also gives us the opportunity to practice using a few tools that will be used extensively in the coming weeks. Finally, its simplicity allows us to focus on some React basics without having to worry about the more nuanced aspects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stub the Component
&lt;/h2&gt;

&lt;p&gt;Create a new file in your &lt;code&gt;src/components&lt;/code&gt; folder called &lt;code&gt;Footer.js&lt;/code&gt;. Because our component doesn’t need to hold state, we can keep it simple as a functional component. Let’s stub that out really quick:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import React from 'react';

const Footer = () =&amp;gt; {
    return (
        &amp;lt;div&amp;gt;
            Hello World!
        &amp;lt;/div&amp;gt;
    );
};

export default Footer;

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Import the Footer
&lt;/h2&gt;

&lt;p&gt;Let’s add our &lt;code&gt;Footer&lt;/code&gt; to &lt;code&gt;App.js&lt;/code&gt; so we can actually see our work in the browser.&lt;/p&gt;

&lt;p&gt;In &lt;code&gt;src/App.js&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import Footer from './components/Footer';

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

&lt;/div&gt;



&lt;p&gt;Just before the closing &lt;code&gt;&amp;lt;/div&amp;gt;&lt;/code&gt; In the &lt;code&gt;render()&lt;/code&gt; section, add our component:&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;Footer /&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;In your terminal, run &lt;code&gt;yarn start&lt;/code&gt;. This will open your application in the browser. Right now, it should look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Ffooter1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Ffooter1.png" title="Footer" alt="Footer with Hello World" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Fill in the Details
&lt;/h2&gt;

&lt;p&gt;Now that we’ve got our server up and running, let’s change that “Hello World” to something we actually want, shall we? From here on out, we’re working in &lt;code&gt;components/Footer.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;First, let’s replace the &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; in our &lt;code&gt;render()&lt;/code&gt; with &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt;. Then, we’ll add our logo and copyright information:&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;footer&amp;gt;
  {/*Logo link to CodeWitch blog*/}
  &amp;lt;a href={'[http://codewitch.dev](http://codewitch.dev "http://codewitch.dev")'}
  /*Opens link in new tab*/
  target={'_blank'}
  rel={'noopener noreferrer'}&amp;gt;
    &amp;lt;img src={'./CodeWitchLogo.png'} alt="AudTheCodeWitch Logo" height='50px' /&amp;gt;
  &amp;lt;/a&amp;gt;

  {/*Copyright information*/}
  &amp;lt;p&amp;gt;©2020 Audrea Cook&amp;lt;/p&amp;gt;

&amp;lt;/footer&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Let’s also add links to our social media profiles. We’ll use free icons from &lt;a href="https://fontawesome.com/" rel="noopener noreferrer"&gt;fontAwesome&lt;/a&gt;. To do this, we need to install some more packages. In your terminal, run the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ yarn add @fortawesome/fontawesome-svg-core @fortawesome/free-solid-svg-icons @fortawesome/react-fontawesome @fortawesome/free-brands-svg-icons @fortawesome/free-regular-svg-icons

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

&lt;/div&gt;



&lt;p&gt;When that is complete, import the icons by adding the following two lines to the top of your page:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faGithub, faTwitter, faLinkedin } from '@fortawesome/free-brands-svg-icons'

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

&lt;/div&gt;



&lt;p&gt;While we’re adding imports, let’s also bring in the react-bootstrap components we’ll be using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
import ListGroup from "react-bootstrap/ListGroup";
import ListGroupItem from "react-bootstrap/ListGroupItem";

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

&lt;/div&gt;



&lt;p&gt;Now, we’re ready to add some more code to our &lt;code&gt;&amp;lt;footer&amp;gt;&lt;/code&gt; element:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
{/*Using a ListGroup to create buttons for external links*/}
&amp;lt;ListGroup horizontal={"sm"} /*Will display horizontally vs vertically for screens size sm and up*/&amp;gt;
  &amp;lt;ListGroupItem action /*turns item into link button*/ href='https://github.com/AudTheCodeWitch' target="_blank" rel={'noopener noreferrer'} &amp;gt;
    {/*icon + text description*/}
    &amp;lt;FontAwesomeIcon icon={faGithub} /&amp;gt; GitHub
  &amp;lt;/ListGroupItem&amp;gt;

  &amp;lt;ListGroupItem action href='https://twitter.com/AudTheCodeWitch' target="_blank" rel={'noopener noreferrer'} &amp;gt;
    &amp;lt;FontAwesomeIcon icon={faTwitter} /&amp;gt; @audTheCodeWitch
  &amp;lt;/ListGroupItem&amp;gt;

  &amp;lt;ListGroupItem action href='https://www.linkedin.com/in/audreacook/' target="_blank" rel={'noopener noreferrer'} &amp;gt;
      &amp;lt;FontAwesomeIcon icon={faLinkedin} /&amp;gt; LinkedIn
  &amp;lt;/ListGroupItem&amp;gt;
&amp;lt;/ListGroup&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;If you save and refresh your browser, the footer should now look something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Ffooter2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Ffooter2.png" title="Finished footer" alt="Footer with external links and logo" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Now that we’ve got our &lt;code&gt;Footer&lt;/code&gt; component, we’re ready to keep building our application! Next week, we’ll tackle the &lt;code&gt;Header&lt;/code&gt;, another component that will be shared on every page! From there, we’ll really start to bring our project to life!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>COVIDiary pt. 9 - UX Design</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 05 Jun 2020 19:56:17 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-9-ux-design-l5j</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-9-ux-design-l5j</guid>
      <description>&lt;p&gt;Welcome to Part 9 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2"&gt;Part 6: Formatting Data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me"&gt;Part 7: A Little More Action&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-8-make-the-connection-1p06"&gt;Part 8: Make the Connection&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re stepping away from the keyboard. Though the work we’re about to do is &lt;em&gt;absolutely necessary for our sanity&lt;/em&gt;, it won’t involve a single line of code. In fact, if you want, you can complete all of today’s work with a pencil and paper!&lt;/p&gt;

&lt;p&gt;What are we doing? We’re planning our website layout. We’ll build a sitemap to get a feel for what pages we actually need. Then, we’ll create wireframes to rough out our design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Step Back?
&lt;/h2&gt;

&lt;p&gt;I’ve made a few websites now, and, due to project deadlines, they were largely chaotic, head-long rushes to completion. It was both stressful and terribly inefficient. As a writer, I &lt;em&gt;never&lt;/em&gt; worked without an outline. Why would I design an application without creating a plan?&lt;/p&gt;

&lt;p&gt;By pausing to get the broad strokes of our application on paper, we’ll free up time, later on, to hone and fine-tune our work. We’ll be able to visualize how a user might interact with our app, and we can use that to inform our design choices. We will see, at a glance, which React components will be used over and over.&lt;/p&gt;

&lt;h2&gt;
  
  
  Drafting the Sitemap
&lt;/h2&gt;

&lt;p&gt;Put simply, a sitemap is a list of pages on a website. There are &lt;a href="https://en.wikipedia.org/wiki/Site_map" rel="noopener noreferrer"&gt;different types of sitemaps&lt;/a&gt; for different uses, but today we’re just building an outline for planning purposes. From a development perspective, this is a crucial step.&lt;/p&gt;

&lt;p&gt;When designing your sitemap, your user should be at the forefront of your mind. What are the most important features to the user? How many clicks do they need to make to get from one page to the next? Which links should always be available? Which pages should be protected with a login?&lt;/p&gt;

&lt;p&gt;You can do this all on paper, but I used &lt;a href="https://www.diagrams.net/" rel="noopener noreferrer"&gt;diagrams.net&lt;/a&gt;, which is useful for all sorts of diagrams, not just a sitemap. I also highly recommend it when designing your database structure.&lt;/p&gt;

&lt;p&gt;Let’s get started.&lt;/p&gt;

&lt;p&gt;First, I created a box for each page I knew I wanted in my application. Then, I rearranged the boxes and connected them with arrows that indicate the user flow. Finally, I grouped the navigation and footer links together, as they will appear on every page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fsitemap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fsitemap.png" alt="COVIDiary Sitemap" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Drawing the Wireframes
&lt;/h2&gt;

&lt;p&gt;A wireframe is a very basic sketch of a webpage. They are like a builder’s set of blueprints. With a wireframe, developers are able to visualize the placement of different elements on a page.&lt;/p&gt;

&lt;p&gt;In many professional settings, a designer draws up the wireframes, and the developer writes the code that brings the plans to life. On personal projects or for smaller companies, however, we won’t always have that luxury.&lt;/p&gt;

&lt;p&gt;Having never actually made official wireframes myself, I read a few articles before I began. There are tons of great resources out there, but it seemed the bottom line with wireframes is to keep it simple.&lt;/p&gt;

&lt;p&gt;To sketch my wireframes, I grabbed a stack of 3x5 index cards and a marker. When constructing wireframes, many designers use a felt-tipped marker to prevent them from getting too detailed. I used one index card per page. I drew the wireframe on the blank side, and I used the lined side for any quick notes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fhome-wireframe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fhome-wireframe.jpg" alt="Wireframe for COVIDiary home page" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, the design for my home page is very simple. At a glance, I can see I want a few images (indicated by the boxed-x placeholder), a brief page intro, and a preview of three recent entries. I also know I want a horizontal navigation bar, and I have a general feel for what the footer should look like. After completing the rest of the wireframes, I can also tell which components will be used over and over, like the diary entries, for example.&lt;/p&gt;

&lt;p&gt;If I were collaborating with another developer, now would be a great time to seek feedback and compare notes. We could then iterate on our initial ideas until we have a set of designs we’re both happy with.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fwireframes.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.codewitch.dev%2Fuploads%2Fwireframes.jpg" alt="Wireframes for COVIDiary app" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Remember, these wireframes are your outline. They are loose sketches, and you aren’t married to any specific idea. Don’t stress too much over your designs at first. Just get some thoughts on paper. We’ll refine our ideas once we start coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Now that we’ve got a general idea of the pages and components we need to build, we’re ready to build our first React components!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Course Review: FreeCodeCamp’s Responsive Web Design</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Sat, 30 May 2020 01:29:16 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/course-review-freecodecamp-s-responsive-web-design-2bn2</link>
      <guid>https://dev.to/audthecodewitch/course-review-freecodecamp-s-responsive-web-design-2bn2</guid>
      <description>&lt;p&gt;We’re taking a short break from COVIDiary, simply because I wanted to share something else I’ve been working on with you. Just last night, I completed &lt;a href="https://www.freecodecamp.org/learn/" rel="noopener noreferrer"&gt;freeCodeCamp’s Responsive Web Design&lt;/a&gt; course.&lt;/p&gt;

&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FYneDt3f.png" alt="Responsive Web Design certificate of completion" width="800" height="462"&gt;&lt;/center&gt;

&lt;p&gt;You may be thinking, “She completed Flatiron’s boot camp. Why is she doing freeCodeCamp now?” Here’s the thing: a friend of mine compared the learning experience at Flatiron to drinking from a firehose. It is a perfect analogy. We learned so much, so quickly, that it was often overwhelming. We didn’t have the opportunity to dive deep into concepts like accessibility or design. While Flatiron taught me a little about a lot, I am using this time during my job search as an opportunity to broaden my understanding and hone my craft as a developer.&lt;/p&gt;

&lt;p&gt;Now that I have completed the first 300-hour course on freeCodeCamp (and am halfway through the second), I would like to share a few insights about their material.&lt;/p&gt;

&lt;p&gt;Let me start by saying how truly impressed I was with this course. I have been working with HTML and CSS for over a decade, and I still learned so much. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Curriculum
&lt;/h2&gt;

&lt;p&gt;Let’s talk about the curriculum. The course is broken into 7 modules, plus a section of 5 projects at the end. Each lesson has a quick readme with a coding exercise. To advance to the next lesson, your code must pass the given tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 1: Introduction to Basic HTML and HTML5
&lt;/h3&gt;

&lt;p&gt;Composed of 28 lessons, this module covers the very basics any beginner needs to start using HTML. This section starts with the traditional “Hello World” exercise and builds from there. Beginners will be introduced to common HTML elements and their purposes, including the semantic elements introduced in HTML5, such as &lt;code&gt;header&lt;/code&gt;, &lt;code&gt;footer&lt;/code&gt;, &lt;code&gt;section&lt;/code&gt;, and &lt;code&gt;article&lt;/code&gt;. Learners also practice building forms, lists, and adding images.&lt;/p&gt;

&lt;p&gt;Again, this section covers the fundamentals. If you already have experience in HTML, it will only take a few minutes to complete. It will take a tad longer for true code newbies, but both this module and the next are very beginner friendly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 2: Basic CSS
&lt;/h3&gt;

&lt;p&gt;This 44-lesson module covers quite a bit of ground on the topic of CSS. Like the previous section, it covers the CSS fundamentals any beginner would need to know: how to use in-line styling, how to use CSS selectors, and how to assign id and class attributes to your HTML tags. From there, it begins to show the true power of CSS. Learners import fonts from a Google api. They learn the distinction between &lt;code&gt;padding&lt;/code&gt; and &lt;code&gt;margin&lt;/code&gt;, as well as the corresponding shorthand notations.&lt;/p&gt;

&lt;p&gt;I was especially impressed to see lessons covering the usage of variables in CSS. Using variables is a great way to experiment with different color schemes and themes without spending ages trying to adjust each individual element.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 3: Applied Visual Design
&lt;/h3&gt;

&lt;p&gt;This module consists of 52 lessons and is a blend of HTML and CSS. This section really highlights how CSS and HTML work together to create outstanding webpages. This was my first introduction into creating animations with CSS, and I found it extremely interesting. Learners also resize and position elements, choose and adjust colors, and create gradients. &lt;/p&gt;

&lt;h3&gt;
  
  
  Module 4: Applied Accessibility
&lt;/h3&gt;

&lt;p&gt;For me, this was the most important module in the course. At 22 lessons long, it didn’t take much time to complete, but I learned so much about web accessibility. I especially appreciated the lessons that explained how to make your page more usable by screen readers. This was something I, never having needed such a device, hadn’t previously considered. This module also covers concepts such as choosing high-contrast color schemes to address colorblindness issues, use headings properly, and improve form accessibility with elements like &lt;code&gt;label&lt;/code&gt; and &lt;code&gt;fieldset&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 5: Responsive Web Design Principles
&lt;/h3&gt;

&lt;p&gt;This module is short and sweet, at only 4 lessons. It explains how to create a media query and make images and other elements responsive, but I feel like this was the weakest section of the course.&lt;/p&gt;

&lt;p&gt;In the future, I would love to see freeCodeCamp expand this section to discuss mobile-first vs desktop-first design approaches. A few lessons discussing important media query break-points would also be awesome. To supplement the section as it currently stands, I recommend reviewing the &lt;a href="https://www.w3schools.com/css/css_rwd_mediaqueries.asp" rel="noopener noreferrer"&gt;Media Queries&lt;/a&gt; section of w3schools’ Responsive Web Design module.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 6: CSS Flexbox
&lt;/h3&gt;

&lt;p&gt;The final two modules cover some more advanced aspects of CSS. This 17-lesson section explains how to use &lt;code&gt;flexbox&lt;/code&gt; to position elements within a container. While freeCodeCamp covers &lt;code&gt;flexbox&lt;/code&gt; pretty well, I still find it to be a little confusing, especially for beginners. If you struggle with this section, I suggest reading &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="noopener noreferrer"&gt;A Complete Guide to Flexbox&lt;/a&gt; by CSS-Tricks. Their explanations and illustrations, coupled with freeCodeCamp’s exercises, really solidified this concept for me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module 7: CSS Grid
&lt;/h3&gt;

&lt;p&gt;The final module is 22 lessons long, and covers &lt;code&gt;grid&lt;/code&gt;, another tool for creating complex web layouts. Having used &lt;code&gt;grid&lt;/code&gt; in previous projects (not to mention countless Neopets pages), I found this module to be a solid review. Learners create basic grids using &lt;code&gt;grid-template-rows&lt;/code&gt; and &lt;code&gt;grid-template-columns&lt;/code&gt;. After learning to adjust these grids, users then learn to align items within the grid as well as use the ever-helpful &lt;code&gt;grid-template-areas&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Projects
&lt;/h2&gt;

&lt;p&gt;To complete this course, learners must create 5 separate pages, each with unique user stories to guide the design. FreeCodeCamp provides a CodePen.io example for each project, but they also give a huge amount of creative freedom.&lt;/p&gt;

&lt;p&gt;I make no claims to being a designer. However, after quickly getting the tests to pass, I usually spent a few more hours playing with the CSS, tweaking things here and there, and trying new techniques learned throughout this course.&lt;/p&gt;

&lt;p&gt;I chose to complete these projects using my own editor (RubyMine) instead of CodePen. I also created a GitHub repository for each project to track my code changes. Additionally, I used these projects as an opportunity to practice deploying sites to Heroku.&lt;/p&gt;

&lt;p&gt;Here are my submissions for the 5 projects. Click the links to see them in action. Note that any forms don’t actually submit anywhere.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Tribute Page - &lt;a href="https://mequa-tribute-fcc.herokuapp.com/" rel="noopener noreferrer"&gt;A Tribute to Mequa&lt;/a&gt;
&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FCFmGtbj.png" alt="Screenshot of Mequa tribute page" width="800" height="727"&gt;&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Survey Form - &lt;a href="https://aquarium-survey-fcc.herokuapp.com/" rel="noopener noreferrer"&gt;Aquarium Survey&lt;/a&gt;
&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FQfOSIYH.png" alt="Screenshot of aquarium survey page" width="800" height="712"&gt;&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Product Landing Page - &lt;a href="https://tarot-product-landing-fcc.herokuapp.com/" rel="noopener noreferrer"&gt;Code Witch’s Tarot&lt;/a&gt;
&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2Fi3Ttona.png" alt="Screenshot of tarot product landing page" width="800" height="710"&gt;&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Technical Documentation Page - &lt;a href="https://ruby-docs-fcc.herokuapp.com/" rel="noopener noreferrer"&gt;Ruby for Basic Witches&lt;/a&gt;
&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2F1MRHKAh.png" alt="Screenshot of Ruby documentation page" width="800" height="736"&gt;&lt;/center&gt;
&lt;/li&gt;
&lt;li&gt;Personal Portfolio Webpage - &lt;a href="https://portfolio-page-fcc.herokuapp.com/" rel="noopener noreferrer"&gt;The Code Witch&lt;/a&gt;
&lt;center&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FIMl2XN8.png" alt="Screenshot of personal portfolio page" width="800" height="602"&gt;&lt;/center&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Overall, I think freeCodeCamp has created an excellent course. Did it take me 300 hours to complete? Definitely not. Would it take that long for an absolute beginner? Possibly. Either way, the Responsive Web Design course is a solid review for experienced devs, and a great introductory course for code newbies.&lt;/p&gt;

&lt;p&gt;If you have ANY interest in code or web design, I highly recommend starting with &lt;a href="https://www.freecodecamp.org/learn/" rel="noopener noreferrer"&gt;freeCodeCamp&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>html</category>
      <category>css</category>
      <category>reviews</category>
    </item>
    <item>
      <title>COVIDiary pt. 8 - Make the Connection</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Thu, 21 May 2020 19:17:10 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-8-make-the-connection-1p06</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-8-make-the-connection-1p06</guid>
      <description>&lt;p&gt;Welcome to Part 8 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2"&gt;Part 6: Formatting Data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me"&gt;Part 7: A Little More Action&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re going to shift focus to the front end. By the end of today, we will be able to retrieve data from our API!&lt;/p&gt;

&lt;p&gt;Before we write any code, make sure your backend server is running. In &lt;code&gt;CD-api&lt;/code&gt;, run &lt;code&gt;rails s&lt;/code&gt; to fire it up. Leave that running and open your &lt;code&gt;CD-Client&lt;/code&gt; repository in another window.&lt;/p&gt;

&lt;h2&gt;
  
  
  Write Fetch Requests
&lt;/h2&gt;

&lt;p&gt;We’ll be working solely in &lt;code&gt;/src/App.js&lt;/code&gt; today. We will write two separate, but extremely similar, fetch requests. Write your code in the &lt;code&gt;App&lt;/code&gt; class but before the &lt;code&gt;render()&lt;/code&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// test fetch

  // the fetch requests will run when the App.js component mounts

  componentDidMount() {

    // fetch all the public entries

    fetch('http://localhost:3000/api/entries')

      // take the response and convert it to json

      .then(response =&amp;gt; response.json())

      // take the resulting json and log it to the console

      .then(data =&amp;gt; {

        console.log("All public entries:", data);

      })

      // if there is an error, log an error message to the console

      .catch((error) =&amp;gt; {

        console.error('Public Entries Error:', error);

      });



    // fetch the first user's entries

    fetch('http://localhost:3000/api/users/1/entries')

      .then(response =&amp;gt; response.json())

      .then(data =&amp;gt; {

        console.log("single user's entries:", data);

      })

      .catch((error) =&amp;gt; {

        console.error('Single User Entries Error:', error);

      });

  }

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

&lt;/div&gt;



&lt;p&gt;We can now test our connection to our backend server! Start your server using &lt;code&gt;yarn start&lt;/code&gt; and open it in the browser. Open the browser console so you can see the fetch results!&lt;/p&gt;

&lt;center&gt;
&lt;img alt="Rocket Power - It worked" src="https://i.giphy.com/media/xT1R9XQAtJN7SIrSjC/giphy.gif" width="480" height="360"&gt;
&lt;/center&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Eureka! The front and back ends are communicating with one another! Next week, we’ll shift our focus to building out the front end so we can actually see something.&lt;/p&gt;

</description>
      <category>fetch</category>
      <category>react</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>COVIDiary pt. 7 - A Little More Action</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 15 May 2020 20:26:37 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-7-a-little-more-action-34me</guid>
      <description>&lt;p&gt;Welcome to Part 7 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2"&gt;Part 6: Formatting Data&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re going to continue work on the back end, in &lt;code&gt;CD-API&lt;/code&gt;. By the end of today, we will have basic CRUD actions for our Users and their Entries.&lt;/p&gt;

&lt;p&gt;Today’s post will be a little long. Get yourself a Pepsi and some snacks, and settle in, friends.&lt;/p&gt;

&lt;center&gt;
&lt;img alt="Go easy on the Pepsi" src="https://i.giphy.com/media/BTtkhBLbMUD16/source.gif" width="245" height="265"&gt;
&lt;/center&gt;

&lt;h3&gt;
  
  
  #public Class Method
&lt;/h3&gt;

&lt;p&gt;If you’ll recall, we added the &lt;code&gt;is_public&lt;/code&gt; boolean to our &lt;code&gt;entries&lt;/code&gt; table. We want users to be able to decide if others can see their posts or not. When we fetch from &lt;code&gt;api/entries&lt;/code&gt;, we should only see the entries that have been marked as public. Let’s add a class method to our &lt;code&gt;Entry&lt;/code&gt; class in &lt;code&gt;models/entry.rb&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
  # returns all the entries where is_public equals true

  def self.public

    self.all.select {|entry| entry.is_public? == true}

  end

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Controller Modifications
&lt;/h3&gt;

&lt;p&gt;Right now, our controllers are basically empty. Let’s build them out a bit. For the moment, we want CRUD (Create, Read, Update/edit, Destroy/delete) actions for both Users and Entries. We will probably tweak these some once we start manipulating data from the front end, but we’ll have a solid start by the end of today.&lt;/p&gt;

&lt;p&gt;Let’s start by building out our &lt;code&gt;UsersController&lt;/code&gt; in &lt;code&gt;controllers/api/users_controller.rb&lt;/code&gt;. As you look through the following code snippets, remember to read the comments, which are preceded by the &lt;code&gt;#&lt;/code&gt; symbol.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
class Api::UsersController &amp;lt; ApplicationController

  # GET api/users

  # This action lists ALL the users in our database

  def index

    users = User.all

    render json: UserSerializer.new(users)

  end

  # POST api/users

  # This action creates a new user, given the provided parameters

  def create

    user = User.create(user_params)

    if user.save

      render json: UserSerializer.new(user)

    else

      render json: { error: "Error creating user" }

    end

  end

  # GET api/users/:id

  # This action shows a specific user, determined by the :id parameter

  def show

    user = User.find(params[:id])

    render json: UserSerializer.new(user)

  end

  # PATCH api/users/:id/

  # This action allows a user to update his or her data.

  def update

    user = User.find(params[:id])

    if user.update(user_params)

      render json: UserSerializer.new(user)

    else

      render json: { error: "Error updating user" }

    end

  end

  # DELETE api/users/:id

  # This action completely removes a user from the database

  # We may want to update this later to also destroy a user's entries

  def destroy

    user = User.find(params[:id])

    user.destroy

  end

  private

  # Determine which parameters to allow from a form submission

  def user_params

    params.require(:user).permit(

        :id,

        :first_name,

        :last_name,

        :email,

        :birth_date,

        :occupation,

        :is_essential,

        :isolation_start,

        :isolation_end,

        :about

    )

  end

end

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

&lt;/div&gt;



&lt;p&gt;Are you still with me?&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Dr. House checking in" src="https://i.giphy.com/media/331KYDEYvSGNW/source.gif" width="354" height="271"&gt;
&lt;/center&gt;

&lt;p&gt;Let’s add the CRUD actions for our &lt;code&gt;EntriesController&lt;/code&gt; in &lt;code&gt;controllers/api/entries_controller.rb&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
class Api::EntriesController &amp;lt; ApplicationController

# before we call a controller action, call the #set_user private method

  before_action :set_user

  # GET api/users/:user_id/entries OR api/entries

  # This action lists ALL the entries in the database OR all the entries for a given user.

  def index

    # if there is a user in the params, only show their entries. 

    # Otherwise, only show the public entries.

    # TODO: edit user entries so they only show private ones if it is the current user

    entries = @user ? @user.entries : Entry.public

    options = {

        include: [:user]

    }

    render json: EntrySerializer.new(entries, options)

  end

  # POST api/users/:user_id/entries

  # This action creates a new entry assigned to a given user

  def create

    entry = @user.entries.build(entry_params)

    if entry.save

      render json: EntrySerializer.new(entry)

    else

      render json: { error: "Error creating entry" }

    end

  end

  # GET api/users/:user_id/entries/:id

  # This action shows a specific entry for a given user

  def show

    entry = Entry.find(params[:id])

    options = {

        include: [:user]

    }

    render json: EntrySerializer.new(entry, options)

  end

  # PATCH api/users/:user_id/entries/:id

  # This action allows a user to update his or her entry.

  def update

    entry = Entry.find(params[:id])

    if entry.update(entry_params)

      render json: EntrySerializer.new(entry)

    else

      render json: { error: "Error updating entry" }

    end

  end

  # DELETE api/users/:user_id/entries/:id

  # This action completely removes an entry from the database

  def destroy

    entry = Entry.find(params[:id])

    entry.destroy

  end

  private

  # This method allows us to find a specific user 

  def set_user

    if params[:user_id]

      @user = User.find(params[:user_id])

    end

  end

  # Determine which parameters to allow from a form submission

  def entry_params

    params.require(:entry).permit(

        :id,

        :user_id,

        :health_rating,

        :is_symptomatic,

        :health_comments,

        :mental_health_rating,

        :mental_health_comments,

        :diary_entry,

        :is_public,

    :created_at

    )

  end

end

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Our back end is ready to deliver information to the Client app. Next week, we’ll test that connection with a few &lt;code&gt;fetch()&lt;/code&gt; requests to make sure everything is running smoothly.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>rails</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>COVIDiary pt. 6 - Formatting Data</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Thu, 07 May 2020 19:54:52 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-6-formatting-data-of2</guid>
      <description>&lt;p&gt;Welcome to Part 6 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf"&gt;Part 5: Backend Routing&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re working on the back end. By the end of today, we will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add some important gems&lt;/li&gt;
&lt;li&gt;Generate serializers to properly format our data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Are you ready? Let’s do this.&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Let’s do this!" src="https://i.giphy.com/media/JykvbWfXtAHSM/giphy.gif" width="480" height="270"&gt;
&lt;/center&gt;

&lt;p&gt;Open your &lt;code&gt;CD-API&lt;/code&gt; repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Add Gems
&lt;/h2&gt;

&lt;p&gt;We need to add two more gems to our &lt;code&gt;Gemfile&lt;/code&gt; to help the front and back ends communicate properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Rack CORS Middleware
&lt;/h3&gt;

&lt;p&gt;The first is Rack CORS Middleware, which will let our fetch requests work. Rack CORS is used so frequently in Rails applications that it’s automatically included in your &lt;code&gt;Gemfile&lt;/code&gt;. To use it, simply uncomment the line in your &lt;code&gt;Gemfile&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
gem 'rack-cors'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We also need to uncomment the following section in &lt;code&gt;config/initializers/cors.rb&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Rails.application.config.middleware.insert_before 0, Rack::Cors do
  allow do
    origins 'example.com'

    resource '*',
      headers: :any,
      methods: [:get, :post, :put, :patch, :delete, :options, :head]
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, change &lt;code&gt;example.com&lt;/code&gt; to &lt;code&gt;*&lt;/code&gt; for now.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fast JSON API
&lt;/h3&gt;

&lt;p&gt;The second gem we need to add is Fast JSON API. This will allow us to generate serializers and properly format our data before sending it to the front end. You can read more about serializers here. In your &lt;code&gt;Gemfile&lt;/code&gt;, add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem ‘fast_jsonapi’
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it! Now that we’ve added both gems, let’s install them by running &lt;code&gt;bundle install&lt;/code&gt; in your terminal. You can also start up your backend server now using &lt;code&gt;rails s&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Generate Serializers
&lt;/h2&gt;

&lt;p&gt;We need a serializer for both our &lt;code&gt;Entries&lt;/code&gt; and our &lt;code&gt;Users&lt;/code&gt;.&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Get that cereal!" src="https://i.giphy.com/media/3o85xKRIokv92FRo52/source.gif" width="900" height="506"&gt;
&lt;/center&gt;

&lt;p&gt;With Fast JSON API, these are easy to create with the &lt;code&gt;rails g serializer&lt;/code&gt; command. Let’s do that now. In your terminal, enter the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rails g serializer Entry
rails g serializer User
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will now have a &lt;code&gt;serializers&lt;/code&gt; directory in your &lt;code&gt;app&lt;/code&gt; directory, and it will contain your two new serializer files. They should look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class EntrySerializer
  include FastJsonapi::ObjectSerializer
  attributes 
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s configure these to present the data the way we want. First, we’ll add our relationships. A user has many entries, so in your &lt;code&gt;UserSerializer&lt;/code&gt; class, add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;has_many :entries
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ll set up the opposite side of the relationship in your &lt;code&gt;EntrySerializer&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Belongs_to :user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have the relationships under control, we need to specify which data attributes we want to serialize. In your &lt;code&gt;EntrySerializer&lt;/code&gt; class, change the &lt;code&gt;attributes&lt;/code&gt; line to look like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;attributes :id,
             :health_rating,
             :is_symptomatic,
             :health_comments,
             :mental_health_rating,
             :mental_health_comments,
             :diary_entry,
             :is_public,
             :created_at
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now do the same with the &lt;code&gt;UserSerializer&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;attributes :id,
             :first_name,
             :last_name,
             :email,
             :birth_date,
             :occupation,
             :is_essential,
             :isolation_start,
             :isolation_end,
             :about
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;We now have serializers to properly format our data for future &lt;code&gt;fetch()&lt;/code&gt; requests!! Next week, we’ll create our controller actions so we can finally connect to the front end!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>beginners</category>
      <category>rails</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>COVIDiary pt. 5 - Backend Routing</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 01 May 2020 21:07:44 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-5-backend-routing-39hf</guid>
      <description>&lt;p&gt;Welcome to Part 5 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga"&gt;Part 4.5: Database Fixes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week’s post &lt;strong&gt;was&lt;/strong&gt; super duper long, and it covered lots and lots of code across the front and back end. My inner editor put her foot down, and I have now broken that massive tome into not one, but four smaller posts that focus on specific concepts or tasks.&lt;/p&gt;

&lt;center&gt;
  &lt;img src="https://i.giphy.com/media/i5yobxd9zkMBq/source.gif" alt="No more books" width="245" height="200"&gt;
&lt;/center&gt;

&lt;p&gt;If you want to skip ahead, you can check out my progress in the &lt;a href="https://github.com/AudTheCodeWitch/COVIDiary-api" rel="noopener noreferrer"&gt;CD-API&lt;/a&gt; and &lt;a href="https://github.com/AudTheCodeWitch/COVIDiary-client" rel="noopener noreferrer"&gt;CD-Client&lt;/a&gt; repositories on GitHub. I’ll continue working on the project as these blog posts release over the coming weeks.&lt;/p&gt;

&lt;p&gt;Today, we’re going to work on the back end. By the end of today, we will have all our backend routing configured and ready to go.&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Old-fashioned switch board" src="https://i.giphy.com/media/ilqP03ohzeIJZGnnpe/source.gif" width="499" height="380"&gt;
&lt;/center&gt;

&lt;p&gt;Open your &lt;code&gt;CD-API&lt;/code&gt; repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Namespace Routes
&lt;/h2&gt;

&lt;p&gt;We’ll start by configuring our routes. We want to add &lt;code&gt;/api&lt;/code&gt; to our backend routes so we can better keep things straight.&lt;/p&gt;

&lt;p&gt;To keep our files organized, make an &lt;code&gt;/api&lt;/code&gt; directory in your &lt;code&gt;/controllers&lt;/code&gt; directory, and place your controllers within it.&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Controller file structure" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.imgur.com%2FkHOYJ6m.jpg" width="207" height="111"&gt;
&lt;/center&gt;

&lt;p&gt;Note: You probably don’t have the &lt;code&gt;users_controller.rb&lt;/code&gt; yet. If that’s the case, now is a perfect time to add it. In your terminal, run &lt;code&gt;rails g controller api/users&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now we’ll wrap our resources within an &lt;code&gt;/api&lt;/code&gt; namespace in our &lt;code&gt;config/routes.rb&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
rails.application.routes.draw do

  # wrap routes in /api namespace

  namespace :api do

    # create index route for all entries at /api/entries

    resources :entries

    # create routes for users at /api/users

    resources :users

  end

end

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

&lt;/div&gt;



&lt;p&gt;We only want &lt;code&gt;/api/entries&lt;/code&gt; so we can see the list of all public entries. We want to nest our CRUD actions for specific entries under specific users. Let’s make some minor changes to accomplish this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
rails.application.routes.draw do

  namespace :api do

    # creates index route for all entries at /api/entries

    resources :entries, only: [:index]

    resources :users do

      # create all CRUD routes for a specific user's entries at api/users/:user_id/entries

      resources :entries

    end

  end

end

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

&lt;/div&gt;



&lt;p&gt;At this point, you can run &lt;code&gt;rails routes&lt;/code&gt; in your terminal to see all the routes we’ve just created.&lt;/p&gt;

&lt;center&gt;
  &lt;img alt="Hell Yeah!" src="https://i.giphy.com/media/fWj2TR9mfYJ56/source.gif" width="500" height="275"&gt;
&lt;/center&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;We are one step closer to hooking up our front and back ends. Next week, we’ll format our data so we can send it to our client app. We’re making progress!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>rails</category>
      <category>tutorial</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>COVIDiary pt. 4.5 - Database Fixes</title>
      <dc:creator>Audrea Cook</dc:creator>
      <pubDate>Fri, 24 Apr 2020 16:21:20 +0000</pubDate>
      <link>https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga</link>
      <guid>https://dev.to/audthecodewitch/covidiary-pt-4-5-database-fixes-21ga</guid>
      <description>&lt;center&gt;
&lt;img alt="Cool Cats and Kittens" src="https://i.giphy.com/media/RGixkYkOKdWATSReHt/source.gif" width="768" height="432"&gt;
&lt;/center&gt;

&lt;p&gt;Welcome to Part 4.5 of the COVIDiary project! If you’re just joining us or missed a post, here’s what we’ve done so far:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-a-rails-react-project-2gl6"&gt;Part 1: Project Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-part-2-initial-setup-2g2d"&gt;Part 2: Initial Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-3-building-the-database-4o04"&gt;Part 3: Building the Database&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/audthecodewitch/covidiary-pt-4-frontend-setup-3cp1"&gt;Part 4: Frontend Setup&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week, we’re going to work on our PostgreSQL database in the &lt;code&gt;CD-api&lt;/code&gt; directory. By the end of today, we will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fix improper boolean names&lt;/li&gt;
&lt;li&gt;Add is_public boolean to entries&lt;/li&gt;
&lt;li&gt;Update seed file&lt;/li&gt;
&lt;li&gt;Reset database&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Ch-ch-ch-CHANGES
&lt;/h2&gt;

&lt;p&gt;I was reading up on naming conventions this week, and I came across &lt;a href="https://dev.to/michi/tips-on-naming-boolean-variables-cleaner-code-35ig"&gt;this article&lt;/a&gt;. I realized the boolean names in our tables did not follow best practices, and I set about changing them.&lt;/p&gt;

&lt;center&gt;
&lt;img alt="Good Idea at the Time" src="https://i.giphy.com/media/gKGzjtXVrVPIsgbREz/source.gif" width="768" height="432"&gt;
&lt;/center&gt;

&lt;p&gt;I’m going to go into Part 3 and fix the mistakes I made. If you’ve been coding along with me, check out the video below to see how to make the changes yourself!&lt;/p&gt;

&lt;center&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/MVqeF7RTjAk"&gt;
&lt;/iframe&gt;

&lt;/center&gt;

&lt;h2&gt;
  
  
  Coming Up
&lt;/h2&gt;

&lt;p&gt;Next week, we’ll work on setting up our routes, serializers, and controllers so the front and back ends can talk to one another. Until then, stay well!&lt;/p&gt;

&lt;center&gt;
&lt;img alt="Stay Home" src="https://i.giphy.com/media/lQ701BEcCllM2BOQpR/source.gif" width="480" height="480"&gt;
&lt;/center&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>database</category>
    </item>
  </channel>
</rss>
