<?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: JosetteTGarcia</title>
    <description>The latest articles on DEV Community by JosetteTGarcia (@josettetgarcia).</description>
    <link>https://dev.to/josettetgarcia</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%2F828900%2F8613b8dc-2e66-454c-a0bb-5c40d740b7c0.png</url>
      <title>DEV Community: JosetteTGarcia</title>
      <link>https://dev.to/josettetgarcia</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/josettetgarcia"/>
    <language>en</language>
    <item>
      <title>Solving H-10 Error for Heroku Deployment</title>
      <dc:creator>JosetteTGarcia</dc:creator>
      <pubDate>Sat, 24 Sep 2022 18:45:14 +0000</pubDate>
      <link>https://dev.to/josettetgarcia/solving-h-10-error-for-heroku-deployment-3pgi</link>
      <guid>https://dev.to/josettetgarcia/solving-h-10-error-for-heroku-deployment-3pgi</guid>
      <description>&lt;p&gt;Hi Dev Community! &lt;/p&gt;

&lt;p&gt;If you’ve found this blog post, I can already sense your frustration. Are you at the end of your rope with this error?&lt;/p&gt;

&lt;p&gt;Maybe you’re a beginner or attending a bootcamp, like myself, and you’re ready to deploy your first app. Heroku was recommended and all the videos and tutorials made it seem straightforward enough. You followed the directions step by step and you’re &lt;em&gt;meticulous&lt;/em&gt; and &lt;em&gt;careful&lt;/em&gt; because you know how one typo can send you down a spiral.&lt;/p&gt;

&lt;p&gt;Success! You receive the following confirmation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-----&amp;gt; Build succeeded!
...
-----&amp;gt; Verifying deploy.... done.
-----&amp;gt; Running release command...
-----&amp;gt;Waiting for release.... Done.

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

&lt;/div&gt;



&lt;p&gt;Excited it that it seemed to work on your first try, you command &lt;code&gt;heroku open&lt;/code&gt; and you get the following...&lt;/p&gt;

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

&lt;p&gt;And you run ​​&lt;code&gt;heroku logs --tail&lt;/code&gt; as you’re told and get something similar to 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;2022-09-21T22:11:34.028636+00:00 heroku[web.1]: Process exited with status 1
2022-09-21T22:11:34.088522+00:00 heroku[web.1]: State changed from starting to crashed
2022-09-21T22:11:35.045857+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-worm-hole.herokuapp.com request_id=f3e2af21-0107-4e02-b791-9b172d4dc646 fwd="97.98.68.225" dyno= connect= service= status=503 bytes= protocol=https
2022-09-21T22:11:35.883219+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-worm-hole.herokuapp.com request_id=ac2ff6bc-db19-43c4-936b-d25f8de1b4af fwd="97.98.68.225" dyno= connect= service= status=503 bytes= protocol=https
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Listen, I just went down this spiral. Hopefully, I can guide you on how to troubleshoot and identify what’s causing this. But a warning...this error is a maze that can end with many solutions. Google will still be your friend in the end!&lt;/p&gt;

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

&lt;h3&gt;
  
  
  What is the H-10 error?
&lt;/h3&gt;

&lt;p&gt;Heroku provides the following, limited, information regarding this error:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A crashed web dyno or a boot timeout on the web dyno will present this error. &lt;a href="https://devcenter.heroku.com/articles/error-codes"&gt;Heroku Error Codes&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To break this down, “Dynos” are Heroku designed, Linux containers designed to execute your code based on user-commands (&lt;a href="https://www.heroku.com/dynos"&gt;resource&lt;/a&gt;).These are defined through your Procfile, but not necessarily where the issue lies. &lt;/p&gt;

&lt;p&gt;"Boot timeout" is what it sounds like. The error is because Heroku is not able to configure on which PORT to run the application.&lt;/p&gt;

&lt;p&gt;If your errors from &lt;code&gt;heroku logs --tail&lt;/code&gt; match the above, we are solving for crashed web dynos.&lt;/p&gt;

&lt;h3&gt;
  
  
  Troubleshooting Steps:
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Run heroku run rails console.
&lt;/h4&gt;

&lt;p&gt;This was one of the more helpful tips I’ve found! If your &lt;br&gt;
  errors are similar to mine, running this command will &lt;br&gt;
  provide more specific errors.&lt;/p&gt;

&lt;p&gt;My command returned the following (but yours may return differently):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/app/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.0/lib/zeitwerk/kernel.rb:35:in `require': cannot load such file -- net/pop (LoadError)
....
6.1.7/lib/rails/command.rb:48:in `invoke'
        from /app/vendor/bundle/ruby/3.1.0/gems/railties-6.1.7/lib/rails/commands.rb:18:in `&amp;lt;top (required)&amp;gt;'
        from /app/bin/rails:5:in `require'
        from /app/bin/rails:5:in `&amp;lt;main&amp;gt;'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Google!
&lt;/h4&gt;

&lt;p&gt;There is a lot you can google within this error. Depending on &lt;br&gt;
 what you copy and search, you may get different solutions. A &lt;br&gt;
 tip I learned from an instructor is to find that first error &lt;br&gt;
 line and google the bolded terms or the tail end of the error.&lt;/p&gt;

&lt;p&gt;Example: "cannot load such file -- net/pop"&lt;/p&gt;

&lt;h3&gt;
  
  
  Solutions:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Googling the above brought me to understand there were gems 
missing from my Gemfile:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem 'net-smtp'
gem 'net-imap'
gem 'net-pop'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While friends and instructors did not need the above, I was &lt;br&gt;
explained that different versions of rails and ruby could &lt;br&gt;
conflict with each other. Updated versions may not have the &lt;br&gt;
correct gemfiles built in which could then require you to &lt;br&gt;
manually add them as I had to.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;There are general causes for the H-10 errors, I recommend the following resources. 
NOTE: solutions may be outdated so I would run general commands vs. plugging in every suggestion.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/lawrence_eagles/causes-of-heroku-h10-app-crashed-error-and-how-to-solve-them-3jnl"&gt;“Causes of Heroku H10-App Crashed Error And How To Solve Them” -  Lawrence Eagles&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=68iCwSmSIvA"&gt;Causes of Heroku H10-App Crashed Error And How To Solve Them | Top 3 error newbies always have - HaryPhamDev&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many comment their success with these steps but the solutions did not provide success in my case.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;The H-10 was extremely frustrating for myself to solve! Others who experienced this issue in my cohort were not able to resolve either and resorted to other options. This is a perfectly acceptable solution as the time spent troubleshooting this could have been spent elsewhere. In the end, the potential issues can be so different from one project to the next that I don't believe this issue and documentation provided by Heroku is beginner friendly.&lt;/p&gt;

&lt;p&gt;With that said, I learned valuable information on appropriate googling and error handling research.&lt;/p&gt;

&lt;p&gt;I hope this finds that one engineer out there who is in google spiral as I was! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>heroku</category>
      <category>react</category>
    </item>
    <item>
      <title>Troubleshooting API through Binding.Pry</title>
      <dc:creator>JosetteTGarcia</dc:creator>
      <pubDate>Tue, 28 Jun 2022 02:24:29 +0000</pubDate>
      <link>https://dev.to/josettetgarcia/troubleshooting-api-through-bindingpry-3lpe</link>
      <guid>https://dev.to/josettetgarcia/troubleshooting-api-through-bindingpry-3lpe</guid>
      <description>&lt;p&gt;This week, I completed another phase and project through Flatiron School’s Software Engineering program. In this phase, we’ve focused on building the backend of applications through Ruby, Active Record, and Sinatra. &lt;/p&gt;

&lt;p&gt;My project focussed on payment tracking to assist users with saving. To track and categorize payments, I had two, one-to-many model associations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payments belong to Stores

&lt;ul&gt;
&lt;li&gt;Stores have many payments&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Payments belong to Categories

&lt;ul&gt;
&lt;li&gt;Categories have many payments&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Setting up the migrations, models, and controllers came without issue. What did not make sense right away was how to build a Payment, with the above relationships, when a user submits payment information through a form. &lt;/p&gt;

&lt;p&gt;I struggled for a full 48 hours to understand how to format my Payment object through Javascript that correctly POSTs to the Sinatra built API and identify the two foreign keys I needed connected. &lt;/p&gt;

&lt;p&gt;This blog will cover how I accomplished this task and how &lt;code&gt;Binding.Pry&lt;/code&gt; helped me find a solution when I was stuck.&lt;/p&gt;

&lt;p&gt;To start, I will explain my API, Frontend Requests, and the Submission Form for Payments:&lt;/p&gt;

&lt;h3&gt;
  
  
  The Set Up
&lt;/h3&gt;

&lt;p&gt;As described, a &lt;code&gt;Payment&lt;/code&gt; belongs to a &lt;code&gt;Store&lt;/code&gt; and &lt;code&gt;Category&lt;/code&gt;. Categories &amp;amp; Stores can have many payments. Categories and Stores do not currently tie together. &lt;/p&gt;

&lt;p&gt;Here is the Payment database model:&lt;/p&gt;

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

&lt;p&gt;A user can submit a payment through the following React form: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o00t-gg0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xz7vqc8rxcdljn287qn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o00t-gg0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9xz7vqc8rxcdljn287qn.png" alt="Image description" width="440" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Form Submission to POST was something I had encountered before, but relating a value to a foreign key, when the user will have no concept of the foreign key's ID truly knocked me down. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip #1:&lt;/strong&gt; The JS object, or 'Form Data', as I've called it must include the required key, value pairs the server is expecting on the backend. &lt;br&gt;
 This may sound obvious, but as I was expecting a user to input a category or store name, I had assumed the client would send the category/store names and then &lt;code&gt;store_id&lt;/code&gt; and &lt;code&gt;category_id&lt;/code&gt; would be converted server side. This is not the case in my example!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [formData, setFormData] = useState({
      amount: "",
      date_paid: "",
      description: "",
      is_need: false,
      store_id: "",
      category_id: "",
  })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  const categoriesList = categories.map((category) =&amp;gt; (
    &amp;lt;MenuItem key={category.id} value={category.id}&amp;gt;{category.category_type}&amp;lt;/MenuItem&amp;gt;
  ))

 &amp;lt;Select
          displayEmpty
          id="standard-basic"
          className={classes.selectEmpty}
          name="category_id"
          value={formData.category_id}
          onChange={handleChange}
          inputProps={{ 'aria-label': 'Without label' }}
          &amp;gt; 
          &amp;lt;MenuItem value="" disabled&amp;gt;
                Category
          &amp;lt;/MenuItem&amp;gt;
          {categoriesList}
        &amp;lt;/Select&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In my case, I chose to use a Select element for category and store submission to make it easier for the user and myself. The &lt;code&gt;Categories&lt;/code&gt; display as &lt;code&gt;MenuItems&lt;/code&gt; and that also gives me a chance to store that specific category's id under &lt;code&gt;name="category_id"&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;When a store or category is selected, JS then does the work of inserting the corresponding ID to our &lt;code&gt;FormData&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;function handleChange(event) {
    if(event.target.name === "amount"){
      setFormData({
        ...formData,
          amount: parseFloat(event.target.value)
      }) 
    }
      else {
        setFormData({ 
          ...formData, 
          [event.target.name]: event.target.value 
        });
      }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Server Side
&lt;/h3&gt;

&lt;p&gt;Where I started to see smoke as a newbie engineer is that my JS object was showing up perfectly in the &lt;code&gt;console.log&lt;/code&gt; output. But I was receiving specific API errors that Payment could not be submitting because the params were empty.&lt;/p&gt;

&lt;p&gt;aka. My beautiful work was not coming across correctly in the server. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip #2&lt;/strong&gt;: Use Binding.Pry &lt;strong&gt;AND&lt;/strong&gt; Play With It.&lt;/p&gt;

&lt;p&gt;Here was my initial &lt;code&gt;payments_controller&lt;/code&gt; for a POST:&lt;/p&gt;

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

&lt;p&gt;and here is what &lt;code&gt;binding.pry&lt;/code&gt; was providing me when I peeked into Payment:&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;Nil&lt;/code&gt;!? How could that be when my object looked great before it was sent to server?&lt;/p&gt;

&lt;p&gt;A tip from an instructor led me to try viewing the [params :payment] vs. just (params) within IRB. This led me to see that I was submitting data correctly, but I was asking my server to look for params called "payment", which did not exist as a key, value pair in my object. The solution:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;post "/payments" do
    payment = Payment.new(params)
    if payment.save
      payment.to_json(include: [:store, :category])
    else
      {errors: payment.errors.full_messages}.to_json
    end
  end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Back tracking to just asking for "params" solved my issue (+/- some other tweaks to my code)! How could something so small trip me up for two days?&lt;/p&gt;

&lt;p&gt;To put it simply, I was looking for the most complicated reason when &lt;code&gt;binding.pry&lt;/code&gt; could have led me to a simple fix much quicker. &lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;I still struggled with the rest of my API calls because I was just getting used to Sinatra and Active Record set up. Leaning on &lt;code&gt;binding.pry&lt;/code&gt; on the server side while also still utilizing &lt;code&gt;console.log&lt;/code&gt; on the client end helped make sure the data was matching on both ends, taking less of my time!&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>ruby</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Getting Started with Material-UI</title>
      <dc:creator>JosetteTGarcia</dc:creator>
      <pubDate>Wed, 27 Apr 2022 03:47:48 +0000</pubDate>
      <link>https://dev.to/josettetgarcia/getting-started-with-material-ui-40aj</link>
      <guid>https://dev.to/josettetgarcia/getting-started-with-material-ui-40aj</guid>
      <description>&lt;h2&gt;
  
  
  A breakdown for complete beginners who don't understand the Getting Started section provided
&lt;/h2&gt;

&lt;p&gt;Hi Dev Community! I’m back with another newbie walk-through that may save some of you the hours I spent trying to understand &lt;a href="https://mui.com/"&gt;Material-UI(MUI)&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Yes, you could say that MUI has its own &lt;a href="https://mui.com/material-ui/getting-started/installation/"&gt;Getting Started&lt;/a&gt; section, how could it possibly be broken down more than that? Well, as a new student to React, I still spent more than a few study nights fighting with my code just to get the most simple of web designs to work. &lt;/p&gt;

&lt;p&gt;This is not a knock on MUI specifically, just an acknowledgement that “ground zero” for learning a new platform is different between a new dev and someone who may have more experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Some Initial Tips:
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;What is Material-UI and when will a new Dev come across it?&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"MUI offers a comprehensive suite of UI tools to help you ship new features faster. Start with Material UI, our fully-loaded component library, or bring your own design system to our production-ready components."&lt;br&gt;
-Material-UI Home page&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For a new dev, this framework will help you design a cleaner, more aesthetic React app. You will likely be suggested this framework during your first few React projects. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are brand new to React &amp;amp; working on one of your first projects, I highly recommend building your platform using normal JSX elements and focussing on function before appearance. This will help you memorize the normal structure before implementing Material-UI elements.

&lt;ul&gt;
&lt;li&gt;MUI components differed enough from JSX elements that I believe I would have been unable to recall the difference at later times if I jumped into design first as I have with other projects.&lt;/li&gt;
&lt;li&gt;If you have experience with JSX or feel confident in HTML elements, it could be easier to start with MUI elements and focus on making the work after&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Before jumping in, consider looking into &lt;a href="https://mui.com/material-ui/customization/theming/"&gt;Theming&lt;/a&gt;. Themes will keep your colors, typography, and fonts consistent across the project (This blog post will not cover themes).

&lt;ul&gt;
&lt;li&gt;Without themes, you may get stuck trialing CSS props for each section.&lt;/li&gt;
&lt;li&gt;By the end of my first project, it felt like a bit of time waster to go back and re-design the themes of my elements and I wish I would have saw this first.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Initial Set Up
&lt;/h3&gt;

&lt;p&gt;Surprisingly, this was the easiest part of the process! You can find the getting started page &lt;a href="https://mui.com/material-ui/getting-started/installation/"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You will need to install the &lt;code&gt;package dependencies&lt;/code&gt;. Aka. You’re installing the file that holds the MUI packages and dependencies so you can grab the styled components without worrying about file paths
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// with npm
npm install @mui/material @emotion/react @emotion/styled

// with yarn
yarn add @mui/material @emotion/react @emotion/styled
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Focus on the initial suggestion on this page (posted above)! Unless you are more familiar with Material-UI, the styled-components option on this page is not necessary.&lt;/li&gt;
&lt;li&gt;Do I use &lt;code&gt;yarn&lt;/code&gt; or &lt;code&gt;npm&lt;/code&gt;? This is a personal preference. I recommend defaulting to the one you’ve used before to keep the new things at a minimum. For example, I used &lt;code&gt;npm&lt;/code&gt; because I’ve used it throughout my project, but experimenting with &lt;code&gt;yarn&lt;/code&gt; further down the line did not make much of a difference. &lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;That’s it for install! There are some other recommendations on this page, but these are not necessary to get started. Review these in case you decide you need these later down the line and then you’ll know where to look. &lt;/li&gt;
&lt;li&gt;Review the available components on the left, nav-bar to see what catches your eye to get started!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Styling MUI Elements:
&lt;/h3&gt;

&lt;p&gt;Once you have a component in mind you want to get started with, you will need the following on your React component:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The &lt;code&gt;import&lt;/code&gt; headers from your MUI package installed on the first steps

&lt;ul&gt;
&lt;li&gt;Similar to your project components, you need to import the styling components from the installed package&lt;/li&gt;
&lt;li&gt;Each component will have different dependencies you need to import&lt;/li&gt;
&lt;li&gt;To grab the correct imports, click the &lt;code&gt;&amp;lt; &amp;gt;&lt;/code&gt; icon on the example code to expand the full code for your copying and pasting needs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;The code for the component you are rendering

&lt;ul&gt;
&lt;li&gt;MUI will show you multiple examples of controlled and uncontrolled elements and how to set default settings. To make sure you got the correct code example, use the “Edit Code in Sandbox” Icon to play with provided examples and collect the correct section. &lt;/li&gt;
&lt;li&gt;You will not be able to copy and paste the whole example and have it work exactly as you need. You will need to pick and pull specific pieces and work it into your project.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;From here, you will need to just keep going and get a feel for what you need and like! As mentioned at the beginning, altering the default themes of the components would need a separate blog post. I’ve linked some helpful resources I’ve found below if you have some additional time as this blog post, and my knowledge, just scratch the surface:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/-XKaSCU0ZLM"&gt;How to Design a Perfect React Material UI Form&lt;/a&gt; - CodAffection&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/bDkB3LoQKxs"&gt;React Material-UI Themes: Customize Material Components for your Project&lt;/a&gt; - Bruno Antunes&lt;/p&gt;

</description>
      <category>jsx</category>
      <category>react</category>
      <category>mui</category>
      <category>materialui</category>
    </item>
    <item>
      <title>The Habit Tracker</title>
      <dc:creator>JosetteTGarcia</dc:creator>
      <pubDate>Sun, 13 Mar 2022 00:40:33 +0000</pubDate>
      <link>https://dev.to/josettetgarcia/the-habit-tracker-4o0h</link>
      <guid>https://dev.to/josettetgarcia/the-habit-tracker-4o0h</guid>
      <description>&lt;p&gt;Hello, Dev Community! &lt;/p&gt;

&lt;p&gt;This week I completed one of my first projects for FlatIron school. The focus of this project was to solidify beginning concepts in javascript, CSS, HTML, and API. In this post, I will cover the following topics regarding this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt; The concepts I came up with to fulfill the requirements of the program and build an app I would actually use&lt;/li&gt;
&lt;li&gt;The challenges I’ve faced as a beginner and how I was able to navigate through these (&lt;code&gt;createDocumentFragment()&lt;/code&gt;, loops, form submission to object)&lt;/li&gt;
&lt;li&gt;Reflection and improvements &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Habit Tracker App
&lt;/h2&gt;

&lt;p&gt;Why did I create this app? This app is inspired by Atomic Habits by &lt;a href="https://jamesclear.com/"&gt;James Clear&lt;/a&gt;. Clear's philosophy, as well as this app's, is to break down goals into smaller daily habits that when completed consistently, can allow individuals to reach larger accomplishments.&lt;br&gt;
This app makes it simple and starts with just 30 days and the three rewards the user promises themself. Tracking your goals should be the least hardest thing about reaching them.&lt;/p&gt;

&lt;p&gt;For a user, this app works by submitting a form with your goal and habit information. Once submitted, a “goal card” will render to the right where the user can come and check a box for each day they completed the habit they are building. If they are done tracking their goal, they can delete it with the “Delete” button on each card. &lt;/p&gt;

&lt;p&gt;If they need extra motivation, they can click the “Click Me for Motivation” button which will pop up a James Clear Quote. They can even click the “Tips Video” link in the navigation bar to watch a video summarizing Atomic Habits. &lt;br&gt;
How it Works:&lt;/p&gt;
&lt;h2&gt;
  
  
  This project includes [3] main features:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Form for entering your goals to create a goal card&lt;/li&gt;
&lt;li&gt;The ability to check off each day of your goals&lt;/li&gt;
&lt;li&gt;Local JSON-server to persist the goal card through refreshes&lt;/li&gt;
&lt;li&gt;Connection to James Clear Quotes API for motivation&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’d like to break down two of them- &lt;/p&gt;
&lt;h2&gt;
  
  
  The Goal Form:
&lt;/h2&gt;

&lt;p&gt;After the initial steps of creating a CSS grid styling for the app, I wanted to focus my first javascript efforts on the form submission of the goal. Submission of this form is what would trigger the new goal card to populate and basically kicks starts many of the functions of the app.&lt;/p&gt;

&lt;p&gt;In order to target the inputs of a form, I had to first target the “submit” event from the “Add New Goal” button. I used a global QuerySelector and appended an event listener that listened for the “submit” event and started the HandleFormSubmit function. The HandleFormSubmit’s function’s main job was to set the values from into a goalObject and kickstart the function that creates our cards and the function that saves our object to the local JSON server. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d1-0dbU8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76kj13h3z0m0roj25703.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d1-0dbU8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/76kj13h3z0m0roj25703.png" alt="Image description" width="414" height="413"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An interesting lesson here was that we are listening for the “submit”, specifically because it is a form. Even though we are “clicking” the button to submit our form, the submit event is tied to the form and ensures our values are pulled. It’s intended for when we expect to return information from an input vs just trigger another action. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_MSBadup--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9ghiyw6umwpnfd28h6v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_MSBadup--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9ghiyw6umwpnfd28h6v.png" alt="Image description" width="409" height="77"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Appending the 30 days checkboxes to the goal card
&lt;/h2&gt;

&lt;p&gt;This was the hardest part of my code to figure out. Instead of having to repeat 30 lines of code in the HTML, I thought to include a loop that would append the 30 lines of code to the new card after it’s been created. To the user, this looks instant. &lt;br&gt;
To do this, I used createDocumentFragment(), which I learned is a quicker, and cleaner solution when attaching multiple elements to the DOM (&lt;a href="https://dev.to/ibn_abubakre/document-fragments-and-why-you-should-use-them-14fk"&gt;resource blog from another DEV blogger&lt;/a&gt;). &lt;br&gt;
For others who may plan to do something similar, here is the process I’d follow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set a variable to &lt;code&gt;document.createDocumentFragment();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Within your function that creates the HTML for your card, set a for loop to the amount of times you need your code to repeat&lt;/li&gt;
&lt;li&gt;Add a new variable that appends &lt;code&gt;createElement()&lt;/code&gt; to the original, Fragment variable&lt;/li&gt;
&lt;li&gt;Set the second variable &lt;code&gt;inner.html&lt;/code&gt; to your needed code&lt;/li&gt;
&lt;li&gt;Outside of the for loop, you will use &lt;code&gt;appendChild()&lt;/code&gt; to append your original variable to the node&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Essentially, once the new card from our form submission is created, we append the document fragment to this newly created HTML section. The document fragment calls our element creator and the for loop.&lt;br&gt;
For styling reasons, I included an if-else statement to add a break in certain iterations.&lt;/p&gt;

&lt;p&gt;Here is a sample for anyone who would like to recreate:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const containerForFragment = document.createDocumentFragment();

for (let i = 1; i &amp;lt; 31; i++) {  
    let newElement = containerForFragment.appendChild(document.createElement("li"));
    newElement.innerHTML = "";
    if (i == 10|| i == 20 || i == 30) {
    newElement.innerHTML = `
    &amp;lt;label&amp;gt;
      &amp;lt;input type="checkbox" id = "checkbox" /&amp;gt;  
      &amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;
      &amp;lt;text&amp;gt; ${i} Days completed! Collect a reward! &amp;lt;/text&amp;gt;
      &amp;lt;/label&amp;gt;
    &amp;lt;br&amp;gt;
    ` 
    } else {
    newElement.innerHTML = `
    &amp;lt;label&amp;gt;
      &amp;lt;input type="checkbox" id = "checkbox" /&amp;gt;
      &amp;lt;span&amp;gt; &amp;lt;/span&amp;gt; &amp;amp;nbsp;
    &amp;lt;/label&amp;gt;
    ` 
    }
  };
  // step 3. slap it on the DOM!

  newCard.querySelector("#NodeID").appendChild(containerForFragment);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I learned a lot through this project and feel like I've built a product I would use on my own. If I were to continue to build on this application, I would host my server so I could then create user accounts and data can persist for users other than myself. I'd also like to eventually create the ability to track progress over a longer period of time. &lt;/p&gt;

&lt;p&gt;Example. If a user only completes 15 out of the 30 days of the habit, we can save this data, refresh the 30 days, and track their improvement month to month. &lt;/p&gt;

&lt;p&gt;Thanks for your time! I would love to hear your feedback regarding this application or any of the topics discussed. &lt;/p&gt;

&lt;p&gt;If you would like to check out the &lt;a href="https://github.com/JosetteTGarcia/phase-1-project"&gt;code&lt;/a&gt; for my project you are welcome to do so.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Getting Started: An Intro to Josette</title>
      <dc:creator>JosetteTGarcia</dc:creator>
      <pubDate>Sat, 12 Mar 2022 20:14:29 +0000</pubDate>
      <link>https://dev.to/josettetgarcia/getting-started-an-intro-to-josette-phk</link>
      <guid>https://dev.to/josettetgarcia/getting-started-an-intro-to-josette-phk</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w51deh1P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd7cgk6tnravmb0m1u3g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w51deh1P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fd7cgk6tnravmb0m1u3g.jpg" alt="Image description" width="257" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hello, Dev Community&lt;/strong&gt;! &lt;br&gt;
My name is Josette and I’m currently a student of FlatIron’s Software Engineering Flex Program (expected graduation, Aug 2022). I live in Corpus Christi, Texas and work remotely as a Support Manager of a technical support team at a SaaS company. &lt;/p&gt;

&lt;p&gt;I first became interested in software engineering as a career in 2019 after hearing a software engineer present at a company I was working for in Austin, Tx. I was interested in the challenge, the community, and the overall excitement he displayed for his career. I had never considered tech and engineering as something I could just pick up after college. &lt;/p&gt;

&lt;p&gt;After a few months working in my current company, I picked up a bit of knowledge of XML, API, and data servers which piqued my interest further. I attended a few classes at Austin Community College and finally decided to dive into this program at the end of 2020. &lt;/p&gt;

&lt;p&gt;I’m so excited to continue this path and start my career in this industry. Follow along with me as I write about my projects, concepts I’ve found difficult and learned to navigate, and topics I’ve found fun and interesting. &lt;/p&gt;

&lt;p&gt;Thank you for your time! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>career</category>
    </item>
  </channel>
</rss>
