<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Chaya Deaver</title>
    <description>The latest articles on Forem by Chaya Deaver (@chayadeaver).</description>
    <link>https://forem.com/chayadeaver</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%2F376339%2F9c5da1ae-f4b2-49fd-9dd6-da6857e4147b.jpg</url>
      <title>Forem: Chaya Deaver</title>
      <link>https://forem.com/chayadeaver</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/chayadeaver"/>
    <language>en</language>
    <item>
      <title>Side-project: Notes</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Fri, 07 May 2021 15:35:33 +0000</pubDate>
      <link>https://forem.com/chayadeaver/side-project-notes-28g0</link>
      <guid>https://forem.com/chayadeaver/side-project-notes-28g0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0eGTqvVi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjm8d1gquwxvtdgk9s62.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0eGTqvVi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gjm8d1gquwxvtdgk9s62.gif" alt="notes-demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hello! It's been a while since I've posted! I've been quite busy since working on my Slack clone project. I have made a simple side project using Ruby on Rails. I built a full Ruby on Rails application a few months ago with some new knowledge I've gleaned since Flatiron School. I want to put more time into this project and dive into writing automated tests and using Tailwind CSS. I am excited to show you how I went about planning and building.&lt;/p&gt;

&lt;p&gt;The premise of this project is a note management application. It allows users to sign up for an account to start managing their notes. For this application, I only needed two models, &lt;code&gt;User&lt;/code&gt; and &lt;code&gt;Note&lt;/code&gt;. A user has many notes and a note belongs to the user. The note can have a title and a body. It won't allow you create a blank note but you can create one without a title or a body. Notes without a body can only have 30 characters. The note body is limited to 1000 characters so it doesn't allow for huge notes so that can be for future implementations. It does, however, allow for text formatting like turning the content of the note body into a code snippet. I integrated a WYSIWYG editor with the textarea form field using Rails's Action Text. &lt;a href="https://edgeguides.rubyonrails.org/action_text_overview.html"&gt;Here&lt;/a&gt; is the documentation for Action Text with Rails&lt;/p&gt;

&lt;p&gt;For user authentication, I decided to use Devise gem. I've used Devise in my previous projects and have been satisfied with the results. I used Devise to generate a user model and a registrations controller to manage the user's params. I styled devise views with Bootstrap and Tailwind CSS. &lt;a href="https://github.com/heartcombo/devise"&gt;Here&lt;/a&gt; is the documentation for Devise gem.&lt;/p&gt;

&lt;p&gt;It was a simple CRUD application so a user can create, read, update and delete their notes. A user wouldn't be able to view other user's notes so once they sign into their account, they are redirected to a dashboard which shows just the notes they've created. I styled my application with Bootstrap and Tailwind CSS. I've used Bootstrap in the past but this was my first time using Tailwind CSS. I thought about scrapping Bootstrap and just using Tailwind CSS but Bootstrap has certain components that Tailwind doesn't provide without charging such as nav bar support. I decided to keep both CSS frameworks because I had started with Bootstrap but in the future I would like to delve more into Tailwind CSS.&lt;/p&gt;

&lt;p&gt;The parts of this build that took a lot of time were the styling of each page and implementing automated tests. I have exposure to test through my time at Flatiron School. The Learn.co platform at the time relied on &lt;code&gt;Rspec&lt;/code&gt; tests but the curriculum didn't go over writing tests. This was a big learning curve for me but I was able to overcome it. I managed to write tests for the models, controllers, and helpers. I also had to install &lt;code&gt;database_cleaner&lt;/code&gt; gem clean my database every time I ran tests. After so many tests, the database was getting cluttered so this solved that problem. Once I got the tests to pass, I researched for ways to automate testing. I found a gem called &lt;code&gt;Guard&lt;/code&gt;, which listens for file changes in your directory and runs scripts based on the plugins you have integrated with it. &lt;code&gt;Guard&lt;/code&gt; has plugins for &lt;code&gt;Rspec&lt;/code&gt; so once I was able to set it up, it was running tests as I was writing the test cases. In addition to automating tests, I also integrate &lt;code&gt;Bundler&lt;/code&gt; with &lt;code&gt;Guard&lt;/code&gt; so anytime I add a new gem to my &lt;code&gt;Gemfile&lt;/code&gt;, &lt;code&gt;Guard&lt;/code&gt; will automatically run &lt;code&gt;bundler&lt;/code&gt; so I wouldn't need to run &lt;code&gt;bundle install&lt;/code&gt; every time. &lt;a href="https://github.com/guard/guard"&gt;Here&lt;/a&gt; is the documentation to set up Guard and how it can be used. It supports many testing frameworks. &lt;/p&gt;

&lt;p&gt;Overall, I had a great time building this application. I pushed myself to try new technologies such as Tailwind CSS, testing with Rspec, automating testing with Guard, and implementing WYSIWYG editor using Rails Action Text. In future implementations, I plan on incorporating views tests, OAuth, and action mailers. I would also dive in more deeply into Tailwind CSS. I really enjoyed using that. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://my-notes-2021.herokuapp.com/"&gt;Deployed App&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/chayadeaver/my-notes"&gt;GitHub repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.loom.com/share/a3edcbc3c2fc4c52b90121c0f9723527"&gt;Video Demo&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Side project: Slack Clone -- life update</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 18 Nov 2020 17:33:35 +0000</pubDate>
      <link>https://forem.com/chayadeaver/side-project-slack-clone-life-update-33ab</link>
      <guid>https://forem.com/chayadeaver/side-project-slack-clone-life-update-33ab</guid>
      <description>&lt;p&gt;It's been a while since I've posted on here since I finished my final project at Flatiron School in July. A lot has happened in the past few months. I had a baby! Revel Joy Deaver was born on September 4th at 9:35pm.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2yt7ua5xfyrzmqsg1qz3.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F2yt7ua5xfyrzmqsg1qz3.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
She was a big reason why I haven't done many projects. I took some time away from coding to adjust caring for a newborn and a toddler. I'm glad to say that I am slowly starting back with building side projects to fill up my portfolio and continuing my learning. &lt;/p&gt;

&lt;p&gt;My first side project since Flatiron School is a Slack clone. During bootcamp, I used Slack mostly to communicate with my cohort and share resources. This application allows a user to sign up using Google authentication instead of regular email and password. A user then can create a channel and start posting messages in it. It's a very bare-bones with a lot of potential. &lt;/p&gt;

&lt;p&gt;I built this Slack clone using React.js for frontend, Firebase for database management, and Context API for state management. Firebase is Google's platform for developing mobile and web applications. It offers many products but for this project I am using the database and hosting. Context allows me to pass data to many different components at different nesting levels. It is a feature built into React. This app uses Context to manage user state. It allows many different components to access user data regardless of parent-child relationships between components.&lt;/p&gt;

&lt;p&gt;I really enjoyed this build as it allowed me to work with new technologies like Firebase and Context. Because I learned Ruby on Rails and SQL at Flatiron, it was much easier to learn Firebase because I was able to compare what I knew about backend and database. Firebase makes setting up a database very simple and easy and it also comes built with authentication versus having to build one in Rails. Firebase also allows for hosting so the app is live &lt;a href="https://slack-clone-d89af.web.app" rel="noopener noreferrer"&gt;here&lt;/a&gt;. I am excited to create more side projects and continue learning!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftxewgmeg9i0zw4nmaryw.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftxewgmeg9i0zw4nmaryw.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chayadeaver/slack-clone" rel="noopener noreferrer"&gt;GitHub Repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sideprojects</category>
      <category>jobsearch</category>
    </item>
    <item>
      <title>MyFamilyRecipe React/Redux app using Rails API</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Mon, 13 Jul 2020 05:28:02 +0000</pubDate>
      <link>https://forem.com/chayadeaver/myfamilyrecipe-react-redux-app-using-rails-api-2887</link>
      <guid>https://forem.com/chayadeaver/myfamilyrecipe-react-redux-app-using-rails-api-2887</guid>
      <description>&lt;p&gt;I can't believe it's finally here. I was reflecting today that this time last year, I had started learning to code a little bit of JavaScript on Grasshopper App and today I am submitting my final project at Flatiron School. Let's jump in.&lt;/p&gt;

&lt;p&gt;I came about this idea when talking with my husband. He tells me that I need to get his grandmother's recipe for one particular chicken dish that he likes from his mom. I had said that I'll just copy it from her notebook the next time I see her. I was hesitant about asking my mother-in-law for recipes through a text message because she would send me pictures of these recipes that were very hard to read. I would rather just copy it down myself. It dawned me that I could make an application that keeps track of family recipes and the idea grew from there.&lt;/p&gt;

&lt;p&gt;It started out as a simple application where a user can submit recipes. My potential for this will be to create a social media type platform where users can share family recipes and users can scroll through a list of recipes and comment on them. I didn't quite get around to implementing commenting on recipes for this project but I would like to add this feature in the future. I ran into a few roadblocks so I'd like to highlight three of them. The three roadblocks I want to highlight are the following: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rendering the correct links in my navigation bar when a user is logged in.&lt;/li&gt;
&lt;li&gt;Understanding Redux store and implementing asynchronous fetch using Redux Thunk.&lt;/li&gt;
&lt;li&gt;Managing changes in a nested form.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The last roadblock was a particularly tough one and it made me feel really accomplished when I found the solution. I will touch on these roadblocks and elaborate on what I did to achieve the solution.&lt;/p&gt;

&lt;h4&gt;
  
  
  Roadblock #1: NavBar
&lt;/h4&gt;

&lt;p&gt;I wanted to build a navigation bar so I built it using &lt;a href="https://react-bootstrap.github.io/getting-started/introduction/"&gt;react-bootstrap&lt;/a&gt;. I also wanted it to be dynamic where it would render different links when a user signed in. I used a conditional to render different results and stored it inside an arrow function called &lt;code&gt;renderNavbar&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;NavBar.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ss2GT468--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3rtu57p5ju1jq1jhoo8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ss2GT468--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3rtu57p5ju1jq1jhoo8k.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I then pass in the state of current user from my Redux store on line 60 and set it to a boolean value using &lt;code&gt;!!&lt;/code&gt;. When a user is logged in, they should be able to view the recipes they've added, add a new recipe, and edit their own recipes. It also shows a logout link when a user is logged in and when they log out, it will show a sign up and log in link. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hxW2A11o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3y1mba7l34h8ltot08c.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hxW2A11o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/n3y1mba7l34h8ltot08c.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Roadblock #2: Understanding Redux and Thunk
&lt;/h4&gt;

&lt;p&gt;In order to fix the first roadblock, I had to understand the second roadblock first. The example I will use for this will be the &lt;code&gt;currentUser&lt;/code&gt; reducer. The &lt;code&gt;currentUser&lt;/code&gt; is a reducer in the Redux store. I utilized &lt;code&gt;Redux Thunk&lt;/code&gt; to make fetch requests to my Rails API to get the current user stored there. First, I have a file called &lt;code&gt;store.jsx&lt;/code&gt; that stores of my reducers and combine them together with &lt;code&gt;combineReducer&lt;/code&gt; like so...&lt;/p&gt;

&lt;p&gt;&lt;em&gt;store.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zp38l4JE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xqra6cu9bims9robac3d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zp38l4JE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/xqra6cu9bims9robac3d.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I made an asynchronous action creator inside my middleware folder called &lt;code&gt;actions&lt;/code&gt; and make a fetch request to a custom action inside my &lt;code&gt;SessionsController&lt;/code&gt; in my Rails API.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;actions/currentUser.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fD0bzpyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wlg5kfo8j5boq35q1mj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fD0bzpyA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wlg5kfo8j5boq35q1mj6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Custom route in &lt;em&gt;routes.rb&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iBHFMJa7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k1sd24qiiskerb8amqfi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iBHFMJa7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k1sd24qiiskerb8amqfi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Custom action in &lt;em&gt;sessions_controller.rb&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mXN2mnYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ikzzfo1xx4ltr2kao1m9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mXN2mnYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ikzzfo1xx4ltr2kao1m9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;logged_in?&lt;/code&gt; on line 16 is defined in &lt;code&gt;application_controller&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;application_controller.rb&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--e8ZAaZrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jhoul4pvbvbom4dstakd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e8ZAaZrv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jhoul4pvbvbom4dstakd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition to using &lt;code&gt;currentUser&lt;/code&gt; state from Redux store in &lt;code&gt;NavBar.jsx&lt;/code&gt;, I also used it in my &lt;code&gt;RecipeCard&lt;/code&gt; component to render a link to edit a recipe only if a &lt;code&gt;userId&lt;/code&gt; is equal to currentUserId`. This authorizes a user to edit only a recipe that belongs to them. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;RecipeCard.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d5LVR-30--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dw9lerryt5u8v0bf7mgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d5LVR-30--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dw9lerryt5u8v0bf7mgv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Roadblock #3: Managing Nested Forms
&lt;/h4&gt;

&lt;p&gt;This application has three forms total: 1) signup form, 2) login form, 3) recipe form. Both signup and login form state are managed by Redux. I originally was going to use Redux to manage recipe form as well. The problem I ran into with recipe form was that it was a nested form. The three main models in the backend have these relationships: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User has many recipes&lt;/li&gt;
&lt;li&gt;Recipe has many ingredients and belongs to user&lt;/li&gt;
&lt;li&gt;Ingredient belongs to recipe&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I was running into a problem handling changes in the ingredient field form. It wouldn't show the changes in the correct attributes in Redux store. Because a recipe has many ingredients, I also wanted there to be a button that will continually render ingredient fields as I needed to add more ingredients to the recipe. One of the things that fixed it was adding this line of code in &lt;code&gt;recipe.rb&lt;/code&gt; in API.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;recipe.rb&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dxuyiyMr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bt47vvd2101f738z36or.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dxuyiyMr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bt47vvd2101f738z36or.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had completely forgot about &lt;code&gt;accepts_nested_attributes_&lt;/code&gt;! I also needed to add this to &lt;code&gt;strong params&lt;/code&gt; in &lt;code&gt;RecipeController&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;recipe_controller.rb&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ikm0JOiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tttji2q5udu9tjbgh0u4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ikm0JOiZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/tttji2q5udu9tjbgh0u4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
I added an attribute called &lt;code&gt;ingredients_attributes&lt;/code&gt; as an array with attributes from ingredients table. By doing this, the &lt;code&gt;RecipeController&lt;/code&gt; is in charge of creating ingredients in the form. Previously, I had both controller in charge of their own CRUD actions. One of the ways I tried to work around this was creating a separate recipe form component and an ingredient form component and importing ingredient form component into recipe form. Now that recipe is responsible for creating ingredients, there was no need for two separate form components. I made a new recipe form that handled form state locally but still submits form data to Redux store where recipe data is stored. Inside the local state in &lt;code&gt;RecipeForm&lt;/code&gt;, I assigned ingredients as an array of objects. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;RecipeForm.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Cf3N2Mhu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5h1n89s39hizbdih57fb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Cf3N2Mhu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5h1n89s39hizbdih57fb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By assigning &lt;code&gt;ingredients&lt;/code&gt; to an array, I was able to map through it and each time the button "add a new ingredient" is clicked, a new ingredient is added to the array. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;RecipeForm.jsx&lt;/em&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lfXf628x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/os79vihq65p54nkrduv1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lfXf628x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/os79vihq65p54nkrduv1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Add a new ingredient&lt;/code&gt; takes in onClick &lt;code&gt;addIngredient&lt;/code&gt;. The &lt;code&gt;addIngredient&lt;/code&gt; handles adding a new ingredient instance to the previous state of ingredients. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9Rph6s1D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5sw5w9png77keaob3xua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9Rph6s1D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5sw5w9png77keaob3xua.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The recipe form renders with one ingredient field with a button to allow a user to add as many ingredients as they would like. &lt;/p&gt;

&lt;p&gt;I am glad that I was able to get through these roadblocks. I have so many more plans for this application and I will continue to work on this project. I do plan on deploying this application on Heroku once I have decide how I want the RecipeCard component to look. It has been an insane ten months and I have come a long way. I came into Flatiron School not knowing how to code and now I am able to build a full-scale web application. I am excited to learn more and continue on this journey!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YC4qGyq7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://user-images.githubusercontent.com/52929582/87613777-4e7ad900-c6dc-11ea-8f3e-b97e85a97f69.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YC4qGyq7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://user-images.githubusercontent.com/52929582/87613777-4e7ad900-c6dc-11ea-8f3e-b97e85a97f69.gif" alt="react-project-demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chayadeaver/recipes-client"&gt;Frontend repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/chayadeaver/recipes-api"&gt;Backend repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>redux</category>
      <category>rails</category>
    </item>
    <item>
      <title>JavaScript Project: Cafe Menu App</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 06 May 2020 14:25:57 +0000</pubDate>
      <link>https://forem.com/chayadeaver/javascript-project-cafe-menu-app-42h</link>
      <guid>https://forem.com/chayadeaver/javascript-project-cafe-menu-app-42h</guid>
      <description>&lt;p&gt;My fourth portfolio project for Flatiron School involves creating a web application using Rails API for backend and Vanilla JavaScript for frontend. This will be my first time using separate utilizing different frameworks for frontend and backend. My original idea for this project was to build on my Rails project idea, which was an online-ordering application that uses a shopping cart feature, a third-party authentication with GitHub and an admin role that can add items to my database. I quickly realized that the JavaScript/Rails project requirements were much simpler that the previous one and learned that my idea was beyond the scope fo the project. I then decided to restart my project but instead of having a shopping cart feature, I would just show that I can send fetch requests to create, read, and delete from the server. Even though I opted for a more simpler route this time around, it allowed me to take a step back and get a better understanding of what I needed to do within scope of the project. I also learned more about CSS styling and used Bootstrap to render my form. This my thought process throughout project build.&lt;/p&gt;

&lt;p&gt;I started by creating a main project directory that holds two directories, one for backend, one for frontend. I then created my Rails app while inside the backend directory. I used Postgresql instead of SQLite3 that comes with Rails by default. I have deployed my Sinatra and Rails project to Heroku and the database has to be Postgresql to do so. To generate a Rails app with Postgresql, write this in the terminal:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`rails new rail-app-api --api --database=postgresql`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Because I'm using Rails purely for backend, I need to add the &lt;code&gt;--api&lt;/code&gt; flag so it doesn't generate any &lt;code&gt;views&lt;/code&gt; folders. Adding the &lt;code&gt;--database=postgresql&lt;/code&gt; will create the app with Postgres instead of SQLite3. The big difference when setting up database with Postgres is before migrating the database this commands needs to be run &lt;code&gt;rails db:create&lt;/code&gt;. One more thing before getting Postgres to work is to have Postgres App running on your computer the whole time during project build. You can download Postgres app &lt;a href="https://www.postgresql.org/download/"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Once I set up my Postgres, I created two models: &lt;code&gt;Menu&lt;/code&gt; and &lt;code&gt;Item&lt;/code&gt;. The &lt;code&gt;Menu&lt;/code&gt; model just contains name that is a string. There were three types of menus: Breakfast, Lunch, and Dinner. For this project, my &lt;code&gt;Menu&lt;/code&gt; has a &lt;code&gt;has_many&lt;/code&gt; relationship with &lt;code&gt;Item&lt;/code&gt; and &lt;code&gt;Item&lt;/code&gt; has a &lt;code&gt;belongs_to&lt;/code&gt; relationship to &lt;code&gt;Menu&lt;/code&gt;. I then created some items in my seeds file where items are created associated to a menu. After seeding my database, I made sure I had paths in my routes and wrote controller actions for &lt;code&gt;index&lt;/code&gt;, &lt;code&gt;show&lt;/code&gt;, &lt;code&gt;create&lt;/code&gt;, and &lt;code&gt;destroy&lt;/code&gt; for my &lt;code&gt;ItemsController&lt;/code&gt; and &lt;code&gt;index&lt;/code&gt; and &lt;code&gt;show&lt;/code&gt; for &lt;code&gt;MenusController&lt;/code&gt;. Instead of rendering each action to a views route, I rendered each action with JSON, so my JavaScript will be able to read it and render it to the DOM. &lt;/p&gt;

&lt;p&gt;For the JavaScript side, I started by creating &lt;code&gt;index.html&lt;/code&gt; and &lt;code&gt;index.js&lt;/code&gt;. My &lt;code&gt;index.html&lt;/code&gt; contains script tags for each JavaScript file that I would use and some hard-code features such as my navigation bar and my item form. My &lt;code&gt;index.js&lt;/code&gt; calls on my &lt;code&gt;app.js&lt;/code&gt; file. My App class is where my app starts and it starts with rendering all my items. To render all my items, I had to fetch from the server using AJAX. With &lt;a href="https://www.w3schools.com/xml/ajax_intro.asp"&gt;AJAX&lt;/a&gt;, one can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update a web page without reloading the page&lt;/li&gt;
&lt;li&gt;Request data from a server - after the page has loaded&lt;/li&gt;
&lt;li&gt;Receive data from a server - after the page has loaded&lt;/li&gt;
&lt;li&gt;Send data to a server - in the background&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I used AJAX to fetch from the server and received data and was able to create an instance of &lt;code&gt;Item&lt;/code&gt; on the client side to render items to the DOM. I made a method called &lt;code&gt;renderAllItems&lt;/code&gt; that fetched from the server and converted the JSON into new &lt;code&gt;Item&lt;/code&gt; objects. I then made another method called &lt;code&gt;createItemCard&lt;/code&gt; that creates DOM elements base on the properties of &lt;code&gt;Item&lt;/code&gt; matching the server. I rendered all items inside the Menu class and created the DOM elements in the Item class on the JavaScript frontend(client). In order to be able to call a method that belongs to Item class inside of Menu class, I had to create a new Item object inside the Menu class and then be able to call &lt;code&gt;createItemCard&lt;/code&gt; This is how it looks:&lt;/p&gt;

&lt;p&gt;// Menu class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;renderAllItems() {
        this.itemsAdapter.getItems().then(items =&amp;gt; {
            items.forEach(item =&amp;gt; {
                const itemObj = new Item(item.attributes.name, item.attributes.price, item.attributes.description, item.attributes.image_url, item.id, item.attributes.menu.id, item.attributes.menu.name)
                itemObj.createItemCard()
            });
        })
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;// Item class&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createItemCard() {
        const container = document.querySelector(".container")
        const itemCard = document.createElement("div")
        itemCard.className = "item-card"
        itemCard.setAttribute("data-id", `${this.id}`)
        itemCard.setAttribute("data-menu-id", `${this.menu_id}`)
        const itemImage = document.createElement("div")
        itemImage.className = "item-image"
        itemImage.style.backgroundImage = `url("${this.image_url}")`
        itemImage.style.backgroundRepeat = "no-repeat"
        itemImage.style.backgroundSize = "cover"
        itemImage.style.backgroundPosition = "center"
        itemImage.style.height = "300px"
        itemImage.style.borderRadius = "10px"
        // const imgTag = document.createElement("img")
        // imgTag.src = this.image_url
        const itemNamePrice = document.createElement("div")
        itemNamePrice.className = "name-and-price"
        const itemName = document.createElement("div")
        itemName.className = "item-name"
        itemName.textContent = this.name
        const itemPrice = document.createElement("div")
        itemPrice.className = "item-price"
        itemPrice.textContent = `\$${this.price}`
        const itemDesc = document.createElement("div")
        itemDesc.className = "item-description"
        itemDesc.textContent = this.description
        const deleteBtn = document.createElement("button")
        deleteBtn.className = "delete-item"
        deleteBtn.textContent = "Delete Item"
        deleteBtn.addEventListener("click", (e) =&amp;gt; this.deleteItem(e))
        //appending to parent
        // itemImage.appendChild(imgTag)
        itemNamePrice.append(itemName, itemPrice)
        itemCard.append(itemImage, itemNamePrice, itemDesc, deleteBtn)
        container.append(itemCard)
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then proceeded to write methods that rendered items that belonged to each menu and added those methods to an event listener and loop through each time a different navigation bar "link" is clicked. &lt;/p&gt;

&lt;p&gt;I feel like I had the hardest time with this project than the last three so far. I couldn't grasp &lt;code&gt;fetch&lt;/code&gt; and how to create DOM elements until I was half-way through finishing my project that it finally started to make sense. I know that it's part of the learning process and challenges will come up. I'm glad I didn't give up and stayed the course. Onward to React!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L_Q5QQ1V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://user-images.githubusercontent.com/52929582/87613626-d3192780-c6db-11ea-896f-09c777ca3355.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L_Q5QQ1V--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://user-images.githubusercontent.com/52929582/87613626-d3192780-c6db-11ea-896f-09c777ca3355.gif" alt="js-demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chayadeaver/js-project"&gt;gitHub repository&lt;/a&gt;&lt;br&gt;
&lt;a href="https://chayadeaver.github.io/js-project/menu-client/"&gt;deployed app&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Rails Project  Utilizing Devise Gem with Admin Role and a Shopping Cart</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:39:07 +0000</pubDate>
      <link>https://forem.com/chayadeaver/my-rails-project-utilizing-devise-gem-with-admin-role-and-a-shopping-cart-38kh</link>
      <guid>https://forem.com/chayadeaver/my-rails-project-utilizing-devise-gem-with-admin-role-and-a-shopping-cart-38kh</guid>
      <description>&lt;p&gt;It's project time again at Flatiron School and it's for Ruby on Rails. Rails is a&lt;a href="https://rubyonrails.org/"&gt; web-application framework that includes everything needed to create a database-back web applications according to Model-View-Controller (MVC) framework&lt;/a&gt;. We were introduced to MVC back in the Sinatra section of the curriculum and Rails brings it to a full circle. This is my favorite section of the curriculum so far because it allows us to utilize what we've learned from the beginning into one framework. &lt;/p&gt;

&lt;p&gt;I decided to build my project on my Sinatra project idea. To recap, my Sinatra project was called Cafe-Online-Ordering, which was a simple web application that lets users create, edit, and delete orders from a cafe menu. I'm building on this simple idea and adding new features such as a fully-functional cart, an admin role who can add new items to the menu, and the ability to login using a third-party authentication (OAuth) via GitHub. &lt;br&gt;
There are a few project requirements that needed to be met with this project regarding MVC. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Must include at least one has_many relationship&lt;/li&gt;
&lt;li&gt;Must include at least one  belongs_to relationship&lt;/li&gt;
&lt;li&gt;Must include at least two has_many through relationships&lt;/li&gt;
&lt;li&gt;Must include at least one many-to-many relationship&lt;/li&gt;
&lt;li&gt;The "through" part of the has_many through includes at least one user submittable attribute, that is to say, some attribute other than its foreign keys that can be submitted by the app's user &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because I wanted to build on an existing app, I had met some of those requirements already but I'll be adding more models. These are the models used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Menu&lt;/li&gt;
&lt;li&gt;Category&lt;/li&gt;
&lt;li&gt;Item&lt;/li&gt;
&lt;li&gt;User&lt;/li&gt;
&lt;li&gt;Cart&lt;/li&gt;
&lt;li&gt;Order&lt;/li&gt;
&lt;li&gt;LineItem&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I wanted there to be an admin role so I could showcase nested resource and show a many-to-many relationship. The admin has access to manage these models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Menu has_many items and has_many categories through items&lt;/li&gt;
&lt;li&gt;Category has_many items and has_many menus through items&lt;/li&gt;
&lt;li&gt;Item belongs to menu and category&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The "customer" side of the user function which the admin can also access would be the cart-order feature like so:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User has many orders and has one cart&lt;/li&gt;
&lt;li&gt;Order has many line_items and has many items through line_items and belongs to user&lt;/li&gt;
&lt;li&gt;Cart has many line_items and has many items through line_items&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Based on these associations, I have two join-tables: items and line_items. Items joins menus and categories while line_items join cart and items. I am able to say there are two many-to-many relationships here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Menu and category have a many-to-many relationship through items&lt;/li&gt;
&lt;li&gt;Cart and item have a many-to-many relationship through line-items&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that I have the relationships that meets the requirements, I will go over my user authentication. I used the Devise gem, which allows for flexible authentication and creates helpers for authentication. I had a hard time grasping this at first and finally I was able to follow an instructor's video and code along with the video getting the gem set up and implementing OAuth. I decided to set this all up before adding logic to my other MVCs. To use the gem, you have to install it and then create the models that you want the gem to be utilized. &lt;/p&gt;

&lt;p&gt;To use Devise, I add &lt;code&gt;gem 'devise'&lt;/code&gt; to my gemfile. Then run &lt;code&gt;bundle install&lt;/code&gt; and &lt;code&gt;rails g devise:install&lt;/code&gt; to initialize devise for my project. I then generate my User model with devise like so, &lt;code&gt;rails g devise user&lt;/code&gt;. This will generate &lt;code&gt;user.rb&lt;/code&gt;, the migration, and a few other files. Check the migration and see if there attributes you might want to add. I added &lt;code&gt;name&lt;/code&gt; to my users table because I want each user to have a name besides the email and password that gets generated with Devise. Some of the helper methods that come with Devise are &lt;code&gt;current_user&lt;/code&gt;, &lt;code&gt;user_signed_in?&lt;/code&gt; and &lt;code&gt;authenticate_user!&lt;/code&gt;. Without Devise, I would have to create those methods myself but now I don't need to. To learn more about routes and controllers, [this is the documentation]&lt;a href="https://github.com/heartcombo/devise"&gt;https://github.com/heartcombo/devise&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;For the admin role, there are two ways: create an Admin using Devise or add an admin attribute in the users table. I added an admin column to my users table and a checkbox to the user signup page. I did have to create a helper method in my ApplicatonController to give admin only privileges:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`def admin_only
    unless current_user.admin
        redirect_to users_show_path(current_user), notice: 
      "You must be an admin to     perform that function!"
    end
 end`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I also created a custom action for my users controller. Devise doesn't come with a users' show page and as I was building my project I decided that I would need a show page for my current user. To add custom actions for Devise-generated models, I just generated a users controller with a show action:&lt;code&gt;rails g controller Users show&lt;/code&gt;. After that, I made sure that &lt;code&gt;routes.rb&lt;/code&gt; included my new controller action. &lt;/p&gt;

&lt;p&gt;My next feature that I added was a cart feature. My cafe-online-ordering Sinatra project had a cart-like function but it was a very basic feature. The cart is based on each session so once the order has been submitted, the cart is emptied because the session is deleted and that cart becomes an order. The method for that lives inside of the application controller under the private tag:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`def current_cart
    if session[:cart_id]
        cart = Cart.find_by(:id =&amp;gt; session[:cart_id])
        if cart.present?
            @current_cart = cart
        else
        session[:cart_id] = nil
        end
    end

    if session[:cart_id] == nil
        @current_cart = Cart.create
        session[:cart_id] = @current_cart.id
    end
  end`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The cart views should have just one action: show. It will show all the items being added to it. It also me to add and reduce quantity of each item in the cart using these actions inside the controller.&lt;/p&gt;

&lt;p&gt;`def add_quantity&lt;br&gt;
        @line_item.quantity += 1&lt;br&gt;
        @line_item.save&lt;br&gt;
        redirect_to cart_path(@current_cart)&lt;br&gt;
    end&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def reduce_quantity
    if @line_item.quantity &amp;gt; 1
        @line_item.quantity -= 1
    end
    @line_item.save
    redirect_to cart_path(@current_cart)
end`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;That's it for my Rails project! I'm really glad to be finished. I have deployed my project on Heroku &lt;a href="https://rails-cafe-online-ordering.herokuapp.com/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.loom.com/share/991fd0349e054adfb6d727f9e70513b2"&gt;Video demo&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My Second Portfolio Project - Cafe Online Ordering</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:38:15 +0000</pubDate>
      <link>https://forem.com/chayadeaver/my-second-portfolio-project-cafe-online-ordering-ljg</link>
      <guid>https://forem.com/chayadeaver/my-second-portfolio-project-cafe-online-ordering-ljg</guid>
      <description>&lt;p&gt;In my last post, I talked about possible project ideas. I ended going with a cafe order app. I created a cafe menu containing coffee drinks, tea drinks, and pastries. I wanted a few features, such like only someone who signed up for an account can create an order from the menu and the user has to be logged in to edit orders and can only edit and delete their own orders. Anyone can access the cafe menu but won't be able to create an order unless an account is created. A user can create an account by providing a name, email and a password, while only an account can be created if the email is valid. This means an account can't be created without a domain. I will go over a few of these things in my post. I was also able to deploy my app on Heroku, which is another separate process for that and I will add what I did to do so.  &lt;/p&gt;

&lt;p&gt;In my app, there are five models: &lt;code&gt;User&lt;/code&gt;, &lt;code&gt;Order&lt;/code&gt;, &lt;code&gt;Item&lt;/code&gt;, &lt;code&gt;Item_Order&lt;/code&gt;, and &lt;code&gt;Category&lt;/code&gt;. &lt;code&gt;Category&lt;/code&gt; is used for the view pages that features the cafe menu because in my cafe, there are three menu item types: coffee, tea, and food. I seeded my items database with basic cafe items with a item title and price of the item. I utilize the &lt;code&gt;many-to-many&lt;/code&gt; relationship between &lt;code&gt;Item&lt;/code&gt; and &lt;code&gt;Order&lt;/code&gt; using a join table &lt;code&gt;Item_Order&lt;/code&gt; by calling &lt;code&gt;has_many_through&lt;/code&gt;.  Here are the relationships I used for this project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A user has many orders
Orders can have many items and items can have many orders
Category has many items

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

&lt;/div&gt;



&lt;p&gt;To create &lt;code&gt;many-to-many&lt;/code&gt; relationship between &lt;code&gt;items&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt;, I wrote this in &lt;code&gt;Order&lt;/code&gt; and &lt;code&gt;Item&lt;/code&gt; model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Order &amp;lt; ActiveRecord::Base
   has_many :item_orders, dependent: :destroy
   has_many :items, through: :item_orders
     # some other validations
end

class Item &amp;lt; ActiveRecord::Base
    belongs_to :category
    has_many :items_orders
    has_many :orders, through: :item_orders
    end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;dependent: :destroy&lt;/code&gt; in ActiveRecord refers to when deleting whole orders and old data not persisting. I had some trouble with items from previous deleted orders persisting in newly created orders so including &lt;code&gt;dependent: :destroy&lt;/code&gt; allows the &lt;code&gt;item_orders&lt;/code&gt; table to be destroyed each time an order gets deleted so it doesn't show up in the next created order. Join tables are used in &lt;code&gt;many-to-many&lt;/code&gt; relationships in that it only contains foreign keys for the &lt;code&gt;items&lt;/code&gt; and &lt;code&gt;orders&lt;/code&gt; tables. This comes in handy in the create and edit order forms. I had some difficulty understanding this concept when it was first introduced but seeing it in action and creating these forms and routes has helped solidify my understanding.&lt;/p&gt;

&lt;p&gt;I utitlized ActiveRecord validations to check for bad data and for valid emails. Instead of creating a check inside the controller, I placed the validations inside the &lt;code&gt;User&lt;/code&gt; model 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;    validates :email, presence: true
    validates :email, uniqueness: true
    validates_format_of :email, :with =&amp;gt; /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The validations for email were for the purpose that an email has to be entered in and it has to be unique. The email format utilizes regular expressions (regex) and can be referenced &lt;a href="https://rubular.com/"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I really enjoyed working on this Sinatra project. It was much simpler than the CLI project because I knew what to expect what a project should be like and it brought back concepts of object-orientation. I used flash messages to display successful actions such as accounts and orders and error messages. I styled those messages differently so it could be more pleasing to the eye. I also created buttons for links and submit buttons to make them look the same and for it to have similar color-scheme as my background. This experience has helped me delve deeper in CSS styling. &lt;/p&gt;

&lt;p&gt;Even as I started this project, I knew I wanted to deploy it to Heroku so it can showcase what projects I've created, like I published my gem for the CLI project. The process to deploy on Heroku was more tedious than publishing my gem. For example, Flatiron School teaches SQL using &lt;code&gt;Sqlite3&lt;/code&gt; gem but Heroku doesn't support&lt;code&gt;Sqlite3&lt;/code&gt;. Some resources I've read said that I should be able to run &lt;code&gt;Sqlite3&lt;/code&gt; in development and run &lt;code&gt;Postgres&lt;/code&gt; in production for deploying to Heroku. I was running into errors having &lt;code&gt;Sqlite3&lt;/code&gt; in any part of my code so I ended up removing &lt;code&gt;Sqlite3&lt;/code&gt; altogether and re-creating my migrations and seeding my database using &lt;code&gt;Postgres&lt;/code&gt;. There were some hiccups along the way but I was able to get my database to work using &lt;code&gt;Postgres&lt;/code&gt; instead of &lt;code&gt;Sqlite3&lt;/code&gt;. This is the resource I used to &lt;a href="https://github.com/enoch2k2/sinatrabook"&gt;deploy my Sinatra app to Heroku&lt;/a&gt;. It was an instructor at Flatiron who also made a video lecture about deploying Sinatra project to Heroku &lt;a href="https://www.youtube.com/watch?v=zPm-XSmbB_s&amp;amp;feature=youtu.be"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm really glad to be done. It was a lot of fun and I can't wait to see how Rails will be!&lt;/p&gt;

&lt;p&gt;This is my app on &lt;a href="https://cafe-online-ordering.herokuapp.com/"&gt;Heroku&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Starting My Sinatra Project</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:37:16 +0000</pubDate>
      <link>https://forem.com/chayadeaver/starting-my-sinatra-project-28cc</link>
      <guid>https://forem.com/chayadeaver/starting-my-sinatra-project-28cc</guid>
      <description>&lt;p&gt;I still have a few more weeks before my Sinatra project so I have been thinking about a few ideas. I want to keep the theme I had with my CLI project that involves around food and restaurants. My CLI Data Gem project was about displaying restaurants and their attributes based on Yelp's API data. For my Sinatra project, I want to create a web application that allows users to make online orders for a local coffee shop make/bakery. &lt;/p&gt;

&lt;p&gt;The idea is that in order to be able to order from this cafe, one would need to sign up for an account. Once an account is created, it should take the user to a menu page that displays different drinks and bakery items. I want to these pages look nice as well so I plan on doing a good deal of CSS. It has to be functional and practical. I might include images as well, but I'm not sure yet. This is why I wanted to go ahead and get a headstart on it so I have time to tweak the CSS after I get the Ruby/html part working. &lt;/p&gt;

&lt;p&gt;The reason why I wanted to do my project on something like online ordering is because I've worked at Starbucks for the last seven years and I'm familar with their mobile ordering system on the employee side and customer side. There are many things that I like about their system but there are also things that could be better. I am also an avid user of mobile ordering systems in general. I am an introvert and I have a toddler so a lot of times I just need to grab stuff really quickly and don't have the time to talk to people when I can just order from an app. I've had experience being on the user end of mobile ordering systems and now that I'm learning how to create web applications like this, it brings it all together so hopefully I can contribute something worthwhile. I am still gathering some more information and will update more when I get a better grasp of exactly how I want my project to look.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Recap of what I've learned so far</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:36:22 +0000</pubDate>
      <link>https://forem.com/chayadeaver/recap-of-what-i-ve-learned-so-far-593n</link>
      <guid>https://forem.com/chayadeaver/recap-of-what-i-ve-learned-so-far-593n</guid>
      <description>&lt;p&gt;It's really awesome since I've started this program the different things we've learned and how they're building on another. With Procedural Ruby, we learned how methods work and how to access elements in arrays and hashes. With Object-Oriented Ruby, we learned about classes and instances and how classes and objects relate to one another. With SQL, we learned about databases and how to query from them. It can be a little overwhelming to learn all these new things and to keep remembering how they are used.&lt;/p&gt;

&lt;p&gt;Next, we went over ORM, which is Object Relational Mapping. ORM is a way for our Ruby programs to manage database data by "mapping" database tables to classes and instances of classes to rows in those tables. It is essentially incorporating what we previously learned in Object-Oriented Ruby and merging in SQL and allows us to picture raw data relating with different classes. &lt;/p&gt;

&lt;p&gt;After ORM, we learned about ActiveRecord. In ORM, we were building our own classes to get our objects to interact with our databases but this meant that there would be a lot of custom code for each project and each class that would do the same thing. Because developers are lazy, they created a gem called ActiveRecord, a Ruby gem that link our Ruby models with rows in a database table. Essentially, we can use ORM and call on the methods for it by typing one line. &lt;/p&gt;

&lt;p&gt;All this to say is that I've been learning many new concepts and it's really exciting and fun to see it being applied to real world apps. As I move onto Sinatra and Rails, it will continue to build on one another. I'm excited to learn and keep going!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Wrapped up my first project and started SQL</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:33:52 +0000</pubDate>
      <link>https://forem.com/chayadeaver/wrapped-up-my-first-project-and-started-sql-2o80</link>
      <guid>https://forem.com/chayadeaver/wrapped-up-my-first-project-and-started-sql-2o80</guid>
      <description>&lt;p&gt;I finished my project and had my project assessment on October 29th. It went pretty well. Most of my refactoring was done during the live coding and was given one task to do afterwards. I had finished my project assessment early so it left me a few days to rest and refresh until the next deployment of lessons. &lt;/p&gt;

&lt;p&gt;Last week, we started learning SQL. SQL stands for "Structured Query Language". SQL deals creating and querying from a database. We learned how to write methods in Ruby on how to create a table, add to it, and joined tables together. &lt;/p&gt;

&lt;p&gt;This week is ORM, which is the technique of accessing a relational database using an object-oriented programming language. This ties in what we've been learning in Procedural Ruby and Object-Oriented Ruby. I really enjoy it so far and it's been simple and straight-forward. ActiveRecord and Sinatra is next on the list and after that, our second project. I can't wait to get started!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>My First CLI Data Gem Project</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:32:32 +0000</pubDate>
      <link>https://forem.com/chayadeaver/my-first-cli-data-gem-project-5a1d</link>
      <guid>https://forem.com/chayadeaver/my-first-cli-data-gem-project-5a1d</guid>
      <description>&lt;p&gt;It has been a long two weeks since I started thinking about what I wanted to do for my project. Figuring out how I want my project to run has been the hardest part in this process. Once I was able to create my gem and get my flow in CLI working, it became fun. &lt;/p&gt;

&lt;p&gt;To decide on what I wanted to do for my CLI project, I thought about my experiences. I have worked in the food industry all of my life so naturally I decided to make my first project about restaurants. &lt;br&gt;
I originally wanted to scrape data from TripAdvisor to parse restaurant names, phone number, and address. I struggled with scraping a lot because that particular site changes daily and the nested elements were making the information difficult to obtain. After a few days of struggling to iterate over really nested arrays, I decided to parse from an API instead of scraping from a webpage.&lt;/p&gt;

&lt;p&gt;An API stands for application programming interface, which is a &lt;a href="https://www.webopedia.com/TERM/A/API.html"&gt;set of routines, protocols, and tools for building software application&lt;/a&gt;. I am parsing information for my project from Yelp API and setting pieces of data to key/values in a hash that gets instantiated when a new instance of my Restaurant class is created.&lt;/p&gt;

&lt;p&gt;I made three files for my directory: API, CLI, and Restaurant, all with ".rb" tag. The program runs in the CLI class so that is where the flow of the gem resides. The program starts by printing a numbered list of cuisines that I parsed from the API. Next, it asks for the user to input a number that corresponds to the cuisine. After the input, it will display a restaurant name or a numbered list of restaurant names that corresponds to that particular cuisine. It asks the user to input another number to find out more about the restaurants that are displayed. After the second user input, it will display restaurant information such as address, website url, phone number, rating, price range and review count. The user will be able to exit the program at any point by typing "end" in the prompt. &lt;/p&gt;

&lt;p&gt;I'm really glad the gem finally runs and works. I have published my gem &lt;a href="https://rubygems.org/gems/Knox_Restaurants"&gt;here&lt;/a&gt;. It's been a great experience to be able to build a gem using what I have learn in the past month at Flatiron School. I can't wait to create more projects!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Preparing for my first CLI Project</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:30:49 +0000</pubDate>
      <link>https://forem.com/chayadeaver/preparing-for-my-first-cli-project-kmg</link>
      <guid>https://forem.com/chayadeaver/preparing-for-my-first-cli-project-kmg</guid>
      <description>&lt;p&gt;My progress in my coursework is going by pretty quickly. I want to cement my understanding of OOP before starting my first project. I am currently working on Student Scraper Lab and I have the CLI Data Gem Portfolio Project Lab before I can start my project. I am going to slow down my pace and practice more OOP concepts like Scraping and Modules. I plan on going back and re-reading previous lessons and redoing the labs. &lt;/p&gt;

&lt;p&gt;I am really enjoying learning all of what I am learning so far and I am excited at the outcome of all this. Work has been really rough with a lot of turnover and many of my managment team leaving the company, with my current manager hiring people unfit for their jobs. It just makes me want to work at this much harder so I can start my new career as soon as I can.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The "Why": Reason for My Career Change</title>
      <dc:creator>Chaya Deaver</dc:creator>
      <pubDate>Wed, 29 Apr 2020 19:29:39 +0000</pubDate>
      <link>https://forem.com/chayadeaver/the-why-reason-for-my-career-change-4njp</link>
      <guid>https://forem.com/chayadeaver/the-why-reason-for-my-career-change-4njp</guid>
      <description>&lt;p&gt;I'd like to say that my story is similar to many of those seeking to make a career change. I have &lt;br&gt;
college degree that I don't use and I'm tired of living my current lifestyle. Growing up, I was always interested in technology and figuring out how things work. I was the person my family would call upon to fix things wrong with computers or phones, which are very minor fixes. I really enjoy learning new things and am eager to start new things.&lt;/p&gt;

&lt;p&gt;I started college with a mathematics major and switched to computer science in my sophomore year. I took my first intro to computer programming course in 2009 learning Java. After that class, I decided that programming wasn't for me so I switch majors again to kinesiology. I went on to graduate with a Bachelor's of Science in Kinesiology with a concentration in sports medicine. I decided to defer continuing education because I hadn't decided which path I wanted to take and didn't want to add on to my student debt. A big reason why I didn't pursue a graduate degree was BECAUSE I didn't want to add to my debt. I was weary about the job market and whether or not I would like the job I would have if I were to continue on to physical therapy like many of my peers or jump into becoming a personal trainer. I just really couldn't see myself doing those jobs. &lt;/p&gt;

&lt;p&gt;After graduating college in 2012, I moved from Greensboro, North Carolina to Knoxville, Tennessee. I was newly engaged to my-then fiance and had started working at a call center for Comcast's internet tech support. I knew then that I enjoyed fixing things and all the things pertaining to tech but I still had a lingering negative thought about programming from that first class. I really didn't like the job so I left the company and started working for Starbucks in 2013, three months after I got married. My other passion is cooking and preparing food. I had a barista job for a few years in college at a college dining service Starbucks. We would sell some Starbucks items but didn't follow all the standards. I enjoyed working at Starbucks much more than working at the call center, even though I took a $4 pay-cut. &lt;/p&gt;

&lt;p&gt;Some time pass and I was able to move up from a barista position to shift supervisor at Starbucks. The job was easy and the pay was almost comparable to what I was making at Comcast entry-level. So to put it lightly, it does not pay well. I worked that job for three and a half years, slowly feeling burned out and unappreciated. I would come to work early every day and stay late as much as allowed. It has been a great experience and I've met many great people. Towards October 2016, I was actively looking and applying to new jobs when I found out I was pregnant with our first child. At this point, I didn't see it as productive to start a new job knowing I would have to take a leave of absence. I decided to stick it out at Starbucks until my due date. I chose not to go back to work because my husband's work hours didn't allow for me to work unless we pay for childcare. It didn't make sense to go back to work just to pay for childcare as that was I wouldve been doing. &lt;/p&gt;

&lt;p&gt;I took a break for a year and a half before I returned to Starbucks. My husband took a different job and his work hours allowed the flexibily for me to work and not have to put my son in daycare. It was not ideal but we've made it work. Recent management changes and co-worker turnovers has made me think about finding some other type of work. I found Career Karma app one day and started the 21-day challenge. I found a community of people who were in the same boat I was in. I found that I do enjoy coding as there are so many ways to learn and many languages and ways to apply those languages. The big turning point for a step into wanting to return to programming was Income Share Agreement (ISA). Having the ability to defer tuition after I start a job with no interest was exactly what I needed in a school option. I researched some bootcamps and found Flatiron School. I had heard many great things and their coursework was very flexible for my schedule and learning style. It was daunting to go back to school after 7 years but I'm very excited to finally start my cohort and very eager to see what the future holds. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
